]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerJiri Slaby <jslaby@suse.cz>
Fri, 31 Oct 2014 14:05:22 +0000 (15:05 +0100)
commitc973669c3e04dbab2c7c4cd74e6d778202d1a5d4
tree2227646f4a94f1db21521327b4c8f17d9ee32635
parentdf4ef7bad4c314681dcfed13be5d959d47a3dfc9
sparc64: Do not define thread fpregs save area as zero-length array.

[ Upstream commit e2653143d7d79a49f1a961aeae1d82612838b12c ]

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