linux-stable/arch
Jonathan Austin 9dfc28b630 ARM: mpu: protect the vectors page with an MPU region
Without an MMU it is possible for userspace programs to start executing code
in places that they have no business executing. The MPU allows some level of
protection against this.

This patch protects the vectors page from access by userspace processes.
Userspace tasks that dereference a null pointer are already protected by an
svc at 0x0 that kills them. However when tasks use an offset from a null
pointer (eg a function in a null struct) they miss this carefully placed svc
and enter the exception vectors in user mode, ending up in the kernel.

This patch causes programs that do this to receive a SEGV instead of happily
entering the kernel in user-mode, and hence avoid a 'Bad Mode' panic.

As part of this change it is necessary to make sigreturn happen via the
stack when there is not an sa_restorer function. This change is invisible to
userspace, and irrelevant to code compiled using a uClibc toolchain, which
always uses an sa_restorer function.

Because we don't get to remap the vectors in !MMU kuser_helpers are not
in a defined location, and hence aren't usable. This means we don't need to
worry about keeping them accessible from PL0

Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
CC: Nicolas Pitre <nico@linaro.org>
CC: Catalin Marinas <catalin.marinas@arm.com>
2013-06-17 15:13:18 +01:00
..
alpha Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
arc Aliasing VIPT dcache support for ARC 2013-05-10 07:24:14 -07:00
arm ARM: mpu: protect the vectors page with an MPU region 2013-06-17 15:13:18 +01:00
arm64 arm64: debug: fix mdscr.ss check when enabling debug exceptions 2013-05-17 18:24:19 +01:00
avr32 Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
blackfin blackfin updates for Linux 3.10 2013-05-10 07:21:16 -07:00
c6x dump_stack: unify debug information printed by show_regs() 2013-04-30 17:04:02 -07:00
cris - Lots of cleanups from Artem, including deletion of some obsolete drivers 2013-05-09 10:15:46 -07:00
frv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-05-01 14:08:52 -07:00
h8300 We get rid of the general module prefix confusion with a binary config option, 2013-05-05 10:58:06 -07:00
hexagon Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
ia64 Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
m32r Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-05-01 14:08:52 -07:00
m68k - Artem's removal of dead code continues (RPX, MBX860) 2013-05-10 09:09:47 -07:00
metag Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
microblaze Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze 2013-05-10 07:19:52 -07:00
mips Merge branch 'devm_no_resource_check' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2013-05-18 10:54:54 -07:00
mn10300 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-05-01 14:08:52 -07:00
openrisc Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
parisc parisc: make default cross compiler search more robust (v3) 2013-05-13 22:11:57 +02:00
powerpc Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-05-14 07:43:11 -07:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2013-05-21 09:36:46 -07:00
score Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
sh Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
sparc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2013-05-10 09:21:05 -07:00
tile Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2013-05-09 14:34:58 -07:00
um Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-07 15:14:53 -07:00
unicore32 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2013-05-10 09:21:05 -07:00
x86 x86: Fix bit corruption at CPU resume time 2013-05-20 11:36:03 -07:00
xtensa Xtensa patchset for v3.10-rc1 2013-05-09 14:38:16 -07:00
.gitignore
Kconfig Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-05-15 14:04:00 -07:00