diff --git a/backport-rtld-copy-terminating-null-in-tunables_strdup-bug-28.patch b/backport-rtld-copy-terminating-null-in-tunables_strdup-bug-28.patch new file mode 100644 index 0000000000000000000000000000000000000000..7366cc1f6e14dd2bef3d0f2d827e9a82a68f2281 --- /dev/null +++ b/backport-rtld-copy-terminating-null-in-tunables_strdup-bug-28.patch @@ -0,0 +1,28 @@ +From ef8e2a0633bb701a89dd4967e1a87dc33bb7032c Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Mon, 23 Aug 2021 10:19:52 +0200 +Subject: [PATCH] rtld: copy terminating null in tunables_strdup (bug 28256) + +Avoid triggering a false positive from valgrind by copying the terminating +null in tunables_strdup. At this point the heap is still clean, but +valgrind is stricter here. +--- + elf/dl-tunables.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c +index 4c9d36e39807..2494a4826af2 100644 +--- a/elf/dl-tunables.c ++++ b/elf/dl-tunables.c +@@ -52,8 +52,6 @@ tunables_strdup (const char *in) + if (out == (void *)-1) + return NULL; + +- i--; +- + while (i-- > 0) + out[i] = in[i]; + +-- +2.18.4 + diff --git a/glibc.spec b/glibc.spec index d8593c5d83cffbad2d8dafdcb718d1d0d2e2334a..13080138567c8ef328a8446e2629b5e8c4c47913 100644 --- a/glibc.spec +++ b/glibc.spec @@ -59,7 +59,7 @@ ############################################################################## Name: glibc Version: 2.28 -Release: 77 +Release: 78 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -136,6 +136,7 @@ Patch52: backport-_dl_exception_create_format-Add-missing-va_end.patch Patch53: backport-CVE-2021-38604-0001-librt-add-test-bug-28213.patch Patch54: backport-CVE-2021-38604-0002-librt-fix-null-pointer-deference.patch Patch55: backport-ldconfig-avoid-leak-on-empty-paths-in-config-file.patch +Patch56: backport-rtld-copy-terminating-null-in-tunables_strdup-bug-28.patch Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) @@ -1160,6 +1161,10 @@ fi %doc hesiod/README.hesiod %changelog +* Wed Sep 29 2021 Lv Ying - 2.28-78 +- ldconfig: avoid leak on empty paths in config file + https://sourceware.org/git/?p=glibc.git;a=commit;h=a4f5a3103fc3e7974dbe35b411cba9f670807cde + * Tue Aug 31 2021 Lv Ying - 2.28-77 - ldconfig: avoid leak on empty paths in config file https://sourceware.org/git/?p=glibc.git;a=commit;h=b0234d79e7d82475d1666f25326ec045c045b3ed