summaryrefslogtreecommitdiffstats
path: root/libdwfl
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2019-01-16 15:41:31 +0100
committerMark Wielaard <mark@klomp.org>2019-01-16 15:41:31 +0100
commitde01cc6f9446187d69b9748bb3636361c79e77a4 (patch)
tree73d0ff2f46bc249a16d0da96d98c1d12c05fc145 /libdwfl
parente65d91d21cb09d83b001fef9435e576ba447db32 (diff)
libebl: Check NT_PLATFORM core notes contain a zero terminated string.
Most strings in core notes are fixed size. But NT_PLATFORM contains just a variable length string. Check that it is actually zero terminated before passing to readelf to print. https://sourceware.org/bugzilla/show_bug.cgi?id=24089 Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libdwfl')
-rw-r--r--libdwfl/ChangeLog5
-rw-r--r--libdwfl/linux-core-attach.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index b96cebf2..c295fa7d 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-16 Mark Wielaard <mark@klomp.org>
+
+ * linux-core-attach.c (core_next_thread): Pass desc to ebl_core_note.
+ (core_set_initial_registers): Likewise.
+
2018-10-23 Mark Wielaard <mark@klomp.org>
* relocate.c (relocate_section): Only sanity check mmapped Elf files
diff --git a/libdwfl/linux-core-attach.c b/libdwfl/linux-core-attach.c
index 6c99b9e2..c0f1b0d0 100644
--- a/libdwfl/linux-core-attach.c
+++ b/libdwfl/linux-core-attach.c
@@ -137,7 +137,7 @@ core_next_thread (Dwfl *dwfl __attribute__ ((unused)), void *dwfl_arg,
const Ebl_Register_Location *reglocs;
size_t nitems;
const Ebl_Core_Item *items;
- if (! ebl_core_note (core_arg->ebl, &nhdr, name,
+ if (! ebl_core_note (core_arg->ebl, &nhdr, name, desc,
&regs_offset, &nregloc, &reglocs, &nitems, &items))
{
/* This note may be just not recognized, skip it. */
@@ -191,8 +191,9 @@ core_set_initial_registers (Dwfl_Thread *thread, void *thread_arg_voidp)
const Ebl_Register_Location *reglocs;
size_t nitems;
const Ebl_Core_Item *items;
- int core_note_err = ebl_core_note (core_arg->ebl, &nhdr, name, &regs_offset,
- &nregloc, &reglocs, &nitems, &items);
+ int core_note_err = ebl_core_note (core_arg->ebl, &nhdr, name, desc,
+ &regs_offset, &nregloc, &reglocs,
+ &nitems, &items);
/* __libdwfl_attach_state_for_core already verified the note is there. */
assert (core_note_err != 0);
assert (nhdr.n_type == NT_PRSTATUS);
@@ -383,7 +384,7 @@ dwfl_core_file_attach (Dwfl *dwfl, Elf *core)
const Ebl_Register_Location *reglocs;
size_t nitems;
const Ebl_Core_Item *items;
- if (! ebl_core_note (ebl, &nhdr, name,
+ if (! ebl_core_note (ebl, &nhdr, name, desc,
&regs_offset, &nregloc, &reglocs, &nitems, &items))
{
/* This note may be just not recognized, skip it. */