提交 df5b5520 编写于 作者: C Christoph Hellwig 提交者: Chris Mason

BTRFS_IOC_TRANS_START should be privilegued

As mentioned in the comment next to it btrfs_ioctl_trans_start can
do bad damage to filesystems and thus should be limited to privilegued
users.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 f46b5a66
...@@ -706,6 +706,9 @@ long btrfs_ioctl_trans_start(struct file *file) ...@@ -706,6 +706,9 @@ long btrfs_ioctl_trans_start(struct file *file)
struct btrfs_trans_handle *trans; struct btrfs_trans_handle *trans;
int ret = 0; int ret = 0;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
mutex_lock(&root->fs_info->fs_mutex); mutex_lock(&root->fs_info->fs_mutex);
if (file->private_data) { if (file->private_data) {
ret = -EINPROGRESS; ret = -EINPROGRESS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册