提交 88f8831c 编写于 作者: D Dave Jones 提交者: Linus Torvalds

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: NDave Jones <davej@redhat.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 c023e473
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册