diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-08-01 10:30:06 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-08-01 10:30:19 +0300 |
commit | 7946c2beac12136b02ef7ea05bd2901ff57807a2 (patch) | |
tree | 504f57446d91c1f4204d9679ad104e43dabb5ac8 | |
parent | 609c19a385c8744c41f944e2a2d8afe8e8fb860e (diff) | |
parent | 57f90c3dfc75da89358735c06bf9bc9815b4183e (diff) | |
download | linux-7946c2beac12136b02ef7ea05bd2901ff57807a2.tar.xz |
Merge branch 'x86/asm' into x86/urgent, to pick up fix
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/entry/vdso/vdso2c.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h index 63a03bb91497..4f741192846d 100644 --- a/arch/x86/entry/vdso/vdso2c.h +++ b/arch/x86/entry/vdso/vdso2c.h @@ -22,6 +22,9 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len, ELF(Phdr) *pt = (ELF(Phdr) *)(raw_addr + GET_LE(&hdr->e_phoff)); + if (hdr->e_type != ET_DYN) + fail("input is not a shared object\n"); + /* Walk the segment table. */ for (i = 0; i < GET_LE(&hdr->e_phnum); i++) { if (GET_LE(&pt[i].p_type) == PT_LOAD) { @@ -49,6 +52,9 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len, if (stripped_len < load_size) fail("stripped input is too short\n"); + if (!dyn) + fail("input has no PT_DYNAMIC section -- your toolchain is buggy\n"); + /* Walk the dynamic table */ for (i = 0; dyn + i < dyn_end && GET_LE(&dyn[i].d_tag) != DT_NULL; i++) { |