diff options
author | Chee Yang Lee <chee.yang.lee@intel.com> | 2022-09-13 11:47:38 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-16 17:53:28 +0100 |
commit | 9ca32cf9abc3fe99313c37e964bca70f3d599a6d (patch) | |
tree | 634f20904f9846b8ee3d906f9af859b6cfaa1666 /meta | |
parent | 459d081bf82c5a9a19221e7700517399526729f6 (diff) | |
download | poky-9ca32cf9abc3fe99313c37e964bca70f3d599a6d.tar.gz |
gnutls: fix CVE-2021-4209
(From OE-Core rev: d08031bffafbd2df7e938d5599af9e818bddba04)
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-support/gnutls/gnutls/CVE-2021-4209.patch | 37 | ||||
-rw-r--r-- | meta/recipes-support/gnutls/gnutls_3.6.14.bb | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-support/gnutls/gnutls/CVE-2021-4209.patch b/meta/recipes-support/gnutls/gnutls/CVE-2021-4209.patch new file mode 100644 index 0000000000..0bcb55e573 --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls/CVE-2021-4209.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 3db352734472d851318944db13be73da61300568 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daiki Ueno <ueno@gnu.org> | ||
3 | Date: Wed, 22 Dec 2021 09:12:25 +0100 | ||
4 | Subject: [PATCH] wrap_nettle_hash_fast: avoid calling _update with zero-length | ||
5 | input | ||
6 | |||
7 | As Nettle's hash update functions internally call memcpy, providing | ||
8 | zero-length input may cause undefined behavior. | ||
9 | |||
10 | Signed-off-by: Daiki Ueno <ueno@gnu.org> | ||
11 | |||
12 | https://gitlab.com/gnutls/gnutls/-/commit/3db352734472d851318944db13be73da61300568 | ||
13 | Upstream-Status: Backport | ||
14 | CVE: CVE-2021-4209 | ||
15 | Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> | ||
16 | --- | ||
17 | lib/nettle/mac.c | 4 +++- | ||
18 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/lib/nettle/mac.c b/lib/nettle/mac.c | ||
21 | index f9d4d7a8df..35e070fab0 100644 | ||
22 | --- a/lib/nettle/mac.c | ||
23 | +++ b/lib/nettle/mac.c | ||
24 | @@ -788,7 +788,9 @@ static int wrap_nettle_hash_fast(gnutls_digest_algorithm_t algo, | ||
25 | if (ret < 0) | ||
26 | return gnutls_assert_val(ret); | ||
27 | |||
28 | - ctx.update(&ctx, text_size, text); | ||
29 | + if (text_size > 0) { | ||
30 | + ctx.update(&ctx, text_size, text); | ||
31 | + } | ||
32 | ctx.digest(&ctx, ctx.length, digest); | ||
33 | |||
34 | return 0; | ||
35 | -- | ||
36 | GitLab | ||
37 | |||
diff --git a/meta/recipes-support/gnutls/gnutls_3.6.14.bb b/meta/recipes-support/gnutls/gnutls_3.6.14.bb index e9af71c7bd..f1757871ce 100644 --- a/meta/recipes-support/gnutls/gnutls_3.6.14.bb +++ b/meta/recipes-support/gnutls/gnutls_3.6.14.bb | |||
@@ -26,6 +26,7 @@ SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar | |||
26 | file://CVE-2021-20231.patch \ | 26 | file://CVE-2021-20231.patch \ |
27 | file://CVE-2021-20232.patch \ | 27 | file://CVE-2021-20232.patch \ |
28 | file://CVE-2022-2509.patch \ | 28 | file://CVE-2022-2509.patch \ |
29 | file://CVE-2021-4209.patch \ | ||
29 | " | 30 | " |
30 | 31 | ||
31 | SRC_URI[sha256sum] = "5630751adec7025b8ef955af4d141d00d252a985769f51b4059e5affa3d39d63" | 32 | SRC_URI[sha256sum] = "5630751adec7025b8ef955af4d141d00d252a985769f51b4059e5affa3d39d63" |