diff options
Diffstat (limited to 'meta/recipes-devtools/elfutils/files/0001-arlib-Check-that-sh_entsize-isn-t-zero.patch')
-rw-r--r-- | meta/recipes-devtools/elfutils/files/0001-arlib-Check-that-sh_entsize-isn-t-zero.patch | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/meta/recipes-devtools/elfutils/files/0001-arlib-Check-that-sh_entsize-isn-t-zero.patch b/meta/recipes-devtools/elfutils/files/0001-arlib-Check-that-sh_entsize-isn-t-zero.patch deleted file mode 100644 index 86cf7c8d50..0000000000 --- a/meta/recipes-devtools/elfutils/files/0001-arlib-Check-that-sh_entsize-isn-t-zero.patch +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | From b518841fbc1431d7c5baa016e35f10fb647b5958 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Wielaard <mark@klomp.org> | ||
3 | Date: Thu, 18 Oct 2018 19:01:52 +0200 | ||
4 | Subject: [PATCH] arlib: Check that sh_entsize isn't zero. | ||
5 | |||
6 | A bogus ELF file could have sh_entsize as zero. Don't divide by zero, | ||
7 | but just assume there are no symbols in the section. | ||
8 | |||
9 | https://sourceware.org/bugzilla/show_bug.cgi?id=23786 | ||
10 | |||
11 | Signed-off-by: Mark Wielaard <mark@klomp.org> | ||
12 | |||
13 | CVE: CVE-2018-18521 | ||
14 | Upstream-Status: Backport [http://sourceware.org/git/elfutils.git] | ||
15 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
16 | --- | ||
17 | src/arlib.c | 3 +++ | ||
18 | 1 file changed, 3 insertions(+) | ||
19 | |||
20 | diff --git a/src/arlib.c b/src/arlib.c | ||
21 | index 778e087..a6521e3 100644 | ||
22 | --- a/src/arlib.c | ||
23 | +++ b/src/arlib.c | ||
24 | @@ -252,6 +252,9 @@ arlib_add_symbols (Elf *elf, const char *arfname, const char *membername, | ||
25 | if (data == NULL) | ||
26 | continue; | ||
27 | |||
28 | + if (shdr->sh_entsize == 0) | ||
29 | + continue; | ||
30 | + | ||
31 | int nsyms = shdr->sh_size / shdr->sh_entsize; | ||
32 | for (int ndx = shdr->sh_info; ndx < nsyms; ++ndx) | ||
33 | { | ||
34 | -- | ||
35 | 2.7.4 | ||
36 | |||