]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
[POWERPC] Harden validate_sp against stack corruption
authorPaul Mackerras <paulus@samba.org>
Mon, 19 Feb 2007 00:42:42 +0000 (11:42 +1100)
committerPaul Mackerras <paulus@samba.org>
Thu, 8 Mar 2007 04:31:43 +0000 (15:31 +1100)
commitbb72c481e970dc1b4034ddccbe8302ff39e0d948
tree4fa19698d82308c0b293bd3968bfd3b7a5e59ba7
parent99ddef9bfe714c3273e3fce4c6b6a2a99e7d0bf8
[POWERPC] Harden validate_sp against stack corruption

If something has overflowed or corrupted the stack and causes an oops,
and we try to print a stack trace, that will call validate_sp, which
can itself cause an oops if the cpu field of the thread_info struct at
the bottom of the stack has been corrupted (if CONFIG_IRQSTACKS is
set).  This makes debugging harder.

To avoid the second oops, this adds a check to make sure that the cpu
number is reasonable before using it to check whether the stack is on
the softirq or hardirq stack.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/process.c