linux_dsm_epyc7002/arch/mips/include/asm/seccomp.h
Matt Redfearn b1b4fad5cc MIPS: seccomp: Support compat with both O32 and N32
Previously the seccomp would only support strict mode on O32 userland
programs when the kernel had support for both O32 and N32 ABIs. Remove
kludge and support both ABIs.

With this patch in place, the seccomp_bpf self test now passes
global.mode_strict_support with N32 userland.

Suggested-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: IMG-MIPSLinuxKerneldevelopers@imgtec.com
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12917/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2016-05-13 14:02:01 +02:00

35 lines
769 B
C

#ifndef __ASM_SECCOMP_H
#include <linux/unistd.h>
#ifdef CONFIG_COMPAT
static inline const int *get_compat_mode1_syscalls(void)
{
static const int syscalls_O32[] = {
__NR_O32_Linux + 3, __NR_O32_Linux + 4,
__NR_O32_Linux + 1, __NR_O32_Linux + 193,
0, /* null terminated */
};
static const int syscalls_N32[] = {
__NR_N32_Linux + 0, __NR_N32_Linux + 1,
__NR_N32_Linux + 58, __NR_N32_Linux + 211,
0, /* null terminated */
};
if (config_enabled(CONFIG_MIPS32_O32) && test_thread_flag(TIF_32BIT_REGS))
return syscalls_O32;
if (config_enabled(CONFIG_MIPS32_N32))
return syscalls_N32;
BUG();
}
#define get_compat_mode1_syscalls get_compat_mode1_syscalls
#endif /* CONFIG_COMPAT */
#include <asm-generic/seccomp.h>
#endif /* __ASM_SECCOMP_H */