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

Commit 88f8831c authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds
Browse files

checkpatch: check for world-writeable sysfs/debugfs files



Exporting world writable sysfs/debugfs files is usually a bad thing.  Warn
about it.

Signed-off-by: default avatarDave Jones <davej@redhat.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c023e473
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2897,6 +2897,11 @@ sub process {
				ERROR("lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr);
			}
		}

		if ($line =~ /debugfs_create_file.*S_IWUGO/ ||
		    $line =~ /DEVICE_ATTR.*S_IWUGO/ ) {
			WARN("Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
		}
	}

	# If we have no input at all, then there is nothing to report on