[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250108-seccomp-stub-2-v2-1-74523d49420f@linaro.org>
Date: Wed, 08 Jan 2025 23:44:45 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Kees Cook <kees@...nel.org>, Andy Lutomirski <luto@...capital.net>,
Will Drewry <wad@...omium.org>
Cc: linux-kernel@...r.kernel.org, Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH v2] seccomp: Stub for !CONFIG_SECCOMP
When using !CONFIG_SECCOMP with CONFIG_GENERIC_ENTRY, the
randconfig bots found the following snag:
kernel/entry/common.c: In function 'syscall_trace_enter':
>> kernel/entry/common.c:52:23: error: implicit declaration
of function '__secure_computing' [-Wimplicit-function-declaration]
52 | ret = __secure_computing(NULL);
| ^~~~~~~~~~~~~~~~~~
Since generic entry calls __secure_computing() unconditionally,
fix this by moving the stub out of the ifdef clause for
CONFIG_HAVE_ARCH_SECCOMP_FILTER so it's always available.
Link: https://lore.kernel.org/oe-kbuild-all/202501061240.Fzk9qiFZ-lkp@intel.com/
Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
---
Changes in v2:
- Just move the existing stub instead of adding yet another
one.
- Link to v1: https://lore.kernel.org/r/20250107-seccomp-stub-2-v1-1-fd43bcee2560@linaro.org
---
include/linux/seccomp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 341980599c71242d3bb95b544c954278efcc65b9..e45531455d3bbe4ea0ec9e873b73bc3f02bfa2e5 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -55,10 +55,10 @@ struct seccomp_data;
#ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
static inline int secure_computing(void) { return 0; }
-static inline int __secure_computing(const struct seccomp_data *sd) { return 0; }
#else
static inline void secure_computing_strict(int this_syscall) { return; }
#endif
+static inline int __secure_computing(const struct seccomp_data *sd) { return 0; }
static inline long prctl_get_seccomp(void)
{
---
base-commit: 40384c840ea1944d7c5a392e8975ed088ecf0b37
change-id: 20250107-seccomp-stub-2-a2e8cbe1f949
Best regards,
--
Linus Walleij <linus.walleij@...aro.org>
Powered by blists - more mailing lists