um: segv: Save regs only in case of a kernel mode fault
authorRichard Weinberger <richard@nod.at>
Sun, 20 Jul 2014 11:39:27 +0000 (13:39 +0200)
committerRichard Weinberger <richard@nod.at>
Sun, 20 Jul 2014 11:39:27 +0000 (13:39 +0200)
...otherwise me lose user mode regs and the resulting
stack trace is useless.

Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/kernel/trap.c

index 974b87474a9900f1909f845d449eba90dc9b8338..5678c3571e7cb4d1572d0b16a91b0650f76095c7 100644 (file)
@@ -206,7 +206,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
        int is_write = FAULT_WRITE(fi);
        unsigned long address = FAULT_ADDRESS(fi);
 
-       if (regs)
+       if (!is_user && regs)
                current->thread.segv_regs = container_of(regs, struct pt_regs, regs);
 
        if (!is_user && (address >= start_vm) && (address < end_vm)) {