diff options
| author | Qu Wenruo <[email protected]> | 2025-09-15 22:24:06 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2025-09-18 03:47:25 +0000 |
| commit | 96fa515e70f3e4b98685ef8cac9d737fc62f10e1 (patch) | |
| tree | c99c29e4626afdf0f44d2aece53bf97c81bbf7bd /fs/file_table.c | |
| parent | btrfs: annotate block group access with data_race() when sorting for reclaim (diff) | |
| download | kernel-96fa515e70f3e4b98685ef8cac9d737fc62f10e1.tar.gz kernel-96fa515e70f3e4b98685ef8cac9d737fc62f10e1.zip | |
btrfs: tree-checker: fix the incorrect inode ref size check
[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: 71bf92a9b877 ("btrfs: tree-checker: Add check for INODE_REF")
CC: [email protected] # 6.1+
Reviewed-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Filipe Manana <[email protected]>
Signed-off-by: Qu Wenruo <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/file_table.c')
0 files changed, 0 insertions, 0 deletions
