diff options
Diffstat (limited to 'meta/recipes-devtools/elfutils')
-rw-r--r-- | meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch b/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch index 8b03c0ea6b..1bdb511698 100644 --- a/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch +++ b/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From d68822e93c57c3fbb77b93eada5986d2240157c2 Mon Sep 17 00:00:00 2001 | 1 | From 3393a2e544818f0bd1887c13f28a76ad60c2df98 Mon Sep 17 00:00:00 2001 |
2 | From: Robert Yang <liezhi.yang@windriver.com> | 2 | From: Robert Yang <liezhi.yang@windriver.com> |
3 | Date: Thu, 16 Aug 2018 09:58:26 +0800 | 3 | Date: Thu, 16 Aug 2018 09:58:26 +0800 |
4 | Subject: [PATCH] libelf/elf_end.c: check data_list.data.d.d_buf before free it | 4 | Subject: [PATCH] libelf/elf_end.c: check data_list.data.d.d_buf before free it |
@@ -11,18 +11,25 @@ prelink: /usr/lib/libqb.so.0.18.2: Symbol section index outside of section numbe | |||
11 | 11 | ||
12 | The segmentation fault happens when prelink call elf_end(). | 12 | The segmentation fault happens when prelink call elf_end(). |
13 | 13 | ||
14 | Upstream-Status: Submitted [https://sourceware.org/ml/elfutils-devel/2018-q3/msg00065.html] | 14 | Upstream-Status: Submitted [https://sourceware.org/ml/elfutils-devel/2018-q3/msg00085.html] |
15 | 15 | ||
16 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | 16 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> |
17 | --- | 17 | --- |
18 | libelf/elf_end.c | 3 ++- | 18 | libelf/elf_end.c | 6 ++++-- |
19 | 1 file changed, 2 insertions(+), 1 deletion(-) | 19 | 1 file changed, 4 insertions(+), 2 deletions(-) |
20 | 20 | ||
21 | diff --git a/libelf/elf_end.c b/libelf/elf_end.c | 21 | diff --git a/libelf/elf_end.c b/libelf/elf_end.c |
22 | index 160f0b8..5388e80 100644 | 22 | index 160f0b8..5280a70 100644 |
23 | --- a/libelf/elf_end.c | 23 | --- a/libelf/elf_end.c |
24 | +++ b/libelf/elf_end.c | 24 | +++ b/libelf/elf_end.c |
25 | @@ -165,9 +165,10 @@ elf_end (Elf *elf) | 25 | @@ -160,14 +160,16 @@ elf_end (Elf *elf) |
26 | architecture doesn't require overly stringent | ||
27 | alignment the raw data buffer is the same as the | ||
28 | one used for presenting to the caller. */ | ||
29 | - if (scn->data_base != scn->rawdata_base) | ||
30 | + if ((scn->data_base != scn->rawdata_base) | ||
31 | + && (scn->data_list.data.d.d_buf != NULL)) | ||
32 | free (scn->data_base); | ||
26 | 33 | ||
27 | /* The section data is allocated if we couldn't mmap | 34 | /* The section data is allocated if we couldn't mmap |
28 | the file. Or if we had to decompress. */ | 35 | the file. Or if we had to decompress. */ |