summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glibc')
-rw-r--r--meta/recipes-core/glibc/cross-localedef-native_2.26.bb2
-rw-r--r--meta/recipes-core/glibc/glibc/CVE-2017-15671.patch66
-rw-r--r--meta/recipes-core/glibc/glibc/CVE-2017-16997.patch150
-rw-r--r--meta/recipes-core/glibc/glibc/CVE-2017-17426.patch80
-rw-r--r--meta/recipes-core/glibc/glibc_2.26.bb8
5 files changed, 2 insertions, 304 deletions
diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.26.bb b/meta/recipes-core/glibc/cross-localedef-native_2.26.bb
index fc5d70dbb9..af02a0ce1d 100644
--- a/meta/recipes-core/glibc/cross-localedef-native_2.26.bb
+++ b/meta/recipes-core/glibc/cross-localedef-native_2.26.bb
@@ -21,7 +21,7 @@ SRCBRANCH ?= "release/${PV}/master"
21GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git" 21GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
22UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)" 22UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
23 23
24SRCREV_glibc ?= "1c9a5c270d8b66f30dcfaf1cb2d6cf39d3e18369" 24SRCREV_glibc ?= "d300041c533a3d837c9f37a099bcc95466860e98"
25SRCREV_localedef ?= "dfb4afe551c6c6e94f9cc85417bd1f582168c843" 25SRCREV_localedef ?= "dfb4afe551c6c6e94f9cc85417bd1f582168c843"
26 26
27SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ 27SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
diff --git a/meta/recipes-core/glibc/glibc/CVE-2017-15671.patch b/meta/recipes-core/glibc/glibc/CVE-2017-15671.patch
deleted file mode 100644
index 35692820d4..0000000000
--- a/meta/recipes-core/glibc/glibc/CVE-2017-15671.patch
+++ /dev/null
@@ -1,66 +0,0 @@
1From f1cf98b583787cfb6278baea46e286a0ee7567fd Mon Sep 17 00:00:00 2001
2From: Paul Eggert <eggert@cs.ucla.edu>
3Date: Sun, 22 Oct 2017 10:00:57 +0200
4Subject: [PATCH] glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ
5 #22332]
6
7(cherry picked from commit a159b53fa059947cc2548e3b0d5bdcf7b9630ba8)
8
9Upstream-Status: Backport
10CVE: CVE-2017-15671
11Signed-off-by: Armin Kuster <akuster@mvista.com>
12
13---
14 ChangeLog | 6 ++++++
15 NEWS | 4 ++++
16 posix/glob.c | 4 ++--
17 3 files changed, 12 insertions(+), 2 deletions(-)
18
19Index: git/NEWS
20===================================================================
21--- git.orig/NEWS
22+++ git/NEWS
23@@ -211,6 +211,10 @@ Security related changes:
24 on the stack or the heap, depending on the length of the user name).
25 Reported by Tim Rühsen.
26
27+ The glob function, when invoked with GLOB_TILDE and without
28+ GLOB_NOESCAPE, could write past the end of a buffer while
29+ unescaping user names. Reported by Tim Rühsen.
30+
31 The following bugs are resolved with this release:
32
33 [984] network: Respond to changed resolv.conf in gethostbyname
34Index: git/posix/glob.c
35===================================================================
36--- git.orig/posix/glob.c
37+++ git/posix/glob.c
38@@ -823,11 +823,11 @@ glob (const char *pattern, int flags, in
39 char *p = mempcpy (newp, dirname + 1,
40 unescape - dirname - 1);
41 char *q = unescape;
42- while (*q != '\0')
43+ while (q != end_name)
44 {
45 if (*q == '\\')
46 {
47- if (q[1] == '\0')
48+ if (q + 1 == end_name)
49 {
50 /* "~fo\\o\\" unescape to user_name "foo\\",
51 but "~fo\\o\\/" unescape to user_name
52Index: git/ChangeLog
53===================================================================
54--- git.orig/ChangeLog
55+++ git/ChangeLog
56@@ -1,5 +1,10 @@
57+
58 2017-10-20 Paul Eggert <eggert@cs.ucla.edu>
59
60+ [BZ #22332]
61+ * posix/glob.c (__glob): Fix buffer overflow during GLOB_TILDE
62+ unescaping.
63+
64 [BZ #22320]
65 CVE-2017-15670
66 * posix/glob.c (__glob): Fix one-byte overflow.
diff --git a/meta/recipes-core/glibc/glibc/CVE-2017-16997.patch b/meta/recipes-core/glibc/glibc/CVE-2017-16997.patch
deleted file mode 100644
index 38731e4124..0000000000
--- a/meta/recipes-core/glibc/glibc/CVE-2017-16997.patch
+++ /dev/null
@@ -1,150 +0,0 @@
1From 4ebd0c4191c6073cc8a7c5fdcf1d182c4719bcbb Mon Sep 17 00:00:00 2001
2From: Aurelien Jarno <aurelien@aurel32.net>
3Date: Sat, 30 Dec 2017 10:54:23 +0100
4Subject: [PATCH] elf: Check for empty tokens before dynamic string token
5 expansion [BZ #22625]
6
7The fillin_rpath function in elf/dl-load.c loops over each RPATH or
8RUNPATH tokens and interprets empty tokens as the current directory
9("./"). In practice the check for empty token is done *after* the
10dynamic string token expansion. The expansion process can return an
11empty string for the $ORIGIN token if __libc_enable_secure is set
12or if the path of the binary can not be determined (/proc not mounted).
13
14Fix that by moving the check for empty tokens before the dynamic string
15token expansion. In addition, check for NULL pointer or empty strings
16return by expand_dynamic_string_token.
17
18The above changes highlighted a bug in decompose_rpath, an empty array
19is represented by the first element being NULL at the fillin_rpath
20level, but by using a -1 pointer in decompose_rpath and other functions.
21
22Changelog:
23 [BZ #22625]
24 * elf/dl-load.c (fillin_rpath): Check for empty tokens before dynamic
25 string token expansion. Check for NULL pointer or empty string possibly
26 returned by expand_dynamic_string_token.
27 (decompose_rpath): Check for empty path after dynamic string
28 token expansion.
29(cherry picked from commit 3e3c904daef69b8bf7d5cc07f793c9f07c3553ef)
30
31Upstream-Status: Backport
32CVE: CVE-2017-16997
33Signed-off-by: Armin Kuster <akuster@mvista.com>
34
35---
36 ChangeLog | 10 ++++++++++
37 NEWS | 4 ++++
38 elf/dl-load.c | 49 +++++++++++++++++++++++++++++++++----------------
39 3 files changed, 47 insertions(+), 16 deletions(-)
40
41Index: git/NEWS
42===================================================================
43--- git.orig/NEWS
44+++ git/NEWS
45@@ -215,6 +215,10 @@ Security related changes:
46 GLOB_NOESCAPE, could write past the end of a buffer while
47 unescaping user names. Reported by Tim Rühsen.
48
49+ CVE-2017-16997: Incorrect handling of RPATH or RUNPATH containing $ORIGIN
50+ for AT_SECURE or SUID binaries could be used to load libraries from the
51+ current directory.
52+
53 The following bugs are resolved with this release:
54
55 [984] network: Respond to changed resolv.conf in gethostbyname
56Index: git/elf/dl-load.c
57===================================================================
58--- git.orig/elf/dl-load.c
59+++ git/elf/dl-load.c
60@@ -433,32 +433,41 @@ fillin_rpath (char *rpath, struct r_sear
61 {
62 char *cp;
63 size_t nelems = 0;
64- char *to_free;
65
66 while ((cp = __strsep (&rpath, sep)) != NULL)
67 {
68 struct r_search_path_elem *dirp;
69+ char *to_free = NULL;
70+ size_t len = 0;
71
72- to_free = cp = expand_dynamic_string_token (l, cp, 1);
73+ /* `strsep' can pass an empty string. */
74+ if (*cp != '\0')
75+ {
76+ to_free = cp = expand_dynamic_string_token (l, cp, 1);
77
78- size_t len = strlen (cp);
79+ /* expand_dynamic_string_token can return NULL in case of empty
80+ path or memory allocation failure. */
81+ if (cp == NULL)
82+ continue;
83+
84+ /* Compute the length after dynamic string token expansion and
85+ ignore empty paths. */
86+ len = strlen (cp);
87+ if (len == 0)
88+ {
89+ free (to_free);
90+ continue;
91+ }
92
93- /* `strsep' can pass an empty string. This has to be
94- interpreted as `use the current directory'. */
95- if (len == 0)
96- {
97- static const char curwd[] = "./";
98- cp = (char *) curwd;
99+ /* Remove trailing slashes (except for "/"). */
100+ while (len > 1 && cp[len - 1] == '/')
101+ --len;
102+
103+ /* Now add one if there is none so far. */
104+ if (len > 0 && cp[len - 1] != '/')
105+ cp[len++] = '/';
106 }
107
108- /* Remove trailing slashes (except for "/"). */
109- while (len > 1 && cp[len - 1] == '/')
110- --len;
111-
112- /* Now add one if there is none so far. */
113- if (len > 0 && cp[len - 1] != '/')
114- cp[len++] = '/';
115-
116 /* Make sure we don't use untrusted directories if we run SUID. */
117 if (__glibc_unlikely (check_trusted) && !is_trusted_path (cp, len))
118 {
119@@ -621,6 +630,14 @@ decompose_rpath (struct r_search_path_st
120 necessary. */
121 free (copy);
122
123+ /* There is no path after expansion. */
124+ if (result[0] == NULL)
125+ {
126+ free (result);
127+ sps->dirs = (struct r_search_path_elem **) -1;
128+ return false;
129+ }
130+
131 sps->dirs = result;
132 /* The caller will change this value if we haven't used a real malloc. */
133 sps->malloced = 1;
134Index: git/ChangeLog
135===================================================================
136--- git.orig/ChangeLog
137+++ git/ChangeLog
138@@ -1,3 +1,12 @@
139+2017-12-30 Aurelien Jarno <aurelien@aurel32.net>
140+ Dmitry V. Levin <ldv@altlinux.org>
141+
142+ [BZ #22625]
143+ * elf/dl-load.c (fillin_rpath): Check for empty tokens before dynamic
144+ string token expansion. Check for NULL pointer or empty string possibly
145+ returned by expand_dynamic_string_token.
146+ (decompose_rpath): Check for empty path after dynamic string
147+ token expansion.
148
149 2017-10-20 Paul Eggert <eggert@cs.ucla.edu>
150
diff --git a/meta/recipes-core/glibc/glibc/CVE-2017-17426.patch b/meta/recipes-core/glibc/glibc/CVE-2017-17426.patch
deleted file mode 100644
index c7d1cb86df..0000000000
--- a/meta/recipes-core/glibc/glibc/CVE-2017-17426.patch
+++ /dev/null
@@ -1,80 +0,0 @@
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 8c0eb98af6..464b65434e 100644
--- a/meta/recipes-core/glibc/glibc_2.26.bb
+++ b/meta/recipes-core/glibc/glibc_2.26.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
7 7
8DEPENDS += "gperf-native bison-native" 8DEPENDS += "gperf-native bison-native"
9 9
10SRCREV ?= "1c9a5c270d8b66f30dcfaf1cb2d6cf39d3e18369" 10SRCREV ?= "d300041c533a3d837c9f37a099bcc95466860e98"
11 11
12SRCBRANCH ?= "release/${PV}/master" 12SRCBRANCH ?= "release/${PV}/master"
13 13
@@ -40,14 +40,8 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
40 file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \ 40 file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \
41 file://0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \ 41 file://0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \
42 file://0025-locale-fix-hard-coded-reference-to-gcc-E.patch \ 42 file://0025-locale-fix-hard-coded-reference-to-gcc-E.patch \
43 file://0026-assert-Suppress-pedantic-warning-caused-by-statement.patch \
44 file://0027-glibc-reset-dl-load-write-lock-after-forking.patch \ 43 file://0027-glibc-reset-dl-load-write-lock-after-forking.patch \
45 file://0028-Bug-4578-add-ld.so-lock-while-fork.patch \ 44 file://0028-Bug-4578-add-ld.so-lock-while-fork.patch \
46 file://CVE-2017-15670.patch \
47 file://CVE-2017-15671.patch \
48 file://0029-assert-Support-types-without-operator-int-BZ-21972.patch \
49 file://CVE-2017-16997.patch \
50 file://CVE-2017-17426.patch \
51" 45"
52 46
53NATIVESDKFIXES ?= "" 47NATIVESDKFIXES ?= ""