]> git.baikalelectronics.ru Git - kernel.git/commit
[ARM] 5340/1: fix stack placement after noexecstack changes
authorLennert Buytenhek <buytenh@wantstofly.org>
Fri, 5 Dec 2008 02:25:47 +0000 (03:25 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 6 Dec 2008 08:32:02 +0000 (08:32 +0000)
commitdff8ac7b1feb81ed74cea24d78fa9f24d1325a46
tree5ba0b06e433834721950736f8946430abe499b7d
parent6a6295c7eba070304b4c6d1c1de56ea53f15190e
[ARM] 5340/1: fix stack placement after noexecstack changes

Commit 93aa7c5d34e4da315fce781f857e96d639f99a7b ("[ARM] Improve
non-executable support") added support for detecting non-executable
stack binaries.  One of the things it does is to make READ_IMPLIES_EXEC
be set in ->personality if we are running on a CPU that doesn't support
the XN ("Execute Never") page table bit or if we are running a binary
that needs an executable stack.

This exposed a latent bug in ARM's asm/processor.h due to which we'll
end up placing the stack at a very low address, where it will bump into
the heap on any application that uses significant amount of stack or
heap or both, causing many interesting crashes.

Fix this by testing the ADDR_LIMIT_32BIT bit in ->personality instead
of testing for equality against PER_LINUX_32BIT.

Reviewed-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/processor.h