Skip to content

Commit 8cf8dfc

Browse files
linuswkees
authored andcommitted
seccomp: Stub for !HAVE_ARCH_SECCOMP_FILTER
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]>
1 parent 8cf0b93 commit 8cf8dfc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/linux/seccomp.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ static inline int secure_computing(void)
3232
}
3333
#else
3434
extern void secure_computing_strict(int this_syscall);
35+
static inline int __secure_computing(const struct seccomp_data *sd)
36+
{
37+
secure_computing_strict(sd->nr);
38+
return 0;
39+
}
3540
#endif
3641

3742
extern long prctl_get_seccomp(void);

0 commit comments

Comments
 (0)