Package: grep / 2.20-4.1

Metadata

Package Version Patches format
grep 2.20-4.1 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
02 man_rgrep.patch | (download)

doc/grep.in.1 | 12 8 + 4 - 0 !
1 file changed, 8 insertions(+), 4 deletions(-)

---
03 397262 dlopen pcre.patch | (download)

src/pcresearch.c | 71 71 + 0 - 0 !
1 file changed, 71 insertions(+)

---
70 man_apostrophe.patch | (download)

doc/grep.in.1 | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

---
04 446854 grep.1.patch | (download)

doc/grep.in.1 | 20 3 + 17 - 0 !
1 file changed, 3 insertions(+), 17 deletions(-)

---
05 grep wrapper sh.patch | (download)

src/Makefile.am | 10 2 + 8 - 0 !
src/egrep.sh | 12 2 + 10 - 0 !
2 files changed, 4 insertions(+), 18 deletions(-)

---
80 587930 man ere reference.patch | (download)

doc/grep.in.1 | 8 4 + 4 - 0 !
doc/grep.info | 4 2 + 2 - 0 !
2 files changed, 6 insertions(+), 6 deletions(-)

---
85 412370 F x documentation.patch | (download)

doc/grep.in.1 | 5 3 + 2 - 0 !
doc/grep.texi | 9 5 + 4 - 0 !
2 files changed, 8 insertions(+), 6 deletions(-)

---
99 autotools changes.patch | (download)

doc/stamp-vti | 2 1 + 1 - 0 !
doc/version.texi | 2 1 + 1 - 0 !
2 files changed, 2 insertions(+), 2 deletions(-)

 autotools modifies these files.
 Patch needed to enable build twice in a row.


0001 build avoid Wstack protector.patch | (download)

configure.ac | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 [patch] build: avoid -wstack-protector

This allows the use of --enable-gcc-warnings on Gentoo and Ubuntu.
See: http://bugs.gnu.org/17793
* configure.ac (WERROR_CFLAGS): Avoid -Wstack-protector.

This can be worked around, but the cure is worse than the disease.

0001 grep P invalid utf8 non matching debian.patch | (download)

NEWS | 3 3 + 0 - 0 !
src/pcresearch.c | 72 30 + 42 - 0 !
tests/pcre-infloop | 2 1 + 1 - 0 !
tests/pcre-invalid-utf8-input | 2 1 + 1 - 0 !
4 files changed, 35 insertions(+), 44 deletions(-)

 [patch 1/2] grep: -p now treats invalid utf-8 input as non-matching

Problem reported by Santiago Vila in: http://bugs.gnu.org/18266
* NEWS: Mention this.
* src/pcresearch.c (Pexecute): Treat UTF-8 encoding errors
as non-matching data, instead of exiting 'grep'.
* tests/pcre-infloop: grep now exits with status 1, not 2.
* tests/pcre-invalid-utf8-input: grep now exits with status 0, not 2.

CVE 2015 1345.patch | (download)

src/kwset.c | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 grep -f: fix a heap buffer (read) overrun

grep's read buffer is often filled to its full size, except when
reading the final buffer of a file.  In that case, the number of
bytes read may be far less than the size of the buffer.  However, for
certain unusual pattern/text combinations, grep -F would mistakenly
examine bytes in that uninitialized region of memory when searching
for a match.  With carefully chosen inputs, one can cause grep -F to
read beyond the end of that buffer altogether.  This problem arose via
commit v2.18-90-g73893ff with the introduction of a more efficient
heuristic using what is now the memchr_kwset function. The use of
that function in bmexec_trans could leave TP much larger than EP,
and the subsequent call to bm_delta2_search would mistakenly access
beyond end of the main input read buffer.

* src/kwset.c (bmexec_trans): When TP reaches or exceeds EP,
do not call bm_delta2_search.
* tests/kwset-abuse: New file.
* tests/Makefile.am (TESTS): Add it.
* THANKS.in: Update.
* NEWS (Bug fixes): Mention it.

Prior to this patch, this command would trigger a UMR:

  printf %0360db 0 | valgrind src/grep -F $(printf %019dXb 0)

  Use of uninitialised value of size 8
     at 0x4142BE: bmexec_trans (kwset.c:657)
     by 0x4143CA: bmexec (kwset.c:678)
     by 0x414973: kwsexec (kwset.c:848)
     by 0x414DC4: Fexecute (kwsearch.c:128)
     by 0x404E2E: grepbuf (grep.c:1238)
     by 0x4054BF: grep (grep.c:1417)
     by 0x405CEB: grepdesc (grep.c:1645)
     by 0x405EC1: grep_command_line_arg (grep.c:1692)
     by 0x4077D4: main (grep.c:2570)

See the accompanying test for how to trigger the heap buffer overrun.

Thanks to Nima Aghdaii for testing and finding numerous
ways to break early iterations of this patch.