Thread (36 messages) read the whole thread 36 messages, 12 authors, 2016-03-08
STALE3799d

Revision v2 of 4 in this series.

Revisions (4)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v2 [diff vs current]
  4. v2 current

[PATCH v2 5/5] arm64: kernel: Don't toggle PAN on systems with UAO

From: james.morse@arm.com (James Morse)
Date: 2016-02-18 14:43:48

Hi Catalin,

On 18/02/16 14:36, Catalin Marinas wrote:
On Fri, Feb 05, 2016 at 02:58:50PM +0000, James Morse wrote:
quoted
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -234,6 +234,9 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 	}
 
 	if (permission_fault(esr) && (addr < USER_DS)) {
+		if (get_thread_info(regs->sp)->addr_limit == KERNEL_DS)
+			panic("Accessing user space memory with fs=KERNEL_DS");
We could simply use "get_fs() == KERNEL_DS" as we should call
do_page_fault() outside the current context.
shouldn't?

You're right, it will always be on the same stack, so get_fs() will give us the
right result. This fits better with getting rid of the new get_thread_info() in
patch 3.


Thanks,

James
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help