Message ID | 1456854425-64879-2-git-send-email-brad.figg@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/kernel/seccomp.c b/kernel/seccomp.c index bdaa55d..05e5c05 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -595,7 +595,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;