From: Eric Sandeen <sandeen@redhat.com>
To: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: [PATCH V2] btrfs: fix perms on demonstration debugfs interface
Date: Wed, 31 Aug 2016 16:49:29 -0500 [thread overview]
Message-ID: <13cedfd1-1eb2-6097-6f12-48e387042b9b@redhat.com> (raw)
In-Reply-To: <d6715b5b-0aa3-3032-43c6-eccd907a60b8@redhat.com>
btrfs provides a helpful demonstration of how to export
a global variable via debugfs; however, it is unique among
other debugfs files in that it is world-writable, which causes
some concern to people who are not familiar with its purpose.
Fix it so that it is only user-writable.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 4879656..fb84685 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -834,7 +834,7 @@ static int btrfs_init_debugfs(void)
if (!btrfs_debugfs_root_dentry)
return -ENOMEM;
- debugfs_create_u64("test", S_IRUGO | S_IWUGO, btrfs_debugfs_root_dentry,
+ debugfs_create_u64("test", S_IRUGO | S_IWUSR, btrfs_debugfs_root_dentry,
&btrfs_debugfs_test);
#endif
return 0;
next prev parent reply other threads:[~2016-08-31 21:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-31 15:13 [PATCH] btrfs: remove pointless debugfs interface Eric Sandeen
2016-08-31 19:08 ` David Sterba
2016-08-31 21:38 ` Eric Sandeen
2016-09-01 12:15 ` David Sterba
2016-08-31 22:36 ` Jeff Mahoney
2016-09-01 12:22 ` David Sterba
2016-08-31 21:49 ` Eric Sandeen [this message]
2016-09-01 12:22 ` [PATCH V2] btrfs: fix perms on demonstration " David Sterba
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=13cedfd1-1eb2-6097-6f12-48e387042b9b@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-btrfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).