diff options
| author | Kaixuan Li <kaixuanli0131@gmail.com> | 2026-09-19 00:55:07 +0800 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2026-10-13 18:45:03 +0000 |
| commit | 9c4ee79190c8c23a9fb5c07d3bc87eaac514b2bb (patch) | |
| tree | 8a63231415ed943946632ac102596e042e1fe070 /tools/lib/python/__init__.py | |
| parent | c04f209773ecb31e592cababce0d6658ee0b8d58 (diff) | |
f2fs: check every cur_*_segno[] entry on readonly images
sanity_check_ckpt() bounds-checks cur_node_segno[] and cur_data_segno[]
against main_segs, but on an image with the RO feature the goto that skips
the duplicate-segno cross-checks also leaves the enclosing loop, so only
index 0 of each array is ever checked.
An unchecked index reaches __set_sit_entry_type() through build_curseg() ->
reset_curseg(), which writes se->type through &sit_i->sentries[segno]. With
segment_count_main 120 and cur_data_segno[1] set to 200, KASAN reports
three out-of-bounds writes during mount and the mount then succeeds.
Use continue so every index is bounds-checked, and skip the node-vs-data
cross-check explicitly, which is the other thing the old goto skipped.
Cc: stable@kernel.org
Fixes: a7d9fe3c3388 ("f2fs: support RO feature")
Signed-off-by: Kaixuan Li <kaixuanli0131@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'tools/lib/python/__init__.py')
0 files changed, 0 insertions, 0 deletions
