Browse code

glibc: fix CVE-2019-9169

Change-Id: Ia9bc1414d3e93cccc8cf286b010319d12ad0c7e0
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6839
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
Tested-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
+
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        Main C library
5 5
 Name:           glibc
6 6
 Version:        2.28
7
-Release:        2%{?dist}
7
+Release:        3%{?dist}
8 8
 License:        LGPLv2+
9 9
 URL:            http://www.gnu.org/software/libc
10 10
 Group:          Applications/System
... ...
@@ -18,6 +18,7 @@ Patch0:         http://www.linuxfromscratch.org/patches/downloads/glibc/glibc-2.
18 18
 Patch1:         glibc-2.24-bindrsvport-blacklist.patch
19 19
 Patch2:         0002-malloc-arena-fix.patch
20 20
 Patch3:         glibc-2.28-CVE-2018-19591.patch
21
+Patch4:         CVE-2019-9169.patch
21 22
 Provides:       rtld(GNU_HASH)
22 23
 Requires:       filesystem
23 24
 %description
... ...
@@ -75,6 +76,7 @@ sed -i 's/\\$$(pwd)/`pwd`/' timezone/Makefile
75 75
 %patch1 -p1
76 76
 %patch2 -p1
77 77
 %patch3 -p1
78
+%patch4 -p1
78 79
 install -vdm 755 %{_builddir}/%{name}-build
79 80
 # do not try to explicitly provide GLIBC_PRIVATE versioned libraries
80 81
 %define __find_provides %{_builddir}/%{name}-%{version}/find_provides.sh
... ...
@@ -275,6 +277,8 @@ grep "^FAIL: nptl/tst-eintr1" tests.sum >/dev/null && n=$((n+1)) ||:
275 275
 
276 276
 
277 277
 %changelog
278
+*   Fri Mar 08 2019 Alexey Makhalov <amakhalov@vmware.com> 2.28-3
279
+-   Fix CVE-2019-9169
278 280
 *   Tue Jan 22 2019 Anish Swaminathan <anishs@vmware.com> 2.28-2
279 281
 -   Fix CVE-2018-19591
280 282
 *   Tue Aug 28 2018 Alexey Makhalov <amakhalov@vmware.com> 2.28-1