summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2018-01-20 09:50:26 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-25 11:36:25 +0000
commit850df2c3a83f4334b6b4b3ab89b1cd53c7cd9be9 (patch)
treebb340c2971dce877805171c2fed86543f1c5cdea /meta
parent334ddc5c784a346050b304642658f356f09dfa4f (diff)
downloadpoky-850df2c3a83f4334b6b4b3ab89b1cd53c7cd9be9.tar.gz
glibc: Security fix CVE-2017-17426
affects < 2.27 including current mastet git hash: 77f921dac17c5fa99bd9e926d926c327982895f7 (From OE-Core rev: 050fecc47c84e1a052a6e33414fbcfeef1e59f7a) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/glibc/glibc/CVE-2017-17426.patch80
-rw-r--r--meta/recipes-core/glibc/glibc_2.26.bb1
2 files changed, 81 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/CVE-2017-17426.patch b/meta/recipes-core/glibc/glibc/CVE-2017-17426.patch
new file mode 100644
index 0000000000..c7d1cb86df
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/CVE-2017-17426.patch
@@ -0,0 +1,80 @@
1From df8c219cb987cfe85c550efa693a1383a11e38aa Mon Sep 17 00:00:00 2001
2From: Arjun Shankar <arjun@redhat.com>
3Date: Thu, 30 Nov 2017 13:31:45 +0100
4Subject: [PATCH] Fix integer overflow in malloc when tcache is enabled [BZ
5 #22375]
6
7When the per-thread cache is enabled, __libc_malloc uses request2size (which
8does not perform an overflow check) to calculate the chunk size from the
9requested allocation size. This leads to an integer overflow causing malloc
10to incorrectly return the last successfully allocated block when called with
11a very large size argument (close to SIZE_MAX).
12
13This commit uses checked_request2size instead, removing the overflow.
14
15(cherry picked from commit 34697694e8a93b325b18f25f7dcded55d6baeaf6)
16
17Upstream-Status: Backport
18CVE: CVE-2017-17426
19Signed-off-by: Armin Kuster <akuster@mvista.com>
20
21---
22 ChangeLog | 7 +++++++
23 NEWS | 6 ++++++
24 malloc/malloc.c | 3 ++-
25 3 files changed, 15 insertions(+), 1 deletion(-)
26
27Index: git/NEWS
28===================================================================
29--- git.orig/NEWS
30+++ git/NEWS
31@@ -4,6 +4,8 @@ See the end for copying conditions.
32
33 Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
34 using `glibc' in the "product" field.
35+
36+[22375] malloc returns pointer from tcache instead of NULL (CVE-2017-17426)
37
38 Version 2.26
39
40@@ -215,6 +217,11 @@ Security related changes:
41 for AT_SECURE or SUID binaries could be used to load libraries from the
42 current directory.
43
44+ CVE-2017-17426: The malloc function, when called with an object size near
45+ the value SIZE_MAX, would return a pointer to a buffer which is too small,
46+ instead of NULL. This was a regression introduced with the new malloc
47+ thread cache in glibc 2.26. Reported by Iain Buclaw.
48+
49 The following bugs are resolved with this release:
50
51 [984] network: Respond to changed resolv.conf in gethostbyname
52Index: git/malloc/malloc.c
53===================================================================
54--- git.orig/malloc/malloc.c
55+++ git/malloc/malloc.c
56@@ -3050,7 +3050,8 @@ __libc_malloc (size_t bytes)
57 return (*hook)(bytes, RETURN_ADDRESS (0));
58 #if USE_TCACHE
59 /* int_free also calls request2size, be careful to not pad twice. */
60- size_t tbytes = request2size (bytes);
61+ size_t tbytes;
62+ checked_request2size (bytes, tbytes);
63 size_t tc_idx = csize2tidx (tbytes);
64
65 MAYBE_INIT_TCACHE ();
66Index: git/ChangeLog
67===================================================================
68--- git.orig/ChangeLog
69+++ git/ChangeLog
70@@ -1,3 +1,10 @@
71+2017-11-30 Arjun Shankar <arjun@redhat.com>
72+
73+ [BZ #22375]
74+ CVE-2017-17426
75+ * malloc/malloc.c (__libc_malloc): Use checked_request2size
76+ instead of request2size.
77+
78 2017-12-30 Aurelien Jarno <aurelien@aurel32.net>
79 Dmitry V. Levin <ldv@altlinux.org>
80
diff --git a/meta/recipes-core/glibc/glibc_2.26.bb b/meta/recipes-core/glibc/glibc_2.26.bb
index caf8e37189..cc7d3cd596 100644
--- a/meta/recipes-core/glibc/glibc_2.26.bb
+++ b/meta/recipes-core/glibc/glibc_2.26.bb
@@ -47,6 +47,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
47 file://CVE-2017-15671.patch \ 47 file://CVE-2017-15671.patch \
48 file://0029-assert-Support-types-without-operator-int-BZ-21972.patch \ 48 file://0029-assert-Support-types-without-operator-int-BZ-21972.patch \
49 file://CVE-2017-16997.patch \ 49 file://CVE-2017-16997.patch \
50 file://CVE-2017-17426.patch \
50" 51"
51 52
52NATIVESDKFIXES ?= "" 53NATIVESDKFIXES ?= ""