linux/fs/f2fs
Jaegeuk Kim 267c159f9c f2fs: fix kernel crash due to null io->bio
We should return when io->bio is null before doing anything. Otherwise, panic.

BUG: kernel NULL pointer dereference, address: 0000000000000010
RIP: 0010:__submit_merged_write_cond+0x164/0x240 [f2fs]
Call Trace:
 <TASK>
 f2fs_submit_merged_write+0x1d/0x30 [f2fs]
 commit_checkpoint+0x110/0x1e0 [f2fs]
 f2fs_write_checkpoint+0x9f7/0xf00 [f2fs]
 ? __pfx_issue_checkpoint_thread+0x10/0x10 [f2fs]
 __checkpoint_and_complete_reqs+0x84/0x190 [f2fs]
 ? preempt_count_add+0x82/0xc0
 ? __pfx_issue_checkpoint_thread+0x10/0x10 [f2fs]
 issue_checkpoint_thread+0x4c/0xf0 [f2fs]
 ? __pfx_autoremove_wake_function+0x10/0x10
 kthread+0xff/0x130
 ? __pfx_kthread+0x10/0x10
 ret_from_fork+0x2c/0x50
 </TASK>

Cc: stable@vger.kernel.org # v5.18+
Fixes: 64bf0eef01 ("f2fs: pass the bio operation to bio_alloc_bioset")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2023-02-07 10:39:28 -08:00
..
acl.c fs: pass dentry to set acl method 2022-10-19 12:55:42 +02:00
acl.h fs: pass dentry to set acl method 2022-10-19 12:55:42 +02:00
checkpoint.c f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info 2023-02-02 13:37:16 -08:00
compress.c f2fs: clean up i_compress_flag and i_compress_level usage 2023-02-02 13:37:17 -08:00
data.c f2fs: fix kernel crash due to null io->bio 2023-02-07 10:39:28 -08:00
debug.c f2fs: fix some format WARNING in debug.c and sysfs.c 2022-12-12 14:59:39 -08:00
dir.c f2fs: merge f2fs_show_injection_info() into time_to_inject() 2023-01-11 11:15:19 -08:00
extent_cache.c f2fs: add sysfs nodes to set last_age_weight 2023-02-07 10:39:19 -08:00
f2fs.h f2fs: add sysfs nodes to set last_age_weight 2023-02-07 10:39:19 -08:00
file.c f2fs: fix to update age extent in f2fs_do_zero_range() 2023-02-02 13:37:17 -08:00
gc.c f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info 2023-02-02 13:37:16 -08:00
gc.h f2fs: convert discard_wake and gc_wake to bool type 2023-01-11 11:15:19 -08:00
hash.c f2fs: don't use casefolded comparison for "." and ".." 2022-05-17 11:19:23 -07:00
inline.c f2fs: fix information leak in f2fs_move_inline_dirents() 2023-01-31 10:47:46 -08:00
inode.c f2fs: retry to update the inode page given data corruption 2023-02-02 13:37:17 -08:00
iostat.c f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx() 2023-02-07 10:39:28 -08:00
iostat.h f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx() 2023-02-07 10:39:28 -08:00
Kconfig f2fs: introduce F2FS_UNFAIR_RWSEM to support unfair rwsem 2022-03-04 09:15:53 -08:00
Makefile f2fs: separate out iostat feature 2021-08-23 10:25:51 -07:00
namei.c f2fs: remove unneeded f2fs_cp_error() in f2fs_create_whiteout() 2023-01-31 10:47:44 -08:00
node.c f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info 2023-02-02 13:37:16 -08:00
node.h f2fs: add block_age-based extent cache 2022-12-12 14:53:56 -08:00
recovery.c f2fs: do some cleanup for f2fs module init 2022-12-08 09:32:20 -08:00
segment.c f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info 2023-02-02 13:37:16 -08:00
segment.h f2fs: add a f2fs_curseg_valid_blocks helper 2023-02-02 13:37:15 -08:00
shrinker.c f2fs: add block_age-based extent cache 2022-12-12 14:53:56 -08:00
super.c f2fs: fix f2fs_show_options to show nogc_merge mount option 2023-02-05 19:38:28 -08:00
sysfs.c f2fs: add sysfs nodes to set last_age_weight 2023-02-07 10:39:19 -08:00
verity.c fs: f2fs: initialize fsdata in pagecache_write() 2023-01-31 10:47:45 -08:00
xattr.c f2fs: support recording errors into superblock 2022-10-04 13:31:45 -07:00
xattr.h f2fs: code cleanup by removing ifdef macro surrounding 2020-05-26 18:56:10 -07:00