syzbot


general protection fault in blk_mq_free_rqs
Status: upstream: reported C repro on 2022/02/10 19:17
Reported-by: syzbot+7295389ef2000630244b@syzkaller.appspotmail.com
First crash: 110d, last: 17d

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: WARNING in kernfs_remove_by_name_ns (log)
Repro: C syz .config

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 3605 Comm: syz-executor139 Not tainted 5.17.0-rc2-syzkaller-00353-g90c9e950c0de #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:blk_mq_clear_rq_mapping block/blk-mq.c:3061 [inline]
RIP: 0010:blk_mq_free_rqs+0x399/0x910 block/blk-mq.c:3106
Code: de e8 8b 83 ac fd 83 fb 3f 0f 87 04 c3 49 05 e8 5d 81 ac fd b8 00 10 00 00 89 d9 48 d3 e0 4c 01 e8 48 89 44 24 08 48 8b 04 24 <0f> b6 00 84 c0 74 08 3c 03 0f 8e bb 03 00 00 41 8b 1f 31 ff 31 ed
RSP: 0018:ffffc900027afaf8 EFLAGS: 00010286
RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000004
RDX: ffff888074ef3a00 RSI: ffffffff83cbf733 RDI: 0000000000000003
RBP: ffff888071ce6000 R08: 000000000000003f R09: ffffffff8ffbf99f
R10: ffffffff83cbf725 R11: 0000000000000246 R12: dffffc0000000000
R13: ffff88801a380000 R14: ffff88801a23f000 R15: 0000000000000000
FS:  00007f894cb64700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f894cc20aa3 CR3: 0000000021f45000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 blk_mq_sched_free_rqs block/blk-mq-sched.c:629 [inline]
 blk_mq_sched_free_rqs+0x16c/0x270 block/blk-mq-sched.c:618
 elevator_switch_mq+0xed/0x720 block/elevator.c:600
 blk_mq_elv_switch_none block/blk-mq.c:4445 [inline]
 __blk_mq_update_nr_hw_queues block/blk-mq.c:4498 [inline]
 blk_mq_update_nr_hw_queues+0x3f1/0xd30 block/blk-mq.c:4548
 nbd_start_device+0x157/0xd10 drivers/block/nbd.c:1347
 nbd_start_device_ioctl drivers/block/nbd.c:1397 [inline]
 __nbd_ioctl drivers/block/nbd.c:1471 [inline]
 nbd_ioctl+0x5f3/0xb10 drivers/block/nbd.c:1511
 blkdev_ioctl+0x37a/0x800 block/ioctl.c:588
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f894cbb7349
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f894cb642e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f894cc3c4e0 RCX: 00007f894cbb7349
RDX: 0000000000000000 RSI: 000000000000ab03 RDI: 0000000000000007
RBP: 00007f894cc091ac R08: 0000000000000002 R09: 0000000000003331
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f894cc3c4ec
R13: 00007f894cb642f0 R14: 00007f894cc3c4e8 R15: 0000000000000002
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:blk_mq_clear_rq_mapping block/blk-mq.c:3061 [inline]
RIP: 0010:blk_mq_free_rqs+0x399/0x910 block/blk-mq.c:3106
Code: de e8 8b 83 ac fd 83 fb 3f 0f 87 04 c3 49 05 e8 5d 81 ac fd b8 00 10 00 00 89 d9 48 d3 e0 4c 01 e8 48 89 44 24 08 48 8b 04 24 <0f> b6 00 84 c0 74 08 3c 03 0f 8e bb 03 00 00 41 8b 1f 31 ff 31 ed
RSP: 0018:ffffc900027afaf8 EFLAGS: 00010286
RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000004
RDX: ffff888074ef3a00 RSI: ffffffff83cbf733 RDI: 0000000000000003
RBP: ffff888071ce6000 R08: 000000000000003f R09: ffffffff8ffbf99f
R10: ffffffff83cbf725 R11: 0000000000000246 R12: dffffc0000000000
R13: ffff88801a380000 R14: ffff88801a23f000 R15: 0000000000000000
FS:  00007f894cb64700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f894cc20aa3 CR3: 0000000021f45000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	e8 8b 83 ac fd       	callq  0xfdac8390
   5:	83 fb 3f             	cmp    $0x3f,%ebx
   8:	0f 87 04 c3 49 05    	ja     0x549c312
   e:	e8 5d 81 ac fd       	callq  0xfdac8170
  13:	b8 00 10 00 00       	mov    $0x1000,%eax
  18:	89 d9                	mov    %ebx,%ecx
  1a:	48 d3 e0             	shl    %cl,%rax
  1d:	4c 01 e8             	add    %r13,%rax
  20:	48 89 44 24 08       	mov    %rax,0x8(%rsp)
  25:	48 8b 04 24          	mov    (%rsp),%rax
* 29:	0f b6 00             	movzbl (%rax),%eax <-- trapping instruction
  2c:	84 c0                	test   %al,%al
  2e:	74 08                	je     0x38
  30:	3c 03                	cmp    $0x3,%al
  32:	0f 8e bb 03 00 00    	jle    0x3f3
  38:	41 8b 1f             	mov    (%r15),%ebx
  3b:	31 ff                	xor    %edi,%edi
  3d:	31 ed                	xor    %ebp,%ebp

Fix bisection attempts:
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/05/10 14:01 upstream 9be9ed2612b5 a7dab638 .config log report syz C
ci-upstream-kasan-gce-root 2022/04/10 03:48 upstream e1f700ebd6be a7dab638 .config log report syz C
ci-upstream-kasan-gce-root 2022/03/11 03:30 upstream dda64ead7e82 a7dab638 .config log report syz C
Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/02/06 19:27 upstream 90c9e950c0de a7dab638 .config log report syz C general protection fault in blk_mq_free_rqs
ci-upstream-kasan-gce-root 2022/02/09 03:11 upstream e6251ab4551f 0b33604d .config log report info general protection fault in blk_mq_free_rqs
ci-upstream-kasan-gce-root 2022/02/06 19:11 upstream 90c9e950c0de a7dab638 .config log report info general protection fault in blk_mq_free_rqs