Skip to content

Fix uaccess kernel protection on ARMv5 and earlier

Russell King - ARM Linux admin linux-arm-kernel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Fix uaccess kernel protection on ARMv5 and earlier

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
Signature · 7 lines
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 protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel