diff options
author | James Hogan <[email protected]> | 2017-08-11 21:56:50 +0100 |
---|---|---|
committer | Ralf Baechle <[email protected]> | 2017-08-29 15:42:44 +0200 |
commit | 3d729deaf287c43e415c5d791c9ac8414dbeff70 (patch) | |
tree | 0ceb094ac38ddec6b82f681396395bf7a860be28 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | cc4a41fe5541a73019a864883297bd5043aa6d98 (diff) |
MIPS: seccomp: Fix indirect syscall args
Since commit 669c4092225f ("MIPS: Give __secure_computing() access to
syscall arguments."), upon syscall entry when seccomp is enabled,
syscall_trace_enter() passes a carefully prepared struct seccomp_data
containing syscall arguments to __secure_computing(). Unfortunately it
directly uses mips_get_syscall_arg() and fails to take into account the
indirect O32 system calls (i.e. syscall(2)) which put the system call
number in a0 and have the arguments shifted up by one entry.
We can't just revert that commit as samples/bpf/tracex5 would break
again, so use syscall_get_arguments() which already takes indirect
syscalls into account instead of directly using mips_get_syscall_arg(),
similar to what populate_seccomp_data() does.
This also removes the redundant error checking of the
mips_get_syscall_arg() return value (get_user() already zeroes the
result if an argument from the stack can't be loaded).
Reported-by: James Cowgill <[email protected]>
Fixes: 669c4092225f ("MIPS: Give __secure_computing() access to syscall arguments.")
Signed-off-by: James Hogan <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Cc: David Daney <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Will Drewry <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/16994/
Signed-off-by: Ralf Baechle <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions