Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Enable seccomp architecture tracking

To enable seccomp constant action bitmaps, we need to have a static
mapping to the audit architecture and system call table size. Add these
for powerpc.

__LITTLE_ENDIAN__ is used here instead of CONFIG_CPU_LITTLE_ENDIAN
to keep it consistent with asm/syscall.h.

Signed-off-by: YiFei Zhu <yifeifz2@illinois.edu>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/0b64925362671cdaa26d01bfe50b3ba5e164adfd.1605101222.git.yifeifz2@illinois.edu

authored by

YiFei Zhu and committed by
Kees Cook
e7bcb462 6aa7923c

+23
+23
arch/powerpc/include/asm/seccomp.h
··· 8 8 9 9 #include <asm-generic/seccomp.h> 10 10 11 + #ifdef __LITTLE_ENDIAN__ 12 + #define __SECCOMP_ARCH_LE __AUDIT_ARCH_LE 13 + #define __SECCOMP_ARCH_LE_NAME "le" 14 + #else 15 + #define __SECCOMP_ARCH_LE 0 16 + #define __SECCOMP_ARCH_LE_NAME 17 + #endif 18 + 19 + #ifdef CONFIG_PPC64 20 + # define SECCOMP_ARCH_NATIVE (AUDIT_ARCH_PPC64 | __SECCOMP_ARCH_LE) 21 + # define SECCOMP_ARCH_NATIVE_NR NR_syscalls 22 + # define SECCOMP_ARCH_NATIVE_NAME "ppc64" __SECCOMP_ARCH_LE_NAME 23 + # ifdef CONFIG_COMPAT 24 + # define SECCOMP_ARCH_COMPAT (AUDIT_ARCH_PPC | __SECCOMP_ARCH_LE) 25 + # define SECCOMP_ARCH_COMPAT_NR NR_syscalls 26 + # define SECCOMP_ARCH_COMPAT_NAME "ppc" __SECCOMP_ARCH_LE_NAME 27 + # endif 28 + #else /* !CONFIG_PPC64 */ 29 + # define SECCOMP_ARCH_NATIVE (AUDIT_ARCH_PPC | __SECCOMP_ARCH_LE) 30 + # define SECCOMP_ARCH_NATIVE_NR NR_syscalls 31 + # define SECCOMP_ARCH_NATIVE_NAME "ppc" __SECCOMP_ARCH_LE_NAME 32 + #endif 33 + 11 34 #endif /* _ASM_POWERPC_SECCOMP_H */