Accepting request 838206 from home:AndreasStieger:branches:Base:System

GNU grep 3.5

OBS-URL: https://build.opensuse.org/request/show/838206
OBS-URL: https://build.opensuse.org/package/show/Base:System/grep?expand=0&rev=106
This commit is contained in:
Dirk Mueller 2020-09-28 09:02:25 +00:00 committed by Git OBS Bridge
parent 63595ee723
commit cc503460e4
7 changed files with 30 additions and 123 deletions

View File

@ -1,101 +0,0 @@
Avoid false-positive error in gnulib tests 'test-perror2' and 'test-strerror_r'.
On openSUSE OBS, the above gnulib tests fail on armv7l.
Corresponding report on the gnulib mailing list:
https://lists.gnu.org/r/bug-gnulib/2020-08/msg00220.html
From: Florian Weimer
Date: Thu, 27 Aug 2020 09:41:34 +0200
Subject: Use-after-free in test-perror2, test-strerror_r
The problem is visible with glibc 2.32 under valgrind:
==20== Invalid read of size 1
==20== at 0x483DAB4: strcmp (vg_replace_strmem.c:847)
==20== by 0x109414: main (test-perror2.c:84)
==20== Address 0x4a1a3d0 is 0 bytes inside a block of size 17 free'd
==20== at 0x483A9F5: free (vg_replace_malloc.c:538)
==20== by 0x48E2134: strerror_l (in /usr/lib64/libc-2.32.so)
==20== by 0x109328: main (test-perror2.c:72)
==20== Block was alloc'd at
==20== at 0x4839809: malloc (vg_replace_malloc.c:307)
==20== by 0x48CA03F: __vasprintf_internal (in /usr/lib64/libc-2.32.so)
==20== by 0x48A46F9: asprintf (in /usr/lib64/libc-2.32.so)
==20== by 0x48E2184: strerror_l (in /usr/lib64/libc-2.32.so)
==20== by 0x1092E2: main (test-perror2.c:67)
==20==
==20== Invalid read of size 1
==20== at 0x483DAC8: strcmp (vg_replace_strmem.c:847)
==20== by 0x109414: main (test-perror2.c:84)
==20== Address 0x4a1a3d1 is 1 bytes inside a block of size 17 free'd
==20== at 0x483A9F5: free (vg_replace_malloc.c:538)
==20== by 0x48E2134: strerror_l (in /usr/lib64/libc-2.32.so)
==20== by 0x109328: main (test-perror2.c:72)
==20== Block was alloc'd at
==20== at 0x4839809: malloc (vg_replace_malloc.c:307)
==20== by 0x48CA03F: __vasprintf_internal (in /usr/lib64/libc-2.32.so)
==20== by 0x48A46F9: asprintf (in /usr/lib64/libc-2.32.so)
==20== by 0x48E2184: strerror_l (in /usr/lib64/libc-2.32.so)
==20== by 0x1092E2: main (test-perror2.c:67)
I think it's the test that's invalid.
This was reported as an actual grep test failure (without valgrind) on
32-bit Arm, where glibc malloc happens to return a different buffer
address for the internal allocation (so that msg3 != msg4).
test-strerror_r has the same issue.
Thanks,
Florian
Upstream patch:
https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=175e0bc72808
From 175e0bc72808d564074c4adcc72aeadb74adfcc6 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 27 Aug 2020 17:52:58 -0700
Subject: [PATCH] perror, strerror_r: remove unportable tests
Problem reported by Florian Weimer in:
https://lists.gnu.org/r/bug-gnulib/2020-08/msg00220.html
* tests/test-perror2.c (main):
* tests/test-strerror_r.c (main): Omit unportable tests.
This downstream patch is identical to upstream one modulo the ChangeLog entry.
---
gnulib-tests/test-perror2.c | 3 ---
gnulib-tests/test-strerror_r.c | 3 ---
2 files changed, 6 deletions(-)
Index: gnulib-tests/test-perror2.c
===================================================================
--- gnulib-tests/test-perror2.c.orig
+++ gnulib-tests/test-perror2.c
@@ -79,9 +79,6 @@ main (void)
errno = -5;
perror ("");
ASSERT (!ferror (stderr));
- ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1));
- ASSERT (msg2 == msg4 || STREQ (msg2, str2));
- ASSERT (msg3 == msg4 || STREQ (msg3, str3));
ASSERT (STREQ (msg4, str4));
free (str1);
Index: gnulib-tests/test-strerror_r.c
===================================================================
--- gnulib-tests/test-strerror_r.c.orig
+++ gnulib-tests/test-strerror_r.c
@@ -165,9 +165,6 @@ main (void)
strerror_r (EACCES, buf, sizeof buf);
strerror_r (-5, buf, sizeof buf);
- ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1));
- ASSERT (msg2 == msg4 || STREQ (msg2, str2));
- ASSERT (msg3 == msg4 || STREQ (msg3, str3));
ASSERT (STREQ (msg4, str4));
free (str1);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:58e6751c41a7c25bfc6e9363a41786cff3ba5709cf11d5ad903cf7cce31cc3fb
size 1555820

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEFV0/xQDINEhtHupnf9n8ywAL7u4FAl4OYGEACgkQf9n8ywAL
7u42JA//fv7efypNdYbN+m03SWmtQi08K9vpbkj1OzMYSDleRcA4U5lndNvHcFO1
wO5Rjl6Sm1uKfY9rh4+2l48CsfizUSzx7wKhT/1S609u0rNBnDKPFnjtq3QWJ6Pj
S1ZZL9DLA/5wYXVVVOPKH2h1gn77Oz5xcZVUF9BJ43wPtl/8ULJI0Mu96a0bOCHC
3h8OKUTGTRGritaXXcZkrFdd2lbVUEDInHCxKh2nVYbKAKd8hBw5bPad6YB+MZk3
auDdsjFSffGHYAC+V/I7CF/Fu+Q6FPKMWBWYg5H0bttRgki/Sw5y+GZd0yEb7WvW
aLM/5a2ZWq0SdAkcoMur2bwvhkqQdX5VA+5uayOu+ixopanNQ1iFAuZPnbyQQjlh
4FmjCh6FiFjLNQm4vSw4xVhjD6nNsW4Ux3nVscQhlBsRrhYbbYMZi+J8KE8WUDze
1bv84frHt+WDQAhzdKn7v4nL0U5iNCA0Ekj5hLZemo+aCAWZ3F0SGBoUf1daU6xb
ArZY3A9AfeWIUaom7oNAthwksv+wi3kgqXTzcsE61oFxi42EBlYIQRyGm6Ye0i8R
V0nyJC5cGsf7VEPNzjWaxszcDWCeMWr+XrBmxZr5VVlqBm+g2Pgeda1mQFWzixL0
+SPdJTalvcNOwqRsCTP/9pqieOL/KHl5A6eh0f0ejkpayuw+5oY=
=vRMd
-----END PGP SIGNATURE-----

