File tree Expand file tree Collapse file tree 21 files changed +590
-30
lines changed
tools/testing/selftests/seccomp Expand file tree Collapse file tree 21 files changed +590
-30
lines changed Original file line number Diff line number Diff line change @@ -486,6 +486,9 @@ config HAVE_ARCH_SECCOMP_FILTER
486
486
- secure_computing return value is checked and a return value of -1
487
487
results in the system call being skipped immediately.
488
488
- seccomp syscall wired up
489
+ - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
490
+ SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
491
+ COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
489
492
490
493
config SECCOMP
491
494
prompt "Enable seccomp to safely execute untrusted bytecode"
@@ -514,6 +517,20 @@ config SECCOMP_FILTER
514
517
515
518
See Documentation/userspace-api/seccomp_filter.rst for details.
516
519
520
+ config SECCOMP_CACHE_DEBUG
521
+ bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
522
+ depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
523
+ depends on PROC_FS
524
+ help
525
+ This enables the /proc/pid/seccomp_cache interface to monitor
526
+ seccomp cache data. The file format is subject to change. Reading
527
+ the file requires CAP_SYS_ADMIN.
528
+
529
+ This option is for debugging only. Enabling presents the risk that
530
+ an adversary may be able to infer the seccomp filter logic.
531
+
532
+ If unsure, say N.
533
+
517
534
config HAVE_ARCH_STACKLEAK
518
535
bool
519
536
help
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ generic-y += extable.h
4
4
generic-y += flat.h
5
5
generic-y += local64.h
6
6
generic-y += parport.h
7
- generic-y += seccomp.h
8
7
9
8
generated-y += mach-types.h
10
9
generated-y += unistd-nr.h
Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0-only */
2
+ #ifndef _ASM_SECCOMP_H
3
+ #define _ASM_SECCOMP_H
4
+
5
+ #include <asm-generic/seccomp.h>
6
+
7
+ #define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARM
8
+ #define SECCOMP_ARCH_NATIVE_NR NR_syscalls
9
+ #define SECCOMP_ARCH_NATIVE_NAME "arm"
10
+
11
+ #endif /* _ASM_SECCOMP_H */
Original file line number Diff line number Diff line change 19
19
20
20
#include <asm-generic/seccomp.h>
21
21
22
+ #define SECCOMP_ARCH_NATIVE AUDIT_ARCH_AARCH64
23
+ #define SECCOMP_ARCH_NATIVE_NR NR_syscalls
24
+ #define SECCOMP_ARCH_NATIVE_NAME "aarch64"
25
+ #ifdef CONFIG_COMPAT
26
+ # define SECCOMP_ARCH_COMPAT AUDIT_ARCH_ARM
27
+ # define SECCOMP_ARCH_COMPAT_NR __NR_compat_syscalls
28
+ # define SECCOMP_ARCH_COMPAT_NAME "arm"
29
+ #endif
30
+
22
31
#endif /* _ASM_SECCOMP_H */
Original file line number Diff line number Diff line change @@ -4,6 +4,5 @@ generic-y += gpio.h
4
4
generic-y += kvm_para.h
5
5
generic-y += local64.h
6
6
generic-y += qrwlock.h
7
- generic-y += seccomp.h
8
7
generic-y += user.h
9
8
generic-y += vmlinux.lds.h
Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0-only */
2
+ #ifndef _ASM_SECCOMP_H
3
+ #define _ASM_SECCOMP_H
4
+
5
+ #include <asm-generic/seccomp.h>
6
+
7
+ #define SECCOMP_ARCH_NATIVE AUDIT_ARCH_CSKY
8
+ #define SECCOMP_ARCH_NATIVE_NR NR_syscalls
9
+ #define SECCOMP_ARCH_NATIVE_NAME "csky"
10
+
11
+ #endif /* _ASM_SECCOMP_H */
Original file line number Diff line number Diff line change @@ -5,5 +5,4 @@ generated-y += syscall_table_c32.h
5
5
generic-y += kvm_para.h
6
6
generic-y += local64.h
7
7
generic-y += mcs_spinlock.h
8
- generic-y += seccomp.h
9
8
generic-y += user.h
Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0-only */
2
+ #ifndef _ASM_SECCOMP_H
3
+ #define _ASM_SECCOMP_H
4
+
5
+ #include <asm-generic/seccomp.h>
6
+
7
+ #ifdef CONFIG_64BIT
8
+ # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PARISC64
9
+ # define SECCOMP_ARCH_NATIVE_NR NR_syscalls
10
+ # define SECCOMP_ARCH_NATIVE_NAME "parisc64"
11
+ # ifdef CONFIG_COMPAT
12
+ # define SECCOMP_ARCH_COMPAT AUDIT_ARCH_PARISC
13
+ # define SECCOMP_ARCH_COMPAT_NR NR_syscalls
14
+ # define SECCOMP_ARCH_COMPAT_NAME "parisc"
15
+ # endif
16
+ #else /* !CONFIG_64BIT */
17
+ # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PARISC
18
+ # define SECCOMP_ARCH_NATIVE_NR NR_syscalls
19
+ # define SECCOMP_ARCH_NATIVE_NAME "parisc"
20
+ #endif
21
+
22
+ #endif /* _ASM_SECCOMP_H */
Original file line number Diff line number Diff line change 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 */
Original file line number Diff line number Diff line change 7
7
8
8
#include <asm-generic/seccomp.h>
9
9
10
+ #ifdef CONFIG_64BIT
11
+ # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_RISCV64
12
+ # define SECCOMP_ARCH_NATIVE_NR NR_syscalls
13
+ # define SECCOMP_ARCH_NATIVE_NAME "riscv64"
14
+ #else /* !CONFIG_64BIT */
15
+ # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_RISCV32
16
+ # define SECCOMP_ARCH_NATIVE_NR NR_syscalls
17
+ # define SECCOMP_ARCH_NATIVE_NAME "riscv32"
18
+ #endif
19
+
10
20
#endif /* _ASM_SECCOMP_H */
You can’t perform that action at this time.
0 commit comments