syzbot


general protection fault in blk_mq_update_nr_hw_queues

Status: upstream: reported C repro on 2022/11/06 15:24
Reported-by: syzbot+746a4eece09f86bc39d7@syzkaller.appspotmail.com
Fix commit: 90b0296ece4b block: fix crash in 'blk_mq_elv_switch_none'
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 88d, last: 71d

Cause bisection: failed (bisect log)

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc000000001d: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000000e8-0x00000000000000ef]
CPU: 1 PID: 5302 Comm: syz-executor419 Not tainted 6.1.0-rc5-next-20221114-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:__elevator_get block/elevator.h:94 [inline]
RIP: 0010:blk_mq_elv_switch_none block/blk-mq.c:4638 [inline]
RIP: 0010:__blk_mq_update_nr_hw_queues block/blk-mq.c:4703 [inline]
RIP: 0010:blk_mq_update_nr_hw_queues+0x308/0xfa0 block/blk-mq.c:4752
Code: 8d 47 18 49 89 6f 10 4c 89 c0 48 c1 e8 03 80 3c 18 00 0f 85 71 0a 00 00 49 8b 47 18 48 8d b8 e8 00 00 00 48 89 fa 48 c1 ea 03 <80> 3c 1a 00 0f 85 4e 0b 00 00 48 8b b8 e8 00 00 00 4c 89 44 24 08
RSP: 0018:ffffc90003a7fc00 EFLAGS: 00010206
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: 000000000000001d RSI: 0000000000000002 RDI: 00000000000000e8
RBP: ffff888146c60000 R08: ffff8880291a1458 R09: ffffffff8e54ab17
R10: fffffbfff1ca9562 R11: 1ffffffff210d416 R12: ffffc90003a7fc68
R13: ffff888146c60008 R14: ffff888146c603f8 R15: ffff8880291a1440
FS:  00005555571a5300(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005d84c8 CR3: 00000000220f1000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 nbd_start_device+0x153/0xc30 drivers/block/nbd.c:1355
 nbd_start_device_ioctl drivers/block/nbd.c:1405 [inline]
 __nbd_ioctl drivers/block/nbd.c:1481 [inline]
 nbd_ioctl+0x220/0xc60 drivers/block/nbd.c:1521
 blkdev_ioctl+0x362/0xa10 block/ioctl.c:614
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fb9633199b9
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffcf320a868 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb9633199b9
RDX: 0000000000000000 RSI: 000000000000ab03 RDI: 0000000000000007
RBP: 00007fb9632d9230 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb9632d92c0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__elevator_get block/elevator.h:94 [inline]
RIP: 0010:blk_mq_elv_switch_none block/blk-mq.c:4638 [inline]
RIP: 0010:__blk_mq_update_nr_hw_queues block/blk-mq.c:4703 [inline]
RIP: 0010:blk_mq_update_nr_hw_queues+0x308/0xfa0 block/blk-mq.c:4752
Code: 8d 47 18 49 89 6f 10 4c 89 c0 48 c1 e8 03 80 3c 18 00 0f 85 71 0a 00 00 49 8b 47 18 48 8d b8 e8 00 00 00 48 89 fa 48 c1 ea 03 <80> 3c 1a 00 0f 85 4e 0b 00 00 48 8b b8 e8 00 00 00 4c 89 44 24 08
RSP: 0018:ffffc90003a7fc00 EFLAGS: 00010206
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: 000000000000001d RSI: 0000000000000002 RDI: 00000000000000e8
RBP: ffff888146c60000 R08: ffff8880291a1458 R09: ffffffff8e54ab17
R10: fffffbfff1ca9562 R11: 1ffffffff210d416 R12: ffffc90003a7fc68
R13: ffff888146c60008 R14: ffff888146c603f8 R15: ffff8880291a1440
FS:  00005555571a5300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb96335d1dc CR3: 00000000220f1000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	8d 47 18             	lea    0x18(%rdi),%eax
   3:	49 89 6f 10          	mov    %rbp,0x10(%r15)
   7:	4c 89 c0             	mov    %r8,%rax
   a:	48 c1 e8 03          	shr    $0x3,%rax
   e:	80 3c 18 00          	cmpb   $0x0,(%rax,%rbx,1)
  12:	0f 85 71 0a 00 00    	jne    0xa89
  18:	49 8b 47 18          	mov    0x18(%r15),%rax
  1c:	48 8d b8 e8 00 00 00 	lea    0xe8(%rax),%rdi
  23:	48 89 fa             	mov    %rdi,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	80 3c 1a 00          	cmpb   $0x0,(%rdx,%rbx,1) <-- trapping instruction
  2e:	0f 85 4e 0b 00 00    	jne    0xb82
  34:	48 8b b8 e8 00 00 00 	mov    0xe8(%rax),%rdi
  3b:	4c 89 44 24 08       	mov    %r8,0x8(%rsp)

Crashes (16):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-linux-next-kasan-gce-root 2022/11/15 15:53 linux-next 5c92ddca1053 97de9cfc .config strace log report syz C [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/03 02:34 linux-next 61c3426aca2c 08977f5d .config strace log report syz C [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/19 04:36 linux-next 15f3bff12cf6 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/12 21:34 linux-next f8f60f322f06 3ead01ad .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/12 12:57 linux-next f8f60f322f06 3ead01ad .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/12 07:35 linux-next f8f60f322f06 3ead01ad .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/10 13:21 linux-next 0cdb3579f1ee b2488a87 .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/08 08:19 linux-next 0cdb3579f1ee 881db35d .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/06 16:09 linux-next 0cdb3579f1ee 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/06 15:34 linux-next 0cdb3579f1ee 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/04 14:53 linux-next 0cdb3579f1ee 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/04 14:52 linux-next 0cdb3579f1ee 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/04 07:30 linux-next 81214a573d19 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/03 01:50 linux-next 61c3426aca2c 08977f5d .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/02 19:46 linux-next 61c3426aca2c 08977f5d .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
ci-upstream-linux-next-kasan-gce-root 2022/11/02 15:18 linux-next 61c3426aca2c 08977f5d .config console log report info [disk image] [vmlinux] [kernel image] general protection fault in blk_mq_update_nr_hw_queues
* Struck through repros no longer work on HEAD.