Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37549e94 authored by Rusty Russell's avatar Rusty Russell
Browse files

sysfs: disallow world-writable files.



This check was introduced in 2006 by Alexey Dobriyan (9774a1f5)
for module parameters; we removed it when we unified the check into
VERIFY_OCTAL_PERMISSIONS() as sysfs didn't have the same requirement.
Now all those users are fixed, reintroduce it.

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 76681c8f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -849,5 +849,7 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
	 /* User perms >= group perms >= other perms */			\
	 BUILD_BUG_ON_ZERO(((perms) >> 6) < (((perms) >> 3) & 7)) +	\
	 BUILD_BUG_ON_ZERO((((perms) >> 3) & 7) < ((perms) & 7)) +	\
	 /* Other writable?  Generally considered a bad idea. */	\
	 BUILD_BUG_ON_ZERO((perms) & 2) +				\
	 (perms))
#endif