Jaegeuk Kim
5d64600d4f
f2fs: avoid bug_on on corrupted inode
syzbot has tested the proposed patch but the reproducer still triggered crash:
kernel BUG at fs/f2fs/inode.c:LINE!
F2FS-fs (loop1): invalid crc value
F2FS-fs (loop5): Magic Mismatch, valid(0xf2f52010) - read(0x0)
F2FS-fs (loop5): Can't find valid F2FS filesystem in 1th superblock
F2FS-fs (loop5): invalid crc value
------------[ cut here ]------------
kernel BUG at fs/f2fs/inode.c:238!
invalid opcode: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 4886 Comm: syz-executor1 Not tainted 4.17.0-rc1+ #1
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:do_read_inode fs/f2fs/inode.c:238 [inline]
RIP: 0010:f2fs_iget+0x3307/0x3ca0 fs/f2fs/inode.c:313
RSP: 0018:ffff8801c44a70e8 EFLAGS: 00010293
RAX: ffff8801ce208040 RBX: ffff8801b3621080 RCX: ffffffff82eace18
F2FS-fs (loop2): Magic Mismatch, valid(0xf2f52010) - read(0x0)
RDX: 0000000000000000 RSI: ffffffff82eaf047 RDI: 0000000000000007
RBP: ffff8801c44a7410 R08: ffff8801ce208040 R09: ffffed0039ee4176
R10: ffffed0039ee4176 R11: ffff8801cf720bb7 R12: ffff8801c0efa000
R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000
FS: 00007f753aa9d700(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
------------[ cut here ]------------
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel BUG at fs/f2fs/inode.c:238!
CR2: 0000000001b03018 CR3: 00000001c8b74000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
f2fs_fill_super+0x4377/0x7bf0 fs/f2fs/super.c:2842
mount_bdev+0x30c/0x3e0 fs/super.c:1165
f2fs_mount+0x34/0x40 fs/f2fs/super.c:3020
mount_fs+0xae/0x328 fs/super.c:1268
vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037
vfs_kern_mount fs/namespace.c:1027 [inline]
do_new_mount fs/namespace.c:2517 [inline]
do_mount+0x564/0x3070 fs/namespace.c:2847
ksys_mount+0x12d/0x140 fs/namespace.c:3063
__do_sys_mount fs/namespace.c:3077 [inline]
__se_sys_mount fs/namespace.c:3074 [inline]
__x64_sys_mount+0xbe/0x150 fs/namespace.c:3074
do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457daa
RSP: 002b:00007f753aa9cba8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 0000000000457daa
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f753aa9cbf0
RBP: 0000000000000064 R08: 0000000020016a00 R09: 0000000020000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000064 R14: 00000000006fcb80 R15: 0000000000000000
RIP: do_read_inode fs/f2fs/inode.c:238 [inline] RSP: ffff8801c44a70e8
RIP: f2fs_iget+0x3307/0x3ca0 fs/f2fs/inode.c:313 RSP: ffff8801c44a70e8
invalid opcode: 0000 [#2] SMP KASAN
---[ end trace 1cbcbec2156680bc ]---
Reported-and-tested-by: syzbot+41a1b341571f0952badb@syzkaller.appspotmail.com
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2018-05-31 11:31:48 -07:00
..
2018-04-07 09:08:24 -07:00
2017-11-27 13:05:09 -08:00
2018-02-01 08:15:25 -05:00
2018-04-20 09:59:33 -07:00
2018-04-20 17:18:35 -07:00
2018-01-15 12:07:54 -08:00
2018-04-22 12:09:27 -07:00
2018-04-06 14:05:14 +01:00
2018-04-23 17:35:19 +02:00
2018-04-25 11:15:58 -05:00
2018-02-11 14:34:03 -08:00
2018-02-08 11:37:31 -08:00
2018-05-02 14:30:57 -07:00
2018-03-29 15:07:47 -04:00
2018-03-14 13:31:23 +01:00
2018-02-12 14:15:04 -05:00
2018-04-16 18:51:22 +00:00
2018-02-22 10:21:02 -08:00
2017-11-27 13:05:09 -08:00
2018-02-07 14:25:22 -08:00
2018-04-12 12:04:49 +02:00
2018-04-20 09:01:26 -07:00
2018-05-02 14:30:57 -07:00
2018-05-31 11:31:48 -07:00
2018-02-01 08:15:25 -05:00
2018-01-15 12:07:57 -08:00
2018-04-11 10:28:39 -07:00
2018-03-23 06:31:37 -04:00
2018-04-12 10:07:51 -07:00
2017-11-27 13:05:09 -08:00
2018-02-06 18:32:45 -08:00
2018-04-02 20:15:53 +02:00
2017-12-10 12:58:18 -08:00
2018-04-05 21:36:21 -07:00
2018-04-16 09:47:41 +02:00
2018-04-18 11:49:31 -04:00
2018-04-15 23:49:05 -04:00
2018-02-03 16:25:42 -08:00
2018-02-11 14:34:03 -08:00
2018-03-27 13:18:09 -04:00
2018-03-26 15:55:57 +02:00
2018-04-12 12:55:50 -07:00
2018-03-27 13:18:09 -04:00
2018-04-03 16:27:08 -04:00
2018-04-11 10:28:39 -07:00
2018-04-13 15:52:49 +02:00
2018-03-28 01:39:02 -04:00
2018-04-06 14:19:26 -07:00
2017-11-27 13:05:09 -08:00
2018-04-15 23:49:12 -04:00
2018-04-12 12:04:50 +02:00
2018-04-20 17:18:36 -07:00
2018-04-06 15:45:33 -07:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2018-04-09 17:48:54 +02:00
2018-04-11 10:28:36 -07:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2018-03-19 21:14:26 -04:00
2017-11-27 13:05:09 -08:00
2018-04-11 16:39:34 -07:00
2018-04-18 16:34:55 +02:00
2018-02-07 14:25:22 -08:00
2018-04-17 19:10:15 -07:00
2018-03-19 10:12:03 -07:00
2018-04-11 10:28:37 -07:00
2018-04-11 10:28:37 -07:00
2018-04-20 17:18:36 -07:00
2018-04-11 10:28:37 -07:00
2018-04-02 20:16:00 +02:00
2018-04-10 10:25:57 -07:00
2018-04-12 12:28:32 -07:00
2018-03-15 17:59:24 +01:00
2017-12-28 11:17:29 -05:00
2017-11-17 11:54:55 -08:00
2018-03-29 15:07:46 -04:00
2018-04-11 10:28:39 -07:00
2018-04-11 10:28:38 -07:00
2018-04-02 20:15:39 +02:00
2018-04-06 14:19:26 -07:00
2018-04-02 20:15:39 +02:00
2018-04-02 20:15:37 +02:00
2018-04-11 10:28:37 -07:00
2018-04-02 20:15:42 +02:00
2018-01-15 12:07:51 -08:00
2017-12-07 14:23:30 -05:00
2018-04-02 20:16:00 +02:00
2018-04-20 17:18:35 -07:00
2018-04-11 10:28:39 -07:00
2018-04-06 11:07:08 -07:00
2018-04-02 20:16:03 +02:00
2018-01-29 07:27:24 -08:00
2018-02-06 10:41:33 -08:00
2018-03-26 15:55:57 +02:00
2018-03-30 11:34:55 -07:00
2018-03-26 11:13:09 +02:00
2018-03-29 15:07:46 -04:00
2018-01-09 23:57:52 -05:00
2018-04-09 12:48:05 -07:00
2018-04-20 09:59:33 -07:00
2018-02-15 15:34:42 -05:00
2018-04-06 11:07:08 -07:00
2018-04-02 20:15:35 +02:00
2018-01-02 19:27:28 -08:00
2018-02-11 14:34:03 -08:00
2018-04-02 20:16:09 +02:00
2018-04-02 20:16:02 +02:00
2018-04-02 20:15:42 +02:00
2018-04-11 10:28:36 -07:00
2018-04-02 20:15:43 +02:00
2018-04-02 20:15:40 +02:00
2018-04-02 20:15:34 +02:00
2017-11-27 13:05:09 -08:00
2018-04-16 02:06:47 -04:00
2018-04-04 12:44:02 -07:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-04-02 20:15:44 +02:00