Skip to content

Commit b6b3c77

Browse files
Linus Walleijmehmetb0
authored andcommitted
seccomp: Stub for !CONFIG_SECCOMP
BugLink: https://bugs.launchpad.net/bugs/2098441 [ Upstream commit f90877d ] 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/[email protected]/ Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Noah Wager <[email protected]> Signed-off-by: Koichiro Den <[email protected]>
1 parent 6175489 commit b6b3c77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/seccomp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ struct seccomp_data;
6868

6969
#ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
7070
static inline int secure_computing(void) { return 0; }
71-
static inline int __secure_computing(const struct seccomp_data *sd) { return 0; }
7271
#else
7372
static inline void secure_computing_strict(int this_syscall) { return; }
7473
#endif
74+
static inline int __secure_computing(const struct seccomp_data *sd) { return 0; }
7575

7676
static inline long prctl_get_seccomp(void)
7777
{

0 commit comments

Comments
 (0)