diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-03-19 10:04:29 +0000 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-03-20 18:56:04 +0900 |
commit | 615e73b3cd8876262f61ea28b4147c8de38a043a (patch) | |
tree | a846b18db9a718538d7093751e2cbe2d8ca5cc0b /arch/sh | |
parent | 7e6b6f2b949a52382f59a93ecbe86e32e4fcec7c (diff) | |
download | linux-3.10-615e73b3cd8876262f61ea28b4147c8de38a043a.tar.gz linux-3.10-615e73b3cd8876262f61ea28b4147c8de38a043a.tar.bz2 linux-3.10-615e73b3cd8876262f61ea28b4147c8de38a043a.zip |
sh: disallow kexec virtual entry
Older versions of kexec-tools has a zImage loader that
passes a virtual address as entry point. The elf loader
otoh it passes a physical address as entry point, and
pages are always passed as physical addresses as well.
Only allow physical addresses from now on.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/machine_kexec.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index cc7c29b0dc8..7ea2704ea03 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c @@ -46,6 +46,12 @@ void machine_crash_shutdown(struct pt_regs *regs) */ int machine_kexec_prepare(struct kimage *image) { + /* older versions of kexec-tools are passing + * the zImage entry point as a virtual address. + */ + if (image->start != PHYSADDR(image->start)) + return -EINVAL; /* upgrade your kexec-tools */ + return 0; } @@ -125,7 +131,8 @@ void machine_kexec(struct kimage *image) /* now call it */ rnk = (relocate_new_kernel_t) reboot_code_buffer; - (*rnk)(page_list, reboot_code_buffer, image->start); + (*rnk)(page_list, reboot_code_buffer, + (unsigned long)phys_to_virt(image->start)); #ifdef CONFIG_KEXEC_JUMP asm volatile("ldc %0, vbr" : : "r" (&vbr_base) : "memory"); |