Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df5b5520 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Chris Mason
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent f46b5a66
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -706,6 +706,9 @@ long btrfs_ioctl_trans_start(struct file *file)
	struct btrfs_trans_handle *trans;
	int ret = 0;

	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;

	mutex_lock(&root->fs_info->fs_mutex);
	if (file->private_data) {
		ret = -EINPROGRESS;