]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
s390/seccomp: fix error return for filtered system calls
authorJan Willeke <willeke@de.ibm.com>
Tue, 22 Jul 2014 14:50:57 +0000 (16:50 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Oct 2017 14:28:19 +0000 (15:28 +0100)
commit dc295880c6752076f8b94ba3885d0bfff09e3e82 upstream.

The syscall_set_return_value function of s390 negates the error argument
before storing the value to the return register gpr2. This is incorrect,
the seccomp code already passes the negative error value.
Store the unmodified error value to gpr2.

Signed-off-by: Jan Willeke <willeke@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/s390/include/asm/syscall.h

index f8a806f3f0343a1c13f561e719d5040c8e0dd6df..13243715e5ad8cb459152f38c4bf81b588e6691d 100644 (file)
@@ -54,7 +54,7 @@ static inline void syscall_set_return_value(struct task_struct *task,
                                            struct pt_regs *regs,
                                            int error, long val)
 {
-       regs->gprs[2] = error ? -error : val;
+       regs->gprs[2] = error ? error : val;
 }
 
 static inline void syscall_get_arguments(struct task_struct *task,