Skip to content

Commit

Permalink
s390/seccomp: fix error return for filtered system calls
Browse files Browse the repository at this point in the history
commit dc29588 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jan Willeke authored and Greg Kroah-Hartman committed Jul 27, 2016
1 parent d5ec9cb commit 5704f30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5704f30

Please sign in to comment.