All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] seccomp: Stub for !HAVE_ARCH_SECCOMP_FILTER
@ 2024-10-08  8:29 Linus Walleij
  2024-10-14 20:54 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2024-10-08  8:29 UTC (permalink / raw)
  To: Kees Cook, Andy Lutomirski, Will Drewry; +Cc: linux-kernel, Linus Walleij

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@linaro.org>
---
 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@linaro.org>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-14 20:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08  8:29 [PATCH] seccomp: Stub for !HAVE_ARCH_SECCOMP_FILTER Linus Walleij
2024-10-14 20:54 ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.