Subject: [PATCH 0/3] Fix uaccess kernel protection on ARMv5 and earlier

From: Russell King - ARM Linux admin <[email-masked]>
Date: Mon, 4 May 2020 14:34:35 +0100

Hi,

This series fixes a problem with the ability for the user accessors to
access kernel space in a very specific circumstance.  I'm greatful to
Tomas Paukrt for having the patience to track down the problem.

This only happens when the following conditions are met:

- ARMv5 or earlier CPU
- Software PAN is disabled
- Nested exceptions that want to use user accessors to touch kernel
  space (implying use of the set_fs() function.)

The result is that the domain register is not preserved across the
nested exception, but instead is reset to prevent kernel accesses
while we are inside a region that should be permitting them.

Further technical details can be found in patch 3.

Patch 1 consolidates the uaccess macros into a new include file.
Patch 2 integrates the address limit save/reset/restore into this
 file, moving it from entry-armv.S, since we need to integrate this
 with the domain register manipulations.
Patch 3 ensures that the domain register is always saved and restored
 not only if we are using software PAN, but if we're using CPU domains
 for kernel memory protection.

 arch/arm/include/asm/assembler.h   |  75 +-----------------------
 arch/arm/include/asm/uaccess-asm.h | 117 +++++++++++++++++++++++++++++++++++++
 arch/arm/kernel/entry-armv.S       |  11 +---
 arch/arm/kernel/entry-header.S     |   9 +--
 4 files changed, 123 insertions(+), 89 deletions(-)
 create mode 100644 arch/arm/include/asm/uaccess-asm.h

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel