android_kernel_motorola_sm6375/fs/f2fs
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jaegeuk Kim 4c7f9d9f28 f2fs: handle errors of f2fs_get_meta_page_nofail
First problem is we hit BUG_ON() in f2fs_get_sum_page given EIO on
f2fs_get_meta_page_nofail().

Quick fix was not to give any error with infinite loop, but syzbot caught
a case where it goes to that loop from fuzzed image. In turned out we abused
f2fs_get_meta_page_nofail() like in the below call stack.

- f2fs_fill_super
 - f2fs_build_segment_manager
  - build_sit_entries
   - get_current_sit_page

INFO: task syz-executor178:6870 can't die for more than 143 seconds.
task:syz-executor178 state:R
 stack:26960 pid: 6870 ppid:  6869 flags:0x00004006
Call Trace:

Showing all locks held in the system:
1 lock held by khungtaskd/1179:
 #0: ffffffff8a554da0 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6242
1 lock held by systemd-journal/3920:
1 lock held by in:imklog/6769:
 #0: ffff88809eebc130 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe9/0x100 fs/file.c:930
1 lock held by syz-executor178/6870:
 #0: ffff8880925120e0 (&type->s_umount_key#47/1){+.+.}-{3:3}, at: alloc_super+0x201/0xaf0 fs/super.c:229

Actually, we didn't have to use _nofail in this case, since we could return
error to mount(2) already with the error handler.

As a result, this patch tries to 1) remove _nofail callers as much as possible,
2) deal with error case in last remaining caller, f2fs_get_sum_page().

Change-Id: I886e51597190332553b6a6bbd9fa474f4995bac6
Reported-by: [email protected]
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
Git-commit: 86f33603f8c51537265ff7ac0320638fd2cbdb1b
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux.git/
Signed-off-by: Sayali Lokhande <[email protected]>
2020-10-15 11:12:42 +05:30
..
acl.c
acl.h f2fs: Use the correct style for SPDX License Identifier 2020-05-18 13:21:15 -07:00
checkpoint.c f2fs: handle errors of f2fs_get_meta_page_nofail 2020-10-15 11:12:42 +05:30
compress.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable 2020-06-15 13:22:44 -07:00
data.c Merge android-5.4-stable.50 (a200ad5) into msm-5.4 2020-07-20 19:22:16 -07:00
debug.c UPSTREAM: Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4 (v5.7-rc1) 2020-04-15 03:11:03 +00:00
dir.c f2fs: avoid utf8_strncasecmp() with unstable name 2020-06-08 20:40:23 -07:00
extent_cache.c
f2fs.h f2fs: handle errors of f2fs_get_meta_page_nofail 2020-10-15 11:12:42 +05:30
file.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable 2020-06-15 13:22:44 -07:00
gc.c f2fs: add compressed/gc data read IO stat 2020-05-18 13:21:19 -07:00
gc.h f2fs: Use the correct style for SPDX License Identifier 2020-05-18 13:21:15 -07:00
hash.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable 2020-05-27 13:35:01 -07:00
inline.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable 2020-05-27 13:35:01 -07:00
inode.c UPSTREAM: Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4 (v5.7-rc1) 2020-04-15 03:11:03 +00:00
Kconfig f2fs: compress: support lzo-rle compress algorithm 2020-05-18 13:21:16 -07:00
Makefile
namei.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable 2020-06-15 13:22:44 -07:00
node.c f2fs: handle errors of f2fs_get_meta_page_nofail 2020-10-15 11:12:42 +05:30
node.h f2fs: shrink spinlock coverage 2020-05-18 13:21:16 -07:00
recovery.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable 2020-05-27 13:35:01 -07:00
segment.c f2fs: handle errors of f2fs_get_meta_page_nofail 2020-10-15 11:12:42 +05:30
segment.h f2fs: Use the correct style for SPDX License Identifier 2020-05-18 13:21:15 -07:00
shrinker.c UPSTREAM: Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4 (v5.7-rc1) 2020-04-15 03:11:03 +00:00
super.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable 2020-06-22 13:32:36 -07:00
sysfs.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable 2020-06-22 13:32:36 -07:00
trace.c
trace.h f2fs: Use the correct style for SPDX License Identifier 2020-05-18 13:21:15 -07:00
verity.c
xattr.c ANDROID: remove unused variable 2020-05-27 13:20:29 -07:00
xattr.h f2fs: code cleanup by removing ifdef macro surrounding 2020-05-30 08:50:10 -07:00