Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173159247
D59635.id186580.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
973 B
Referenced Files
None
Subscribers
None
D59635.id186580.diff
View Options
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -1785,14 +1785,19 @@
void
digest_notes(Obj_Entry *obj, Elf_Addr note_start, Elf_Addr note_end)
{
- const Elf_Note *note;
+ const Elf_Note *note, *next_note;
const char *note_name;
uintptr_t p;
- for (note = (const Elf_Note *)note_start; (Elf_Addr)note < note_end;
- note = (const Elf_Note *)((const char *)(note + 1) +
- roundup2(note->n_namesz, sizeof(Elf32_Addr)) +
- roundup2(note->n_descsz, sizeof(Elf32_Addr)))) {
+ for (note = (const Elf_Note *)note_start;; note = next_note) {
+ if ((Elf_Addr)note + sizeof(Elf_Note) - 1 >= note_end)
+ break;
+ next_note = (const Elf_Note *)((const char *)(note + 1) +
+ roundup2(note->n_namesz, sizeof(Elf32_Addr)) +
+ roundup2(note->n_descsz, sizeof(Elf32_Addr)));
+ if ((Elf_Addr)next_note - 1 >= note_end)
+ break;
+
if (arch_digest_note(obj, note))
continue;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 25, 12:36 AM (5 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38902126
Default Alt Text
D59635.id186580.diff (973 B)
Attached To
Mode
D59635: rtld: more caution when parsing notes in digest_notes()
Attached
Detach File
Event Timeline
Log In to Comment