linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] debugfs: more tightly restrict default mount mode
@ 2012-08-27 20:32 Kees Cook
  2012-08-27 20:41 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Kees Cook @ 2012-08-27 20:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Ben Hutchings, Rob Landley, Al Viro,
	Ludwig Nussel, Alessandro Rubini, Kees Cook, linux-doc

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>
---
 Documentation/filesystems/debugfs.txt |    4 ++--
 fs/debugfs/inode.c                    |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/filesystems/debugfs.txt b/Documentation/filesystems/debugfs.txt
index 7a34f82..3a863f6 100644
--- a/Documentation/filesystems/debugfs.txt
+++ b/Documentation/filesystems/debugfs.txt
@@ -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.
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 4733eab..2d22c81 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -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;
-- 
1.7.0.4


-- 
Kees Cook
Chrome OS Security

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-08-30 16:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-27 20:32 [PATCH] debugfs: more tightly restrict default mount mode Kees Cook
2012-08-27 20:41 ` Greg Kroah-Hartman
2012-08-28  7:44 ` Alessandro Rubini
2012-08-28 14:41 ` Hardening debugfs (Was Re: [PATCH] debugfs: more tightly restrict default mount mode) Theodore Ts'o
2012-08-28 14:55   ` Ben Hutchings
2012-08-28 15:02     ` Theodore Ts'o
2012-08-28 17:09   ` Greg Kroah-Hartman
2012-08-28 19:43     ` Kees Cook
2012-08-28 22:55   ` Rob Landley
2012-08-29  4:09     ` Greg Kroah-Hartman
2012-08-30 16:15       ` Rob Landley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).