Skip to content

Commit 800101f

Browse files
Dan Carpentergregkh
authored andcommitted
btrfs: tree-checker: fix bounds check in check_inode_extref()
commit e92c294 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: aab9458 ("btrfs: tree-checker: add inode extref checks") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f21623b commit 800101f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/tree-checker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ static int check_inode_extref(struct extent_buffer *leaf,
17851785
struct btrfs_inode_extref *extref = (struct btrfs_inode_extref *)ptr;
17861786
u16 namelen;
17871787

1788-
if (unlikely(ptr + sizeof(*extref)) > end) {
1788+
if (unlikely(ptr + sizeof(*extref) > end)) {
17891789
inode_ref_err(leaf, slot,
17901790
"inode extref overflow, ptr %lu end %lu inode_extref size %zu",
17911791
ptr, end, sizeof(*extref));

0 commit comments

Comments
 (0)