mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibELF+Kernel: Validate program headers in Image::parse
This should catch more malformed ELF files earlier than simply checking the ELF header alone. Also change the API of validate_program_headers to take the interpreter_path by pointer. This makes it less awkward to call when we don't care about the interpreter, and just want the validation.
This commit is contained in:
parent
8297698a3a
commit
3f808b0dda
Notes:
sideshowbarker
2024-07-19 01:08:18 +09:00
Author: https://github.com/ADKaster
Commit: 3f808b0dda
Pull-request: https://github.com/SerenityOS/serenity/pull/4285
Issue: https://github.com/SerenityOS/serenity/issues/4221
5 changed files with 30 additions and 15 deletions
|
@ -151,6 +151,12 @@ bool Image::parse()
|
|||
return m_valid = false;
|
||||
}
|
||||
|
||||
if (!validate_program_headers(header(), m_size, m_buffer, m_size, nullptr, m_verbose_logging)) {
|
||||
if (m_verbose_logging)
|
||||
dbgputstr("Image::parse(): ELF Program Headers not valid\n");
|
||||
return m_valid = false;
|
||||
}
|
||||
|
||||
m_valid = true;
|
||||
|
||||
// First locate the string tables.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue