]> Git Repo - linux.git/commitdiff
seccomp: Stub for !HAVE_ARCH_SECCOMP_FILTER
authorLinus Walleij <[email protected]>
Tue, 22 Oct 2024 13:41:34 +0000 (15:41 +0200)
committerKees Cook <[email protected]>
Tue, 22 Oct 2024 19:35:14 +0000 (12:35 -0700)
If we have CONFIG_SECCOMP but not CONFIG_HAVE_ARCH_SECCOMP_FILTER
we get a compilation error:

../kernel/entry/common.c: In function 'syscall_trace_enter':
../kernel/entry/common.c:55:23: error: implicit declaration of function '__secure_computing' [-Werror=implicit-function-declaration]
   55 |                 ret = __secure_computing(NULL);
      |                       ^~~~~~~~~~~~~~~~~~

This is because generic entry calls __secure_computing()
unconditionally.

Provide the needed stub similar to how current ARM does
this by calling secure_computing_strict() in the absence
of secure_computing(). This is similar to what is done for
ARM in arch/arm/kernel/ptrace.c.

Signed-off-by: Linus Walleij <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Kees Cook <[email protected]>
include/linux/seccomp.h

index 709ad84809e1eac87bb18517c0598f534be4ceb1..341980599c71242d3bb95b544c954278efcc65b9 100644 (file)
@@ -32,6 +32,11 @@ static inline int secure_computing(void)
 }
 #else
 extern void secure_computing_strict(int this_syscall);
+static inline int __secure_computing(const struct seccomp_data *sd)
+{
+       secure_computing_strict(sd->nr);
+       return 0;
+}
 #endif
 
 extern long prctl_get_seccomp(void);
This page took 0.060641 seconds and 4 git commands to generate.