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

Commit 16780cab authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: add extra sanity checks on the path names in btrfs_mksubvol

parent a6b0d5c8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1333,6 +1333,12 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
		goto out;
	}

	if (name[0] == '.' &&
	   (namelen == 1 || (name[1] == '.' && namelen == 2))) {
		ret = -EEXIST;
		goto out;
	}

	if (subvol) {
		ret = btrfs_mksubvol(&file->f_path, name, namelen,
				     NULL, transid, readonly);