Skip to content

Commit 221272f

Browse files
committed
seccomp: swap hard-coded zeros to defined name
For clarity, if CONFIG_SECCOMP isn't defined, seccomp_mode() is returning "disabled". This makes that more clear, along with another 0-use, and results in no operational change. Signed-off-by: Kees Cook <keescook@chromium.org>
1 parent 13c4a90 commit 221272f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/linux/seccomp.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static inline long prctl_set_seccomp(unsigned long arg2, char __user *arg3)
7878

7979
static inline int seccomp_mode(struct seccomp *s)
8080
{
81-
return 0;
81+
return SECCOMP_MODE_DISABLED;
8282
}
8383
#endif /* CONFIG_SECCOMP */
8484

‎kernel/seccomp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ void secure_computing_strict(int this_syscall)
594594
unlikely(current->ptrace & PT_SUSPEND_SECCOMP))
595595
return;
596596

597-
if (mode == 0)
597+
if (mode == SECCOMP_MODE_DISABLED)
598598
return;
599599
else if (mode == SECCOMP_MODE_STRICT)
600600
__secure_computing_strict(this_syscall);

0 commit comments

Comments
 (0)