]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.12-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Apr 2025 15:00:14 +0000 (16:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Apr 2025 15:00:14 +0000 (16:00 +0100)
added patches:
bcachefs-bch2_ioctl_subvolume_destroy-fixes.patch

queue-6.12/bcachefs-bch2_ioctl_subvolume_destroy-fixes.patch [new file with mode: 0644]
queue-6.12/series

diff --git a/queue-6.12/bcachefs-bch2_ioctl_subvolume_destroy-fixes.patch b/queue-6.12/bcachefs-bch2_ioctl_subvolume_destroy-fixes.patch
new file mode 100644 (file)
index 0000000..83ba729
--- /dev/null
@@ -0,0 +1,38 @@
+From 1a7a2300e0dd8b4a73bcd3777a2947fe42a16bef Mon Sep 17 00:00:00 2001
+From: Kent Overstreet <kent.overstreet@linux.dev>
+Date: Sat, 29 Mar 2025 19:01:09 -0400
+Subject: bcachefs: bch2_ioctl_subvolume_destroy() fixes
+
+From: Kent Overstreet <kent.overstreet@linux.dev>
+
+[ Upstream commit 707549600c4a012ed71c0204a7992a679880bf33 ]
+
+bch2_evict_subvolume_inodes() was getting stuck - due to incorrectly
+pruning the dcache.
+
+Also, fix missing permissions checks.
+
+Reported-by: Alexander Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/bcachefs/fs-ioctl.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/fs/bcachefs/fs-ioctl.c
++++ b/fs/bcachefs/fs-ioctl.c
+@@ -520,10 +520,12 @@ static long bch2_ioctl_subvolume_destroy
+               ret = -ENOENT;
+               goto err;
+       }
+-      ret = __bch2_unlink(dir, victim, true);
++
++      ret =   inode_permission(file_mnt_idmap(filp), d_inode(victim), MAY_WRITE) ?:
++              __bch2_unlink(dir, victim, true);
+       if (!ret) {
+               fsnotify_rmdir(dir, victim);
+-              d_delete(victim);
++              d_invalidate(victim);
+       }
+ err:
+       inode_unlock(dir);
index 8436ce22bc35f5d192479483809f424cdf7e7a9f..857d675b5892d0ae81959a0e5bf25395d9d3f6e7 100644 (file)
@@ -19,3 +19,4 @@ memstick-rtsx_usb_ms-fix-slab-use-after-free-in-rtsx_usb_ms_drv_remove.patch
 perf-tools-fix-up-some-comments-and-code-to-properly-use-the-event_source-bus.patch
 serial-stm32-do-not-deassert-rs485-rts-gpio-prematurely.patch
 serial-8250_dma-terminate-correct-dma-in-tx_dma_flush.patch
+bcachefs-bch2_ioctl_subvolume_destroy-fixes.patch