linux/fs/f2fs
Chao Yu 95978caa13 f2fs: fix to avoid use-after-free in f2fs_write_multi_pages()
In compress cluster, if physical block number is less than logic
page number, race condition will cause use-after-free issue as
described below:

- f2fs_write_compressed_pages
 - fio.page = cic->rpages[0];
 - f2fs_outplace_write_data
					- f2fs_compress_write_end_io
					 - kfree(cic->rpages);
					 - kfree(cic);
 - fio.page = cic->rpages[1];

f2fs_write_multi_pages+0xfd0/0x1a98
f2fs_write_data_pages+0x74c/0xb5c
do_writepages+0x64/0x108
__writeback_single_inode+0xdc/0x4b8
writeback_sb_inodes+0x4d0/0xa68
__writeback_inodes_wb+0x88/0x178
wb_writeback+0x1f0/0x424
wb_workfn+0x2f4/0x574
process_one_work+0x210/0x48c
worker_thread+0x2e8/0x44c
kthread+0x110/0x120
ret_from_fork+0x10/0x18

Fixes: 4c8ff7095b ("f2fs: support data compression")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-03-10 09:18:33 -07:00
..
acl.c f2fs: Replace spaces with tab 2019-05-08 21:23:11 -07:00
acl.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
checkpoint.c f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
compress.c f2fs: fix to avoid use-after-free in f2fs_write_multi_pages() 2020-03-10 09:18:33 -07:00
data.c f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
debug.c f2fs: Add f2fs stats to sysfs 2020-01-23 09:24:25 -08:00
dir.c f2fs-for-5.6 2020-01-30 15:39:24 -08:00
extent_cache.c f2fs: introduce f2fs_<level> macros to wrap f2fs_printk() 2019-07-02 15:40:40 -07:00
f2fs.h f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
file.c f2fs: fix to avoid using uninitialized variable 2020-03-10 09:18:33 -07:00
gc.c f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
gc.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
hash.c f2fs: Support case-insensitive file name lookups 2019-08-23 07:57:13 -07:00
inline.c f2fs: convert inline_dir early before starting rename 2020-01-17 16:48:42 -08:00
inode.c f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
Kconfig f2fs-for-5.6 2020-01-30 15:39:24 -08:00
Makefile f2fs: support data compression 2020-01-17 16:48:07 -08:00
namei.c f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
node.c f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
node.h f2fs: check PageWriteback flag for ordered case 2018-12-26 15:16:56 -08:00
recovery.c f2fs: Check write pointer consistency of open zones 2020-01-15 13:42:14 -08:00
segment.c f2fs: change to use rwsem for gc_mutex 2020-01-17 16:48:44 -08:00
segment.h f2fs: update f2fs document regarding to fsync_mode 2020-01-17 16:48:44 -08:00
shrinker.c f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
super.c f2fs: fix inconsistent comments 2020-03-10 09:18:33 -07:00
sysfs.c f2fs: Add f2fs stats to sysfs 2020-01-23 09:24:25 -08:00
trace.c f2fs: do not use mutex lock in atomic context 2019-03-05 19:58:06 -08:00
trace.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
verity.c fs-verity: implement readahead of Merkle tree pages 2020-01-14 13:27:32 -08:00
xattr.c f2fs: remove i_sem lock coverage in f2fs_setxattr() 2020-03-10 09:18:32 -07:00
xattr.h f2fs: add fs-verity support 2019-08-12 19:33:51 -07:00