]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.12-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 2 Nov 2025 12:36:53 +0000 (21:36 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 2 Nov 2025 12:36:53 +0000 (21:36 +0900)
added patches:
btrfs-tree-checker-fix-bounds-check-in-check_inode_extref.patch

queue-6.12/btrfs-tree-checker-fix-bounds-check-in-check_inode_extref.patch [new file with mode: 0644]
queue-6.12/series

diff --git a/queue-6.12/btrfs-tree-checker-fix-bounds-check-in-check_inode_extref.patch b/queue-6.12/btrfs-tree-checker-fix-bounds-check-in-check_inode_extref.patch
new file mode 100644 (file)
index 0000000..273fa43
--- /dev/null
@@ -0,0 +1,33 @@
+From e92c2941204de7b62e9c2deecfeb9eaefe54a22a Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@linaro.org>
+Date: Wed, 8 Oct 2025 18:08:58 +0300
+Subject: btrfs: tree-checker: fix bounds check in check_inode_extref()
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+commit e92c2941204de7b62e9c2deecfeb9eaefe54a22a upstream.
+
+The parentheses for the unlikely() annotation were put in the wrong
+place so it means that the condition is basically never true and the
+bounds checking is skipped.
+
+Fixes: aab9458b9f00 ("btrfs: tree-checker: add inode extref checks")
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Reviewed-by: Qu Wenruo <wqu@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/btrfs/tree-checker.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/btrfs/tree-checker.c
++++ b/fs/btrfs/tree-checker.c
+@@ -1785,7 +1785,7 @@ static int check_inode_extref(struct ext
+               struct btrfs_inode_extref *extref = (struct btrfs_inode_extref *)ptr;
+               u16 namelen;
+-              if (unlikely(ptr + sizeof(*extref)) > end) {
++              if (unlikely(ptr + sizeof(*extref) > end)) {
+                       inode_ref_err(leaf, slot,
+                       "inode extref overflow, ptr %lu end %lu inode_extref size %zu",
+                                     ptr, end, sizeof(*extref));
index 6f93bd1c32e63b13047f368d7164129e16733b4b..f39a51137717900ce3eee952047c79d5bfbc67e8 100644 (file)
@@ -38,3 +38,4 @@ iommu-vt-d-avoid-use-of-null-after-warn_on_once.patch
 wifi-ath12k-fix-read-pointer-after-free-in-ath12k_mac_assign_vif_to_vdev.patch
 udmabuf-fix-a-buf-size-overflow-issue-during-udmabuf-creation.patch
 sfc-fix-null-dereferences-in-ef100_process_design_param.patch
+btrfs-tree-checker-fix-bounds-check-in-check_inode_extref.patch