Skip to content

Commit

Permalink
checkpatch: check for world-writeable sysfs/debugfs files
Browse files Browse the repository at this point in the history
Exporting world writable sysfs/debugfs files is usually a bad thing.  Warn
about it.

Signed-off-by: Dave Jones <[email protected]>
Cc: Andy Whitcroft <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dave Jones authored and torvalds committed Jan 13, 2011
1 parent c023e47 commit 88f8831
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88f8831

Please sign in to comment.