Commit 5909bed
f2fs: protect extension_list reading with sb_lock in f2fs_sbi_show()
In f2fs_sbi_show(), the extension_list, extension_count and
hot_ext_count are read without holding sbi->sb_lock. If a concurrent
sysfs store modifies the extension list via f2fs_update_extension_list(),
the show path may read inconsistent count and array contents, potentially
leading to out-of-bounds access or displaying stale data.
Fix this by holding sb_lock around the entire extension list read
and format operation.
Fixes: b6a06cb ("f2fs: support hot file extension")
Signed-off-by: Yongpeng Yang <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>1 parent b8b902f commit 5909bed
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
391 | | - | |
| 390 | + | |
392 | 391 | | |
393 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
394 | 396 | | |
395 | 397 | | |
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
399 | 401 | | |
400 | 402 | | |
| 403 | + | |
401 | 404 | | |
402 | 405 | | |
403 | 406 | | |
| |||
0 commit comments