Files
linux/fs
Qu Wenruo bf46ed89bf btrfs: tree-checker: fix the incorrect inode ref size check
commit 96fa515e70 upstream.

[BUG]
Inside check_inode_ref(), we need to make sure every structure,
including the btrfs_inode_extref header, is covered by the item.  But
our code is incorrectly using "sizeof(iref)", where @iref is just a
pointer.

This means "sizeof(iref)" will always be "sizeof(void *)", which is much
smaller than "sizeof(struct btrfs_inode_extref)".

This will allow some bad inode extrefs to sneak in, defeating tree-checker.

[FIX]
Fix the typo by calling "sizeof(*iref)", which is the same as
"sizeof(struct btrfs_inode_extref)", and will be the correct behavior we
want.

Fixes: 71bf92a9b8 ("btrfs: tree-checker: Add check for INODE_REF")
CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-25 11:13:46 +02:00
..
2025-06-19 15:32:36 +02:00
2025-07-10 16:05:08 +02:00
2024-10-17 00:28:06 -07:00
2025-01-23 17:22:55 +01:00
2025-08-20 18:30:20 +02:00
2025-03-22 12:54:15 -07:00
2024-12-05 14:02:47 +01:00
2025-07-10 16:05:08 +02:00
2025-01-17 13:40:50 +01:00
2024-09-27 08:18:43 -07:00
2024-09-27 08:18:43 -07:00
2025-06-27 11:11:36 +01:00