From: Kees Cook <keescook@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ben Hutchings <ben@decadent.org.uk>,
Rob Landley <rob@landley.net>, Al Viro <viro@zeniv.linux.org.uk>,
Ludwig Nussel <ludwig.nussel@suse.de>,
Alessandro Rubini <rubini@gnudd.com>,
Kees Cook <keescook@chromium.org>,
linux-doc@vger.kernel.org
Subject: [PATCH] debugfs: more tightly restrict default mount mode
Date: Mon, 27 Aug 2012 13:32:15 -0700 [thread overview]
Message-ID: <20120827203215.GA16637@www.outflux.net> (raw)
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
next reply other threads:[~2012-08-27 20:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-27 20:32 Kees Cook [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120827203215.GA16637@www.outflux.net \
--to=keescook@chromium.org \
--cc=ben@decadent.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludwig.nussel@suse.de \
--cc=rob@landley.net \
--cc=rubini@gnudd.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome