[PATCH] powerpc: Fix bad stack check in exception entry

Michael Ellerman michael at ellerman.id.au
Wed Dec 18 12:55:50 EST 2013


On Mon, 2013-12-16 at 15:12 +1100, Michael Neuling wrote:
> In EXCEPTION_PROLOG_COMMON() we check to see if the stack pointer (r1)
> is valid when coming from the kernel.  If it's not valid, we die but
> with a nice oops message.
> 
> Currently we allocate a stack frame (subtract INT_FRAME_SIZE) before we
> check to see if the stack pointer is negative.  Unfortunately, this
> won't detect a bad stack where r1 is less than INT_FRAME_SIZE.

The key detail being that we *expect* a negative value, because kernel
addresses (0xc000000000000000) are negative.

cheers




More information about the Linuxppc-dev mailing list