Skip to contentSkip to conversation

seccomp: swap hard-coded zeros to defined name

PATCH New Kees Cook 1 participant 1 message Jun 15, 2015 Secure computing

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 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.

---
 include/linux/seccomp.h | 2 +-
 kernel/seccomp.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/seccomp.h +1 -1
index a19ddacdac30..f4265039a94c 100644
@@ -78,7 +78,7 @@ static inline long prctl_set_seccomp(unsigned long arg2, char __user *arg3)
 
 static inline int seccomp_mode(struct seccomp *s)
 {
-	return 0;
+	return SECCOMP_MODE_DISABLED;
 }
 #endif /* CONFIG_SECCOMP */
 
kernel/seccomp.c +1 -1
index 645e42d6fa4d..383bd6caca81 100644
@@ -594,7 +594,7 @@ void secure_computing_strict(int this_syscall)
 	    unlikely(current->ptrace & PT_SUSPEND_SECCOMP))
 		return;
 
-	if (mode == 0)
+	if (mode == SECCOMP_MODE_DISABLED)
 		return;
 	else if (mode == SECCOMP_MODE_STRICT)
 		__secure_computing_strict(this_syscall);
Signature · 6 lines
1.9.1


-- 
Kees Cook
Chrome OS Security