aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickaël Salaün <mic@digikod.net>2016-08-01 17:01:55 -0400
committerKees Cook <keescook@chromium.org>2016-09-07 12:25:04 -0400
commit972939e28592ec61e2e8334786152be2c80de677 (patch)
treec3c9dae3adfeee873a083db969bcfa2e700abbd2
parentd060e0f603a4156087813d221d818bb39ec91429 (diff)
um/ptrace: Fix the syscall_trace_leave call
Keep the same semantic as before the commit 26703c636c1f: deallocate audit context and fake a proper syscall exit. This fix a kernel panic triggered by the seccomp_bpf test: > [ RUN ] global.ERRNO_valid > BUG: failure at kernel/auditsc.c:1504/__audit_syscall_entry()! > Kernel panic - not syncing: BUG! Fixes: 26703c636c1f ("um/ptrace: run seccomp after ptrace") Signed-off-by: Mickaël Salaün <mic@digikod.net> Acked-by: Kees Cook <keescook@chromium.org> Cc: Jeff Dike <jdike@addtoit.com> Cc: Richard Weinberger <richard@nod.at> Cc: James Morris <jmorris@namei.org> Cc: user-mode-linux-devel@lists.sourceforge.net Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r--arch/um/kernel/skas/syscall.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c
index ef4b8f949b51..0728fee94398 100644
--- a/arch/um/kernel/skas/syscall.c
+++ b/arch/um/kernel/skas/syscall.c
@@ -21,11 +21,11 @@ void handle_syscall(struct uml_pt_regs *r)
21 PT_REGS_SET_SYSCALL_RETURN(regs, -ENOSYS); 21 PT_REGS_SET_SYSCALL_RETURN(regs, -ENOSYS);
22 22
23 if (syscall_trace_enter(regs)) 23 if (syscall_trace_enter(regs))
24 return; 24 goto out;
25 25
26 /* Do the seccomp check after ptrace; failures should be fast. */ 26 /* Do the seccomp check after ptrace; failures should be fast. */
27 if (secure_computing(NULL) == -1) 27 if (secure_computing(NULL) == -1)
28 return; 28 goto out;
29 29
30 /* Update the syscall number after orig_ax has potentially been updated 30 /* Update the syscall number after orig_ax has potentially been updated
31 * with ptrace. 31 * with ptrace.
@@ -37,5 +37,6 @@ void handle_syscall(struct uml_pt_regs *r)
37 PT_REGS_SET_SYSCALL_RETURN(regs, 37 PT_REGS_SET_SYSCALL_RETURN(regs,
38 EXECUTE_SYSCALL(syscall, regs)); 38 EXECUTE_SYSCALL(syscall, regs));
39 39
40out:
40 syscall_trace_leave(regs); 41 syscall_trace_leave(regs);
41} 42}