aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2015-08-09 16:26:33 -0400
committerRichard Weinberger <richard@nod.at>2015-10-19 16:53:37 -0400
commit56b88a3bf97a39d3f4f010509917b76a865a6dc8 (patch)
tree408b519405bd8545f8da4102ac120db58d2a1f3e /arch/um/kernel
parent6b1873371cea13036171d03a7c1e3e59158b4505 (diff)
um: Fix kernel mode fault condition
We have to exclude memory locations <= PAGE_SIZE from the condition and let the kernel mode fault path catch it. Otherwise a kernel NULL pointer exception will be reported as a kernel user space access. Fixes: d2313084e2c (um: Catch unprotected user memory access) Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/kernel')
-rw-r--r--arch/um/kernel/trap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c
index d8a9fce6ee2e..98783dd0fa2e 100644
--- a/arch/um/kernel/trap.c
+++ b/arch/um/kernel/trap.c
@@ -220,7 +220,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
220 show_regs(container_of(regs, struct pt_regs, regs)); 220 show_regs(container_of(regs, struct pt_regs, regs));
221 panic("Segfault with no mm"); 221 panic("Segfault with no mm");
222 } 222 }
223 else if (!is_user && address < TASK_SIZE) { 223 else if (!is_user && address > PAGE_SIZE && address < TASK_SIZE) {
224 show_regs(container_of(regs, struct pt_regs, regs)); 224 show_regs(container_of(regs, struct pt_regs, regs));
225 panic("Kernel tried to access user memory at addr 0x%lx, ip 0x%lx", 225 panic("Kernel tried to access user memory at addr 0x%lx, ip 0x%lx",
226 address, ip); 226 address, ip);