diff options
author | Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com> | 2021-03-11 23:21:28 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-14 16:33:59 +0000 |
commit | a9d032345f78f7a46c455b69f9cf0268944729f7 (patch) | |
tree | 92d468e8e59214ac33241393a7dc6ebe923be192 | |
parent | 6a33b20b6a5b0734c2535c2f47c7c34b2443f1e2 (diff) | |
download | poky-a9d032345f78f7a46c455b69f9cf0268944729f7.tar.gz |
glibc: Fix CVE-2021-27645
CVE:
CVE-2021-27645
(From OE-Core rev: 0d6b266c469a35628a3602590611d05ebbf4d562)
Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/glibc/glibc/CVE-2021-27645.patch | 51 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc_2.33.bb | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/CVE-2021-27645.patch b/meta/recipes-core/glibc/glibc/CVE-2021-27645.patch new file mode 100644 index 0000000000..26c5c0d2a9 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/CVE-2021-27645.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From dca565886b5e8bd7966e15f0ca42ee5cff686673 Mon Sep 17 00:00:00 2001 | ||
2 | From: DJ Delorie <dj@redhat.com> | ||
3 | Date: Thu, 25 Feb 2021 16:08:21 -0500 | ||
4 | Subject: [PATCH] nscd: Fix double free in netgroupcache [BZ #27462] | ||
5 | |||
6 | In commit 745664bd798ec8fd50438605948eea594179fba1 a use-after-free | ||
7 | was fixed, but this led to an occasional double-free. This patch | ||
8 | tracks the "live" allocation better. | ||
9 | |||
10 | Tested manually by a third party. | ||
11 | |||
12 | Related: RHBZ 1927877 | ||
13 | |||
14 | Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> | ||
15 | Reviewed-by: Carlos O'Donell <carlos@redhat.com> | ||
16 | |||
17 | Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=commit;h=dca565886b5e8bd7966e15f0ca42ee5cff686673] | ||
18 | |||
19 | CVE: CVE-2021-27645 | ||
20 | |||
21 | Reviewed-by: Carlos O'Donell <carlos@redhat.com> | ||
22 | Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com> | ||
23 | --- | ||
24 | nscd/netgroupcache.c | 4 ++-- | ||
25 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
26 | |||
27 | diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c | ||
28 | index dba6ceec1b..ad2daddafd 100644 | ||
29 | --- a/nscd/netgroupcache.c | ||
30 | +++ b/nscd/netgroupcache.c | ||
31 | @@ -248,7 +248,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, | ||
32 | : NULL); | ||
33 | ndomain = (ndomain ? newbuf + ndomaindiff | ||
34 | : NULL); | ||
35 | - buffer = newbuf; | ||
36 | + *tofreep = buffer = newbuf; | ||
37 | } | ||
38 | |||
39 | nhost = memcpy (buffer + bufused, | ||
40 | @@ -319,7 +319,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, | ||
41 | else if (status == NSS_STATUS_TRYAGAIN && e == ERANGE) | ||
42 | { | ||
43 | buflen *= 2; | ||
44 | - buffer = xrealloc (buffer, buflen); | ||
45 | + *tofreep = buffer = xrealloc (buffer, buflen); | ||
46 | } | ||
47 | else if (status == NSS_STATUS_RETURN | ||
48 | || status == NSS_STATUS_NOTFOUND | ||
49 | -- | ||
50 | 2.27.0 | ||
51 | |||
diff --git a/meta/recipes-core/glibc/glibc_2.33.bb b/meta/recipes-core/glibc/glibc_2.33.bb index ac73bbeb7f..bb4b875800 100644 --- a/meta/recipes-core/glibc/glibc_2.33.bb +++ b/meta/recipes-core/glibc/glibc_2.33.bb | |||
@@ -46,6 +46,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ | |||
46 | file://0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch \ | 46 | file://0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch \ |
47 | file://0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch \ | 47 | file://0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch \ |
48 | file://0033-x86-Handle-_SC_LEVEL1_ICACHE_LINESIZE-BZ-27444.patch \ | 48 | file://0033-x86-Handle-_SC_LEVEL1_ICACHE_LINESIZE-BZ-27444.patch \ |
49 | file://CVE-2021-27645.patch \ | ||
49 | " | 50 | " |
50 | S = "${WORKDIR}/git" | 51 | S = "${WORKDIR}/git" |
51 | B = "${WORKDIR}/build-${TARGET_SYS}" | 52 | B = "${WORKDIR}/build-${TARGET_SYS}" |