diff options
author | Dave Jones <davej@redhat.com> | 2011-01-12 16:59:59 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 08:03:11 -0800 |
commit | 88f8831c055858179a7844d9dd4ddd7d3621322e (patch) | |
tree | b8f5c4cdb714ec2fbb7ecf4ca34fff6dbbeb304d /scripts/checkpatch.pl | |
parent | c023e4734c3e8801e0ecb5e81b831d42a374d861 (diff) | |
download | linux-88f8831c055858179a7844d9dd4ddd7d3621322e.tar.gz linux-88f8831c055858179a7844d9dd4ddd7d3621322e.tar.bz2 linux-88f8831c055858179a7844d9dd4ddd7d3621322e.zip |
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: Dave Jones <davej@redhat.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index ddd27d8e6312..fd9560ea976c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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 |