]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: software-based priviledged-no-access support
authorRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 19 Aug 2015 19:40:41 +0000 (20:40 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 26 Aug 2015 19:34:24 +0000 (20:34 +0100)
commitc0f153321b9e24284261c28ec7dda6d85a0d9b25
treeae603e2e67bcac0564b2eba0a7771f8c5cebf352
parentcaf3b290e38c744c04080c92cccdb7f5d271bf93
ARM: software-based priviledged-no-access support

Provide a software-based implementation of the priviledged no access
support found in ARMv8.1.

Userspace pages are mapped using a different domain number from the
kernel and IO mappings.  If we switch the user domain to "no access"
when we enter the kernel, we can prevent the kernel from touching
userspace.

However, the kernel needs to be able to access userspace via the
various user accessor functions.  With the wrapping in the previous
patch, we can temporarily enable access when the kernel needs user
access, and re-disable it afterwards.

This allows us to trap non-intended accesses to userspace, eg, caused
by an inadvertent dereference of the LIST_POISON* values, which, with
appropriate user mappings setup, can be made to succeed.  This in turn
can allow use-after-free bugs to be further exploited than would
otherwise be possible.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Kconfig
arch/arm/include/asm/assembler.h
arch/arm/include/asm/domain.h
arch/arm/include/asm/uaccess.h
arch/arm/kernel/process.c
arch/arm/kernel/swp_emulate.c
arch/arm/lib/csumpartialcopyuser.S