From: Greg Kroah-Hartman Date: Sun, 18 Feb 2024 09:40:51 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.19.307~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7f18900f1bfb61920fe179c28738881d59cb4cb;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: btrfs-forbid-creating-subvol-qgroups.patch btrfs-send-return-eopnotsupp-on-unknown-flags.patch --- diff --git a/queue-4.19/btrfs-forbid-creating-subvol-qgroups.patch b/queue-4.19/btrfs-forbid-creating-subvol-qgroups.patch new file mode 100644 index 00000000000..b3e4464b74a --- /dev/null +++ b/queue-4.19/btrfs-forbid-creating-subvol-qgroups.patch @@ -0,0 +1,40 @@ +From 0c309d66dacddf8ce939b891d9ead4a8e21ad6f0 Mon Sep 17 00:00:00 2001 +From: Boris Burkov +Date: Wed, 10 Jan 2024 17:51:26 -0800 +Subject: btrfs: forbid creating subvol qgroups + +From: Boris Burkov + +commit 0c309d66dacddf8ce939b891d9ead4a8e21ad6f0 upstream. + +Creating a qgroup 0/subvolid leads to various races and it isn't +helpful, because you can't specify a subvol id when creating a subvol, +so you can't be sure it will be the right one. Any requirements on the +automatic subvol can be gratified by using a higher level qgroup and the +inheritance parameters of subvol creation. + +Fixes: cecbb533b5fc ("btrfs: record simple quota deltas in delayed refs") +CC: stable@vger.kernel.org # 4.14+ +Reviewed-by: Qu Wenruo +Signed-off-by: Boris Burkov +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/ioctl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/fs/btrfs/ioctl.c ++++ b/fs/btrfs/ioctl.c +@@ -5343,6 +5343,11 @@ static long btrfs_ioctl_qgroup_create(st + goto out; + } + ++ if (sa->create && is_fstree(sa->qgroupid)) { ++ ret = -EINVAL; ++ goto out; ++ } ++ + trans = btrfs_join_transaction(root); + if (IS_ERR(trans)) { + ret = PTR_ERR(trans); diff --git a/queue-4.19/btrfs-send-return-eopnotsupp-on-unknown-flags.patch b/queue-4.19/btrfs-send-return-eopnotsupp-on-unknown-flags.patch new file mode 100644 index 00000000000..32117c6cd0c --- /dev/null +++ b/queue-4.19/btrfs-send-return-eopnotsupp-on-unknown-flags.patch @@ -0,0 +1,35 @@ +From f884a9f9e59206a2d41f265e7e403f080d10b493 Mon Sep 17 00:00:00 2001 +From: David Sterba +Date: Wed, 10 Jan 2024 17:48:44 +0100 +Subject: btrfs: send: return EOPNOTSUPP on unknown flags + +From: David Sterba + +commit f884a9f9e59206a2d41f265e7e403f080d10b493 upstream. + +When some ioctl flags are checked we return EOPNOTSUPP, like for +BTRFS_SCRUB_SUPPORTED_FLAGS, BTRFS_SUBVOL_CREATE_ARGS_MASK or fallocate +modes. The EINVAL is supposed to be for a supported but invalid +values or combination of options. Fix that when checking send flags so +it's consistent with the rest. + +CC: stable@vger.kernel.org # 4.14+ +Link: https://lore.kernel.org/linux-btrfs/CAL3q7H5rryOLzp3EKq8RTbjMHMHeaJubfpsVLF6H4qJnKCUR1w@mail.gmail.com/ +Reviewed-by: Filipe Manana +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/send.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/btrfs/send.c ++++ b/fs/btrfs/send.c +@@ -6842,7 +6842,7 @@ long btrfs_ioctl_send(struct file *mnt_f + } + + if (arg->flags & ~BTRFS_SEND_FLAG_MASK) { +- ret = -EINVAL; ++ ret = -EOPNOTSUPP; + goto out; + } + diff --git a/queue-4.19/series b/queue-4.19/series index 2f7a1e0cabb..f7a532078fd 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -162,3 +162,5 @@ usb-serial-cp210x-add-id-for-imst-im871a-usb.patch input-atkbd-skip-atkbd_cmd_setleds-when-skipping-atkbd_cmd_getid.patch vhost-use-kzalloc-instead-of-kmalloc-followed-by-memset.patch hrtimer-report-offline-hrtimer-enqueue.patch +btrfs-forbid-creating-subvol-qgroups.patch +btrfs-send-return-eopnotsupp-on-unknown-flags.patch