diff options
Diffstat (limited to 'kernel/seccomp.c')
-rw-r--r-- | kernel/seccomp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 4ef9687ac115..4f44028943e6 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c | |||
@@ -629,7 +629,9 @@ static u32 __seccomp_phase1_filter(int this_syscall, struct seccomp_data *sd) | |||
629 | 629 | ||
630 | switch (action) { | 630 | switch (action) { |
631 | case SECCOMP_RET_ERRNO: | 631 | case SECCOMP_RET_ERRNO: |
632 | /* Set the low-order 16-bits as a errno. */ | 632 | /* Set low-order bits as an errno, capped at MAX_ERRNO. */ |
633 | if (data > MAX_ERRNO) | ||
634 | data = MAX_ERRNO; | ||
633 | syscall_set_return_value(current, task_pt_regs(current), | 635 | syscall_set_return_value(current, task_pt_regs(current), |
634 | -data, 0); | 636 | -data, 0); |
635 | goto skip; | 637 | goto skip; |