3
grep-3.5.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b82ac77707c2ab945520c8404c9fa9f890f7791a62cf2103cf6238acad87a44a
size 1586396

16
grep-3.5.tar.xz.sig Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEFV0/xQDINEhtHupnf9n8ywAL7u4FAl9xVTYACgkQf9n8ywAL
7u5UZg//WqoFcEx7YVEV3Iq9aTKv4KkdONuoozLHc+PX44mjfTqcYeSrrKd34uy2
19eWAyJ+EMgFjgpawj1MAX5FuQQgjHSSxuR2fZzCy956bFxwAeKMf+vWQAdUSHIp
54ciRXG9mejX29YI/1X16WW7Xo0/D+P+joneJKZyMsvuSuNAQBonWXZwB7HnR0R9
V18Ek/I/ufFBsNEstPy4lgbsey29Ov6TKnC1L4V5WICRzXnoSvPZq6sj84IhUFEH
P4o3JDjdsXzfeM4FsNsrL+ZnwaZJiNgeLCEX1b3G0dfP4mQx+UFdA4ZIjcssdkp4
oNKSRnjgaTpSFZ1u7t3ESKInnRJhkNHrGgz1/3LGm7nrwCb6kNFkRJ3Zr/aItJkW
72ciRTE98WGaQq6KslsDdGl18GaPW1TIDlq+qTjVIFSi6UtPHH0nGc53QiwWHAwQ
l0sO/VIcbO2xdtabGHZsKFBkiKmwyszMDSrTt6PuR8wANJ4O6tS+RKujWUNZIOzU
V6rIbqWBErzSSlazs4/WN2POKb6rYuM+e5UmicE8I239PfDfyINfOiCX3U5qVHdi
etvwXk2IYM1F8vy4s6AvHHL/XqKsjJDPVy4g0y+wHyz3LDH+rXZ4e38H3y/JajlR
Vqe1yTLPFbPaW/+PZbCKJ5zr/ykVeo/9AkvwDOGrKuljxdvbGl8=
=hWBo
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Sep 28 08:54:47 UTC 2020 - Andreas Stieger <andreas.stieger@gmx.de>
- grep 3.5:
* message for matching binary files now sent to stderr, and changed
* --files-without-match (-L) behavior reverted to again succeed
when a line is selected, not when a file is listed
* various bug fixes
- drop gnulib-test-avoid-FP-perror-strerror.patch, upstream
-------------------------------------------------------------------
Mon Aug 31 10:23:23 UTC 2020 - Bernhard Voelker <mail@bernhard-voelker.de>

View File

@ -17,7 +17,7 @@
Name: grep
Version: 3.4
Version: 3.5
Release: 0
Summary: Print lines matching a pattern
License: GPL-3.0-or-later
@ -27,7 +27,6 @@ Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
Source2: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig
Source3: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=grep&download=1#/%{name}.keyring
Source4: profile.sh
Patch1: gnulib-test-avoid-FP-perror-strerror.patch
BuildRequires: fdupes
BuildRequires: makeinfo
BuildRequires: pcre-devel
@ -43,7 +42,6 @@ match to a specified pattern. By default, grep prints the matching lines.
%prep
%setup -q
%patch1
%build
%configure \