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

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

diff --git a/queue-6.17/btrfs-tree-checker-fix-bounds-check-in-check_inode_extref.patch b/queue-6.17/btrfs-tree-checker-fix-bounds-check-in-check_inode_extref.patch
new file mode 100644 (file)
index 0000000..e2d4839
--- /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
+@@ -1797,7 +1797,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 53e89009d8e5ea0ffffce56653295438685e1fcd..552a158f502a0e730cc486a7ba09ce7b3addbf43 100644 (file)
@@ -32,3 +32,4 @@ btrfs-tree-checker-add-inode-extref-checks.patch
 btrfs-use-smp_mb__after_atomic-when-forcing-cow-in-c.patch
 sched_ext-make-qmap-dump-operation-non-destructive.patch
 arch-add-the-macro-compile_offsets-to-all-the-asm-of.patch
+btrfs-tree-checker-fix-bounds-check-in-check_inode_extref.patch