android_kernel_motorola_sm6225/arch/parisc
Helge Deller 7a3f5134a8 parisc: fix kernel crash when unwinding a userspace process
Any user on existing parisc 32- and 64bit-kernels can easily crash
the kernel and as such enforce a DSO.
A simple testcase is available here:
        http://gsyprf10.external.hp.com/~deller/crash.tgz

The problem is introduced by the fact, that the handle_interruption()
crash handler calls the show_regs() function, which in turn tries to
unwind the stack by calling parisc_show_stack().  Since the stack contains
userspace addresses, a try to unwind the stack is dangerous and useless
and leads to the crash.

The fix is trivial: For userspace processes
a) avoid to unwind the stack, and
b) avoid to resolve userspace addresses to kernel symbol names.

While touching this code, I converted print_symbol() to %pS
printk formats and made parisc_show_stack() static.

An initial patch for this was written by Kyle McMartin back in August:
http://marc.info/?l=linux-parisc&m=121805168830283&w=2

Compile and run-tested with a 64bit parisc kernel.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x, 2.6.27.x, earlier...]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2008-11-26 22:22:39 +00:00
..
configs [PARISC] move defconfig to arch/parisc/configs/ 2008-03-15 19:12:08 -07:00
hpux [PATCH] prepare vfs_readdir() callers to returning filldir result 2008-10-23 05:13:10 -04:00
include/asm parisc: __kernel_time_t is always long 2008-11-26 22:22:36 +00:00
kernel parisc: fix kernel crash when unwinding a userspace process 2008-11-26 22:22:39 +00:00
lib Revert "parisc: fix trivial section name warnings" 2008-06-13 10:49:45 -04:00
math-emu kbuild: fix up CFLAGS usage 2007-10-14 21:49:42 +02:00
mm mm: drop unneeded pgdat argument from free_area_init_node() 2008-07-24 10:47:16 -07:00
oprofile oprofile: more whitespace fixes 2008-10-15 20:55:51 +02:00
defpalo.conf Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
install.sh Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6 2008-10-20 14:40:31 -07:00
Kconfig.debug alpha/parisc: remove config variable DEBUG_RWLOCK 2008-02-06 10:41:03 -08:00
Makefile [PARISC] move defconfig to arch/parisc/configs/ 2008-03-15 19:12:08 -07:00
nm Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00