]> git.baikalelectronics.ru Git - kernel.git/commit
sparc64: Do not define thread fpregs save area as zero-length array.
authorDavid S. Miller <davem@davemloft.net>
Sun, 19 Oct 2014 03:12:33 +0000 (23:12 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Oct 2014 03:12:33 +0000 (23:12 -0400)
commitdcdaa15883c7c8604bc8b2495daece76f366829a
treeaf71342b28547a4f9bb3611c1947a4330c544514
parent453b27e4ba1f497ddb0a8c0e0b8f060c8c23752a
sparc64: Do not define thread fpregs save area as zero-length array.

This breaks the stack end corruption detection facility.

What that facility does it write a magic value to "end_of_stack()"
and checking to see if it gets overwritten.

"end_of_stack()" is "task_thread_info(p) + 1", which for sparc64 is
the beginning of the FPU register save area.

So once the user uses the FPU, the magic value is overwritten and the
debug checks trigger.

Fix this by making the size explicit.

Due to the size we use for the fpsaved[], gsr[], and xfsr[] arrays we
are limited to 7 levels of FPU state saves.  So each FPU register set
is 256 bytes, allocate 256 * 7 for the fpregs area.

Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/thread_info_64.h