syzbot


general protection fault in f2fs_usable_blks_in_seg
Status: upstream: reported C repro on 2020/09/21 08:41
Reported-by: syzbot+978a34b783141d673eda@syzkaller.appspotmail.com
First crash: 615d, last: 614d

Cause bisection: introduced by (bisect log) :
commit de881df97768d07b342cbd1f8359b832afccace9
Author: Aravind Ramesh <aravind.ramesh@wdc.com>
Date: Thu Jul 16 12:56:56 2020 +0000

  f2fs: support zone capacity less than zone size

Crash: BUG: unable to handle kernel NULL pointer dereference in f2fs_usable_zone_blks_in_seg (log)
Repro: C syz .config

Sample crash report:
F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x0)
F2FS-fs (loop0): Can't find valid F2FS filesystem in 2th superblock
F2FS-fs (loop0): invalid crc_offset: 0
general protection fault, probably for non-canonical address 0xdffffc0000000009: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000048-0x000000000000004f]
CPU: 1 PID: 6861 Comm: syz-executor912 Not tainted 5.9.0-rc5-next-20200918-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:get_zone_idx fs/f2fs/segment.c:4892 [inline]
RIP: 0010:f2fs_usable_zone_blks_in_seg fs/f2fs/segment.c:4943 [inline]
RIP: 0010:f2fs_usable_blks_in_seg+0x39b/0xa00 fs/f2fs/segment.c:4999
Code: 05 00 00 49 63 d6 4c 8b 83 40 14 00 00 48 6b d2 68 49 8d 04 10 48 ba 00 00 00 00 00 fc ff df 48 8d 78 4c 48 89 fe 48 c1 ee 03 <0f> b6 34 16 48 89 fa 83 e2 07 83 c2 03 40 38 f2 7c 09 40 84 f6 0f
RSP: 0018:ffffc90000ef78b0 EFLAGS: 00010207
RAX: 0000000000000000 RBX: ffff88809632c000 RCX: 0000000000000e00
RDX: dffffc0000000000 RSI: 0000000000000009 RDI: 000000000000004c
RBP: 0000000000001000 R08: 0000000000000000 R09: ffffc90000ef7a81
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000200
R13: ffff88809632c010 R14: 0000000000000000 R15: ffff88809632d440
FS:  0000000002206880(0000) GS:ffff8880ae500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffea055b000 CR3: 000000009486b000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 check_block_count+0x69/0x4e0 fs/f2fs/segment.h:704
 build_sit_entries fs/f2fs/segment.c:4403 [inline]
 f2fs_build_segment_manager+0x51da/0xa370 fs/f2fs/segment.c:5100
 f2fs_fill_super+0x3880/0x6ff0 fs/f2fs/super.c:3684
 mount_bdev+0x32e/0x3f0 fs/super.c:1417
 legacy_get_tree+0x105/0x220 fs/fs_context.c:592
 vfs_get_tree+0x89/0x2f0 fs/super.c:1547
 do_new_mount fs/namespace.c:2896 [inline]
 path_mount+0x12ae/0x1e70 fs/namespace.c:3216
 do_mount fs/namespace.c:3229 [inline]
 __do_sys_mount fs/namespace.c:3437 [inline]
 __se_sys_mount fs/namespace.c:3414 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3414
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x44793a
Code: b8 08 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 fd ad fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 da ad fb ff c3 66 0f 1f 84 00 00 00 00 00
RSP: 002b:00007ffea055a198 EFLAGS: 00000297 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffea055a1f0 RCX: 000000000044793a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffea055a1b0
RBP: 00007ffea055a1b0 R08: 00007ffea055a1f0 R09: 00007ffe00000015
R10: 0000000000000000 R11: 0000000000000297 R12: 000000000000004a
R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003
Modules linked in:
---[ end trace 49ea7ada353f1c96 ]---
RIP: 0010:get_zone_idx fs/f2fs/segment.c:4892 [inline]
RIP: 0010:f2fs_usable_zone_blks_in_seg fs/f2fs/segment.c:4943 [inline]
RIP: 0010:f2fs_usable_blks_in_seg+0x39b/0xa00 fs/f2fs/segment.c:4999
Code: 05 00 00 49 63 d6 4c 8b 83 40 14 00 00 48 6b d2 68 49 8d 04 10 48 ba 00 00 00 00 00 fc ff df 48 8d 78 4c 48 89 fe 48 c1 ee 03 <0f> b6 34 16 48 89 fa 83 e2 07 83 c2 03 40 38 f2 7c 09 40 84 f6 0f
RSP: 0018:ffffc90000ef78b0 EFLAGS: 00010207
RAX: 0000000000000000 RBX: ffff88809632c000 RCX: 0000000000000e00
RDX: dffffc0000000000 RSI: 0000000000000009 RDI: 000000000000004c
RBP: 0000000000001000 R08: 0000000000000000 R09: ffffc90000ef7a81
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000200
R13: ffff88809632c010 R14: 0000000000000000 R15: ffff88809632d440
FS:  0000000002206880(0000) GS:ffff8880ae500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffea055b000 CR3: 000000009486b000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (41):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-linux-next-kasan-gce-root 2020/09/21 00:59 linux-next b652d2a5f2a4 9564d2e9 .config log report syz C
ci-upstream-linux-next-kasan-gce-root 2020/09/21 17:04 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 16:26 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 16:26 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 16:17 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:34 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:34 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:34 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:17 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:17 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:15 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:10 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:08 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:08 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:02 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 11:00 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 10:52 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 10:49 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 10:42 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 10:34 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/21 10:32 linux-next b10b8ad86211 9e1fa68e .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 18:44 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 18:42 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 15:04 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:34 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:34 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:34 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:33 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:32 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:27 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:23 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:23 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:21 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:20 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:18 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:15 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:07 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:05 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 14:03 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 13:55 linux-next b652d2a5f2a4 9564d2e9 .config log report info
ci-upstream-linux-next-kasan-gce-root 2020/09/20 13:48 linux-next b652d2a5f2a4 9564d2e9 .config log report info