diff options
| author | Kyle Zeng <kylebot@openai.com> | 2026-06-11 14:21:10 -0700 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-09-14 13:58:29 +0200 |
| commit | 78ea2058abf3ee053c0bd9c1b9a77304cb4ae58b (patch) | |
| tree | 2f824d19a0b02a656e1899500285120b53401d80 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | 194164a843397a4584c5fa682f9f3e5b2740132c (diff) | |
| download | linux-78ea2058abf3ee053c0bd9c1b9a77304cb4ae58b.tar.gz linux-78ea2058abf3ee053c0bd9c1b9a77304cb4ae58b.zip | |
affs: validate blocks before freeing them
affs_free_block() accepts block numbers from on-disk file block tables
when truncating or unlinking files. The function currently rejects only
block numbers greater than s_partition_size before subtracting
s_reserved and using the result to index the in-memory bitmap descriptor
array.
That check still accepts reserved blocks and the one-past-end block at
s_partition_size. A crafted image can therefore make the subtraction
underflow or make the computed bitmap index equal to s_bmap_count,
leading to an out-of-bounds access on s_bitmap before the bitmap block is
read and updated.
Use the existing AFFS block validity helper so freeing uses the same
range as block reads and writes: s_reserved <= block < s_partition_size.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
CC: stable@vger.kernel.org
Assisted-by: Codex:gpt-5.5
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
