]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix potential out of bound read in ext4_fc_replay_scan()
authorYe Bin <yebin10@huawei.com>
Sat, 24 Sep 2022 07:52:33 +0000 (15:52 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 1 Oct 2022 03:46:54 +0000 (23:46 -0400)
commit58babec8955a21135d96e0869774a229a87acdbc
treef713c0c592c21bd130b30067132605e428eda5f4
parentc9df516c7f6bcdacd82ed4f57c9201b600f1cddf
ext4: fix potential out of bound read in ext4_fc_replay_scan()

For scan loop must ensure that at least EXT4_FC_TAG_BASE_LEN space. If remain
space less than EXT4_FC_TAG_BASE_LEN which will lead to out of bound read
when mounting corrupt file system image.
ADD_RANGE/HEAD/TAIL is needed to add extra check when do journal scan, as this
three tags will read data during scan, tag length couldn't less than data length
which will read.

Cc: stable@kernel.org
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20220924075233.2315259-4-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/fast_commit.c