Commit 154467f4 authored by Abinash Singh's avatar Abinash Singh Committed by Jaegeuk Kim
Browse files

f2fs: fix KMSAN uninit-value in extent_info usage



KMSAN reported a use of uninitialized value in `__is_extent_mergeable()`
 and `__is_back_mergeable()` via the read extent tree path.

The root cause is that `get_read_extent_info()` only initializes three
fields (`fofs`, `blk`, `len`) of `struct extent_info`, leaving the
remaining fields uninitialized. This leads to undefined behavior
when those fields are accessed later, especially during
extent merging.

Fix it by zero-initializing the `extent_info` struct before population.

Reported-by: default avatar <syzbot+b8c1d60e95df65e827d4@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=b8c1d60e95df65e827d4


Fixes: 94afd6d6 ("f2fs: extent cache: support unaligned extent")
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarAbinash Singh <abinashsinghlalotra@gmail.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 90c5ce37
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment