0.176-4 - Add elfutils-0.176-strip-symbols-illformed.patch

This commit is contained in:
Mark Wielaard 2019-07-05 14:29:50 +02:00
parent c53934057a
commit 6487c2241f
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,26 @@
commit f03ac75239e0981deaf4aa18f66f423bcc5ce051
Author: Mark Wielaard <mark@klomp.org>
Date: Wed Mar 27 21:54:06 2019 +0100
strip: Files with symbols referring to non-existing sections are illformed
The check added in commit 4540ea98c "strip: Fix check test for SHN_XINDEX
symbol" was not complete. The (extended) section index should also exist.
If it doesn't exist, mark the file as illformed.
https://sourceware.org/bugzilla/show_bug.cgi?id=24385
Signed-off-by: Mark Wielaard <mark@klomp.org>
diff --git a/src/strip.c b/src/strip.c
index a73009d9..4cd87506 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -1975,6 +1975,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
&& shndxdata->d_buf != NULL);
size_t sidx = (sym->st_shndx != SHN_XINDEX
? sym->st_shndx : xshndx);
+ elf_assert (sidx < shnum);
sec = shdr_info[sidx].idx;
if (sec != 0)

View File

@ -23,6 +23,7 @@ Patch1: elfutils-0.176-gcc-pr88835.patch
Patch2: elfutils-0.176-pt-gnu-prop.patch
Patch3: elfutils-0.176-xlate-note.patch
Patch4: elfutils-0.176-elf-update.patch
Patch5: elfutils-0.176-strip-symbols-illformed.patch
Requires: elfutils-libelf%{depsuffix} = %{version}-%{release}
Requires: elfutils-libs%{depsuffix} = %{version}-%{release}
@ -188,6 +189,7 @@ profiling) of processes.
%patch2 -p1 -b .pt-gnu-prop
%patch3 -p1 -b .xlate-note
%patch4 -p1 -b .elf-update
%patch5 -p1 -b .strip-illformed
# In case the above patches added any new test scripts, make sure they
# are executable.
@ -321,6 +323,9 @@ fi
%endif
%changelog
* Fri Jul 5 2019 Mark Wielaard <mjw@fedoraproject.org> - 0.176-4
- Add elfutils-0.176-strip-symbols-illformed.patch
* Mon Jun 3 2019 Mark Wielaard <mjw@fedoraproject.org> - 0.176-3
- Add elfutils-0.176-elf-update.patch