linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix uaccess kernel protection on ARMv5 and earlier
@ 2020-05-04 13:34 Russell King - ARM Linux admin
  2020-05-04 13:34 ` [PATCH 1/3] ARM: uaccess: consolidate uaccess asm to asm/uaccess-asm.h Russell King
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Russell King - ARM Linux admin @ 2020-05-04 13:34 UTC (permalink / raw)
  To: linux-arm-kernel, Tomas Paukrt; +Cc: Will Deacon, Alexander Viro

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
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-04 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-04 13:34 [PATCH 0/3] Fix uaccess kernel protection on ARMv5 and earlier Russell King - ARM Linux admin
2020-05-04 13:34 ` [PATCH 1/3] ARM: uaccess: consolidate uaccess asm to asm/uaccess-asm.h Russell King
2020-05-04 13:35 ` [PATCH 2/3] ARM: uaccess: integrate uaccess_save and uaccess_restore Russell King
2020-05-04 13:35 ` [PATCH 3/3] ARM: uaccess: fix DACR mismatch with nested exceptions Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).