Exploit Methods/Userspace execution

From Linux Kernel Security Subsystem
Revision as of 03:49, 15 September 2016 by KeesCook (talk | contribs) (→‎Mitigations)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Details

Once an attacker has gain control over the instruction pointers, it must be aimed somewhere. The place where attackers have the most control over memory layout tends to be in userspace, so it has been natural to place malicious code in userspace and have the kernel redirection execution there. (Frequently known as "ret2usr".)

For more details, see Userspace access, as that is technically a superset of userspace execution.

Examples

Mitigations

  • hardware segmentation: SMEP (x86), PXN (arm)
  • compiler instrumentation to set high bit on function calls
  • emulate memory segmentation via separate page tables (e.g. PAX_MEMORY_UDEREF)

Right now, the upstream options available for Privileged eXecute Never (e.g. PXN, SMEP) are:

CPU Feature Name
ARM v7 (32-bit) non-LPAE CONFIG_CPU_SW_DOMAIN_PAN
v7 (32-bit) LPAE (e.g. Cortex-A7, A15+) hardware PXN
v8.0+ (64-bit) hardware PXN
x86 pre-Ivy-Bridge nothing
Ivy-Bridge+ (since May 2012) hardware PXN (SMEP)
s/390 hardware PXN (Address Spaces)
powerpc nothing?
MIPS nothing (could use ASID switching?)