MFC r292676:
Only allow one PT_INTERP ELF program header. This also fixes a potential memory leak for interp_buf.
This commit is contained in:
parent
c801c4e674
commit
8c4e8fd3fd
@ -783,6 +783,11 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
|
||||
error = ENOEXEC;
|
||||
goto ret;
|
||||
}
|
||||
if (interp != NULL) {
|
||||
uprintf("Multiple PT_INTERP headers\n");
|
||||
error = ENOEXEC;
|
||||
goto ret;
|
||||
}
|
||||
interp_name_len = phdr[i].p_filesz;
|
||||
if (phdr[i].p_offset > PAGE_SIZE ||
|
||||
interp_name_len > PAGE_SIZE - phdr[i].p_offset) {
|
||||
|
Loading…
Reference in New Issue
Block a user