]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
debugfs: more tightly restrict default mount mode
authorKees Cook <keescook@chromium.org>
Mon, 27 Aug 2012 20:32:15 +0000 (13:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2012 20:42:02 +0000 (13:42 -0700)
Since the debugfs is mostly only used by root, make the default mount
mode 0700. Most system owners do not need a more permissive value,
but they can choose to weaken the restrictions via their fstab.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/filesystems/debugfs.txt
fs/debugfs/inode.c

index 7a34f827989c1fe5c1f3c29bebf57d101150322c..3a863f6927281bf4e672cf1b8bbeb341c112cb37 100644 (file)
@@ -15,8 +15,8 @@ Debugfs is typically mounted with a command like:
     mount -t debugfs none /sys/kernel/debug
 
 (Or an equivalent /etc/fstab line).
-The debugfs root directory is accessible by anyone by default. To
-restrict access to the tree the "uid", "gid" and "mode" mount
+The debugfs root directory is accessible only to the root user by
+default. To change access to the tree the "uid", "gid" and "mode" mount
 options can be used.
 
 Note that the debugfs API is exported GPL-only to modules.
index 2c9fafbe8425c03e20e96b458234eb8fc0b7732d..6393fd61d5c4dedc19574cdee6eb136d1340fddb 100644 (file)
@@ -28,7 +28,7 @@
 #include <linux/magic.h>
 #include <linux/slab.h>
 
-#define DEBUGFS_DEFAULT_MODE   0755
+#define DEBUGFS_DEFAULT_MODE   0700
 
 static struct vfsmount *debugfs_mount;
 static int debugfs_mount_count;