1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00
serenity/Libraries/LibELF
Nico Weber 00f658b984
Lagom+LibELF: Add an ELF fuzzer, and tweak the code to survive a few minutes of fuzzing (#3071)
If a buffer smaller than Elf32_Ehdr was passed to Image, header()
would do an out-of-bounds read.

Make parse() check for that. Make most Image methods assert that the image
is_valid(). For that to work, set m_valid early in Image::parse()
instead of only at its end.

Also reorder a few things so that the fuzzer doesn't hit (valid)
assertions, which were harmless from a security PoV but which still
allowed userspace to crash the kernel with an invalid ELF file.

Make dbgprintf()s configurable at run time so that the fuzzer doesn't
produce lots of logspam.
2020-08-10 15:55:17 +02:00
..
Arch/i386 LibELF: Re-organize ELFDynamicObject::load and add PLT trampoline 2020-01-01 23:54:06 +01:00
AuxiliaryVector.h Kernel+LibELF: Expose ELF Auxiliary Vector to Userspace 2020-07-07 10:38:54 +02:00
DynamicLoader.cpp LibELF+Lagom: Use FlatPtr instead of u32 in DynamicLoader to get LibELF to build in Lagom 2020-08-09 21:12:54 +02:00
DynamicLoader.h LibELF: Validate the mapped file in DynamicLoader constructor 2020-04-11 22:41:05 +02:00
DynamicObject.cpp LibELF+Lagom: Work towards getting LibELF in Lagom 2020-08-09 21:12:54 +02:00
DynamicObject.h Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
exec_elf.h LibGfx: Unpublish Gfx::Size from the global namespace 2020-02-06 13:32:14 +01:00
Image.cpp Lagom+LibELF: Add an ELF fuzzer, and tweak the code to survive a few minutes of fuzzing (#3071) 2020-08-10 15:55:17 +02:00
Image.h Lagom+LibELF: Add an ELF fuzzer, and tweak the code to survive a few minutes of fuzzing (#3071) 2020-08-10 15:55:17 +02:00
Loader.cpp Lagom+LibELF: Add an ELF fuzzer, and tweak the code to survive a few minutes of fuzzing (#3071) 2020-08-10 15:55:17 +02:00
Loader.h Lagom+LibELF: Add an ELF fuzzer, and tweak the code to survive a few minutes of fuzzing (#3071) 2020-08-10 15:55:17 +02:00
Validation.cpp Lagom+LibELF: Add an ELF fuzzer, and tweak the code to survive a few minutes of fuzzing (#3071) 2020-08-10 15:55:17 +02:00
Validation.h Lagom+LibELF: Add an ELF fuzzer, and tweak the code to survive a few minutes of fuzzing (#3071) 2020-08-10 15:55:17 +02:00