]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: reject inline file extents item in get_new_location()
authorQu Wenruo <wqu@suse.com>
Tue, 23 Jun 2026 11:37:15 +0000 (21:07 +0930)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Jul 2026 05:03:15 +0000 (07:03 +0200)
commit800b51960215417752f6712ce7e384ca49ecff39
treead6d0a01aa0f8fa511a4f75b279f7f78218568db
parentae4316f332e03e628712e9dfb89f2b7d3c70c21a
btrfs: reject inline file extents item in get_new_location()

Commit a6908f88c9da ("btrfs: validate data reloc tree file extent item
members") introduced extra checks on file extent items for data reloc
inodes, but it checked the file extent offset without checking if the file
extent is inlined.

This can lead to either false alerts (as the offset member is inside the
inlined data) or even reading beyond the item range.

This has already triggered a warning in a syzbot report.
Although the root fix is to avoid compression for data reloc inodes, for
the sake of consistency, reject inlined file extents first.

Fixes: a6908f88c9da ("btrfs: validate data reloc tree file extent item members")
CC: stable@vger.kernel.org
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c