summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2025-10-08 18:08:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-02 22:18:04 +0900
commitdcc76777c6490c4d40199d0abe0942186d944a51 (patch)
tree06dc4a346698991fd439c17cd40a006419e2f35f
parentbd0a905c223270a3e67136c65eb9d086b84e441b (diff)
downloadlinux-dcc76777c6490c4d40199d0abe0942186d944a51.tar.gz
linux-dcc76777c6490c4d40199d0abe0942186d944a51.tar.bz2
linux-dcc76777c6490c4d40199d0abe0942186d944a51.zip
btrfs: tree-checker: fix bounds check in check_inode_extref()
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>
-rw-r--r--fs/btrfs/tree-checker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index a83e455f813b..30bc8eb28005 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -1797,7 +1797,7 @@ static int check_inode_extref(struct extent_buffer *leaf,
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));