[PATCH] seccomp: Stub for !HAVE_ARCH_SECCOMP_FILTER
From: Linus Walleij
Date: Tue Oct 08 2024 - 04:51:52 EST
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.
Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
---
include/linux/seccomp.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 709ad84809e1..832c612c5b54 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -31,6 +31,7 @@ static inline int secure_computing(void)
return 0;
}
#else
+static inline int __secure_computing(const struct seccomp_data *sd) { return 0; }
extern void secure_computing_strict(int this_syscall);
#endif
---
base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
change-id: 20241008-seccomp-compile-error-83f367447d56
Best regards,
--
Linus Walleij <linus.walleij@xxxxxxxxxx>