aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/seccomp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 1fbb1a2bc45..ba54fc2f417 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -600,7 +600,9 @@ int __secure_computing(int this_syscall)
ret &= SECCOMP_RET_ACTION;
switch (ret) {
case SECCOMP_RET_ERRNO:
- /* Set the low-order 16-bits as a errno. */
+ /* Set low-order bits as an errno, capped at MAX_ERRNO. */
+ if (data > MAX_ERRNO)
+ data = MAX_ERRNO;
syscall_set_return_value(current, regs,
-data, 0);
goto skip;