Skip to content

Commit dcc7677

Browse files
Dan Carpentergregkh
authored andcommitted
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 <[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 bd0a905 commit dcc7677

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/btrfs/tree-checker.c

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

1800-
if (unlikely(ptr + sizeof(*extref)) > end) {
1800+
if (unlikely(ptr + sizeof(*extref) > end)) {
18011801
inode_ref_err(leaf, slot,
18021802
"inode extref overflow, ptr %lu end %lu inode_extref size %zu",
18031803
ptr, end, sizeof(*extref));

0 commit comments

Comments
 (0)