In compat64, the syscalls have the same numbers as in native. Set the seccomp mode compat syscalls accordingly.
Signed-off-by: Tudor Cretu tudor.cretu@arm.com --- arch/arm64/include/asm/seccomp.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/include/asm/seccomp.h b/arch/arm64/include/asm/seccomp.h index 30256233788b..617250b9aa62 100644 --- a/arch/arm64/include/asm/seccomp.h +++ b/arch/arm64/include/asm/seccomp.h @@ -11,10 +11,23 @@ #include <asm/unistd.h>
#ifdef CONFIG_COMPAT -#define __NR_seccomp_read_32 __NR_compat_read -#define __NR_seccomp_write_32 __NR_compat_write -#define __NR_seccomp_exit_32 __NR_compat_exit -#define __NR_seccomp_sigreturn_32 __NR_compat_rt_sigreturn +static inline const int *get_compat_mode1_syscalls(void) +{ + static const int mode1_syscalls_compat[] = { +#ifdef CONFIG_COMPAT32 + __NR_compat_read, __NR_compat_write, + __NR_compat_exit, __NR_compat_rt_sigreturn, +#else + __NR_read, __NR_write, + __NR_exit, __NR_rt_sigreturn, +#endif + -1, /* negative terminated */ + }; + return mode1_syscalls_compat; +} + +#define get_compat_mode1_syscalls get_compat_mode1_syscalls + #endif /* CONFIG_COMPAT */
#include <asm-generic/seccomp.h>