diff options
Diffstat (limited to 'kernel/seccomp.c')
-rw-r--r-- | kernel/seccomp.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c index d9db6ec46bc9..ee376beedaf9 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c | |||
@@ -377,8 +377,7 @@ int __secure_computing(int this_syscall) | |||
377 | int mode = current->seccomp.mode; | 377 | int mode = current->seccomp.mode; |
378 | int exit_sig = 0; | 378 | int exit_sig = 0; |
379 | int *syscall; | 379 | int *syscall; |
380 | u32 ret = SECCOMP_RET_KILL; | 380 | u32 ret; |
381 | int data; | ||
382 | 381 | ||
383 | switch (mode) { | 382 | switch (mode) { |
384 | case SECCOMP_MODE_STRICT: | 383 | case SECCOMP_MODE_STRICT: |
@@ -392,12 +391,15 @@ int __secure_computing(int this_syscall) | |||
392 | return 0; | 391 | return 0; |
393 | } while (*++syscall); | 392 | } while (*++syscall); |
394 | exit_sig = SIGKILL; | 393 | exit_sig = SIGKILL; |
394 | ret = SECCOMP_RET_KILL; | ||
395 | break; | 395 | break; |
396 | #ifdef CONFIG_SECCOMP_FILTER | 396 | #ifdef CONFIG_SECCOMP_FILTER |
397 | case SECCOMP_MODE_FILTER: | 397 | case SECCOMP_MODE_FILTER: { |
398 | int data; | ||
398 | ret = seccomp_run_filters(this_syscall); | 399 | ret = seccomp_run_filters(this_syscall); |
399 | data = ret & SECCOMP_RET_DATA; | 400 | data = ret & SECCOMP_RET_DATA; |
400 | switch (ret & SECCOMP_RET_ACTION) { | 401 | ret &= SECCOMP_RET_ACTION; |
402 | switch (ret) { | ||
401 | case SECCOMP_RET_ERRNO: | 403 | case SECCOMP_RET_ERRNO: |
402 | /* Set the low-order 16-bits as a errno. */ | 404 | /* Set the low-order 16-bits as a errno. */ |
403 | syscall_set_return_value(current, task_pt_regs(current), | 405 | syscall_set_return_value(current, task_pt_regs(current), |
@@ -432,6 +434,7 @@ int __secure_computing(int this_syscall) | |||
432 | } | 434 | } |
433 | exit_sig = SIGSYS; | 435 | exit_sig = SIGSYS; |
434 | break; | 436 | break; |
437 | } | ||
435 | #endif | 438 | #endif |
436 | default: | 439 | default: |
437 | BUG(); | 440 | BUG(); |
@@ -442,8 +445,10 @@ int __secure_computing(int this_syscall) | |||
442 | #endif | 445 | #endif |
443 | audit_seccomp(this_syscall, exit_sig, ret); | 446 | audit_seccomp(this_syscall, exit_sig, ret); |
444 | do_exit(exit_sig); | 447 | do_exit(exit_sig); |
448 | #ifdef CONFIG_SECCOMP_FILTER | ||
445 | skip: | 449 | skip: |
446 | audit_seccomp(this_syscall, exit_sig, ret); | 450 | audit_seccomp(this_syscall, exit_sig, ret); |
451 | #endif | ||
447 | return -1; | 452 | return -1; |
448 | } | 453 | } |
449 | 454 | ||