selftests/seccomp: Remove SYSCALL_NUM_RET_SHARE_REG in favor of SYSCALL_RET_SET
authorKees Cook <keescook@chromium.org>
Sat, 12 Sep 2020 11:08:16 +0000 (04:08 -0700)
committerKees Cook <keescook@chromium.org>
Sat, 19 Sep 2020 08:00:03 +0000 (01:00 -0700)
commitf04cf78bbfcd1fa5b1819613a5f354b228f36e03
tree870931840bba40a7f96821e2767f41288b6b812e
parente4e8e5d28d5e1dac24f775452d4cc6f49f5c069e
selftests/seccomp: Remove SYSCALL_NUM_RET_SHARE_REG in favor of SYSCALL_RET_SET

Instead of special-casing the specific case of shared registers, create
a default SYSCALL_RET_SET() macro (mirroring SYSCALL_NUM_SET()), that
writes to the SYSCALL_RET register. For architectures that can't set the
return value (for whatever reason), they can define SYSCALL_RET_SET()
without an associated SYSCALL_RET() macro. This also paves the way for
architectures that need to do special things to set the return value
(e.g. powerpc).

Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/lkml/20200912110820.597135-12-keescook@chromium.org
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
tools/testing/selftests/seccomp/seccomp_bpf.c