Skip to contentSkip to conversation

btrfs: BTRFS_IOC_TRANS_START should be privilegued

PATCH New Christoph Hellwig 1 participant 1 message Jun 10, 2008 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: 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.

ioctl.c +3 -0
Index: btrfs-unstable/ioctl.c
===================================================================
@@ -706,6 +706,9 @@ long btrfs_ioctl_trans_start(struct 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;