Browse code

glibc: fix CVE-2019-9169

Change-Id: I3b8e757636b45eb9e79deaf0e853f430a37cb974
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6848
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

Alexey Makhalov authored on 2019/03/09 05:12:44
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+From 583dd860d5b833037175247230a328f0050dbfe9 Mon Sep 17 00:00:00 2001
1
+From: Paul Eggert <eggert@cs.ucla.edu>
2
+Date: Mon, 21 Jan 2019 11:08:13 -0800
3
+Subject: [PATCH] regex: fix read overrun [BZ #24114]
4
+
5
+Problem found by AddressSanitizer, reported by Hongxu Chen in:
6
+https://debbugs.gnu.org/34140
7
+* posix/regexec.c (proceed_next_node):
8
+Do not read past end of input buffer.
9
+---
10
+ posix/regexec.c |  6 ++++--
11
+ 1 file changed, 3 insertions(+), 3 deletions(-)
12
+
13
+diff --git a/posix/regexec.c b/posix/regexec.c
14
+index 91d5a79..084b122 100644
15
+--- a/posix/regexec.c
16
+@@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
17
+ 	      else if (naccepted)
18
+ 		{
19
+ 		  char *buf = (char *) re_string_get_buffer (&mctx->input);
20
+-		  if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
21
+-			      naccepted) != 0)
22
++		  if (mctx->input.valid_len - *pidx < naccepted
23
++		      || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
24
++				  naccepted)
25
++			  != 0))
26
+ 		    return -1;
27
+ 		}
28
+ 	    }
29
+-- 
30
+2.9.3
31
+
... ...
@@ -6,7 +6,7 @@
6 6
 Summary:        Main C library
7 7
 Name:           glibc
8 8
 Version:        2.22
9
-Release:        24%{?dist}
9
+Release:        25%{?dist}
10 10
 License:        LGPLv2+
11 11
 URL:            http://www.gnu.org/software/libc
12 12
 Group:          Applications/System
... ...
@@ -54,6 +54,7 @@ Patch26:        glibc-fix-CVE-2017-15671.patch
54 54
 Patch27:        glibc-fix-CVE-2017-12132.patch
55 55
 Patch28:        glibc-Check-length-of-ifname-before-copying-it-into-to-ifreq-structure.patch
56 56
 Patch29:        glibc-fix-CVE-2018-19591.patch
57
+Patch30:        CVE-2019-9169.patch
57 58
 Provides:       rtld(GNU_HASH)
58 59
 Requires:       filesystem
59 60
 %description
... ...
@@ -109,6 +110,7 @@ sed -i 's/\\$$(pwd)/`pwd`/' timezone/Makefile
109 109
 %patch27 -p1
110 110
 %patch28 -p1
111 111
 %patch29 -p1
112
+%patch30 -p1
112 113
 
113 114
 install -vdm 755 %{_builddir}/%{name}-build
114 115
 # do not try to explicitly provide GLIBC_PRIVATE versioned libraries
... ...
@@ -236,6 +238,8 @@ popd
236 236
 %{_datarootdir}/locale/locale.alias
237 237
 
238 238
 %changelog
239
+*   Fri Mar 08 2019 Alexey Makhalov <amakhalov@vmware.com> 2.22-25
240
+-   Fix CVE-2019-9169
239 241
 *   Wed Feb 13 2019 Alexey Makhalov <amakhalov@vmware.com> 2.22-24
240 242
 -   Fix for CVE-2018-19591.
241 243
 *   Tue Jan 29 2019 Keerthana K <keerthanak@vmware.com> 2.22-23