提交 9db005ed 编写于 作者: C Chao Yu 提交者: Zheng Zengkai

f2fs: fix to avoid accessing invalid fio in f2fs_allocate_data_block()

stable inclusion
from stable-5.10.38
commit b59194c7ca29cbfa29426aadc07ca043437178bc
bugzilla: 51875
CVE: NA

--------------------------------

[ Upstream commit 25ae837e ]

Callers may pass fio parameter with NULL value to f2fs_allocate_data_block(),
so we should make sure accessing fio's field after fio's validation check.

Fixes: f608c38c ("f2fs: clean up parameter of f2fs_allocate_data_block()")
Signed-off-by: NChao Yu <yuchao0@huawei.com>
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 2da24b58
......@@ -3407,12 +3407,12 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
f2fs_inode_chksum_set(sbi, page);
}
if (F2FS_IO_ALIGNED(sbi))
fio->retry = false;
if (fio) {
struct f2fs_bio_info *io;
if (F2FS_IO_ALIGNED(sbi))
fio->retry = false;
INIT_LIST_HEAD(&fio->list);
fio->in_list = true;
io = sbi->write_io[fio->type] + fio->temp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册