From: Eric Biggers <ebiggers@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH 3/3] f2fs: add missing authorization check in FS_IOC_SETFSLABEL
Date: Thu, 15 Aug 2019 22:55:39 -0700 [thread overview]
Message-ID: <20190816055539.30420-4-ebiggers@kernel.org> (raw)
In-Reply-To: <20190816055539.30420-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
FS_IOC_SETFSLABEL modifies the filesystem superblock, so it shouldn't be
allowed to regular users. Require CAP_SYS_ADMIN, like xfs and btrfs do.
Fixes: 61a3da4d5ef8 ("f2fs: support FS_IOC_{GET,SET}FSLABEL")
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
fs/f2fs/file.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 315127251bc1..6939cddc542a 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -3113,6 +3113,9 @@ static int f2fs_set_volume_name(struct file *filp, unsigned long arg)
char *vbuf;
int err = 0;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+
vbuf = strndup_user((const char __user *)arg, FSLABEL_MAX);
if (IS_ERR(vbuf))
return PTR_ERR(vbuf);
--
2.22.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2019-08-16 5:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-16 5:55 [f2fs-dev] [PATCH 0/3] f2fs: fixes for FS_IOC_{GET,SET}FSLABEL Eric Biggers
2019-08-16 5:55 ` [f2fs-dev] [PATCH 1/3] f2fs: fix buffer overruns in FS_IOC_{GET, SET}FSLABEL Eric Biggers
2019-08-16 6:50 ` Chao Yu
2019-08-16 5:55 ` [f2fs-dev] [PATCH 2/3] f2fs: fix copying too many bytes in FS_IOC_SETFSLABEL Eric Biggers
2019-08-16 6:59 ` Chao Yu
2019-08-18 15:41 ` Eric Biggers
2019-08-19 1:33 ` Chao Yu
2019-08-19 1:58 ` Chao Yu
2019-08-19 2:55 ` Eric Biggers
2019-08-19 3:24 ` Chao Yu
2019-08-16 5:55 ` Eric Biggers [this message]
2019-08-16 7:00 ` [f2fs-dev] [PATCH 3/3] f2fs: add missing authorization check " Chao Yu
2019-08-16 6:49 ` [f2fs-dev] [PATCH 0/3] f2fs: fixes for FS_IOC_{GET,SET}FSLABEL Chao Yu
2019-08-18 13:03 ` Chao Yu
2019-08-18 15:42 ` Eric Biggers
2019-08-19 3:03 ` Jaegeuk Kim
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=20190816055539.30420-4-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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).