X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=kernel%2Fseccomp.c;h=4f44028943e663391fe35827c8c5acb4966b5101;hb=e3d50738e59af9e58f569e54ff8af1840bea906c;hp=4ef9687ac115f21aae6ce4321e2639866892389d;hpb=66b3f4f0a0fcc197a1e432c3d2134f5c6a5275b9;p=karo-tx-linux.git 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) switch (action) { 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, task_pt_regs(current), -data, 0); goto skip;