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:
jtl 2016-01-07 15:37:17 +00:00
parent c801c4e674
commit 8c4e8fd3fd

View File

@ -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) {