syzbot


BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue (2)

Status: upstream: reported C repro on 2019/12/15 04:28
Reported-by: syzbot+16be244270556f0045fe@syzkaller.appspotmail.com
First crash: 925d, last: 22d

Fix bisection: failed (bisect log)
similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue C done 20 925d 1162d 1/1 fixed on 2019/12/16 09:09
upstream BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue C 8 1349d 1369d 12/22 fixed on 2018/11/12 21:25
linux-4.14 BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue (2) C 11 22d 880d 0/1 upstream: reported C repro on 2020/01/29 04:42
linux-4.19 BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue C done 12 972d 1157d 1/1 fixed on 2019/12/14 05:59

Sample crash report:
RDX: 0000000000000000 RSI: 000000000000ab03 RDI: 0000000000000007
RBP: 00007fffa8781550 R08: 0000000000000002 R09: 00007f0ba4003331
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000008
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
BUG: unable to handle kernel NULL pointer dereference at 0000000000000118
PGD 97424067 P4D 97424067 PUD 96482067 PMD 0 
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 8099 Comm: syz-executor331 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:set_bit arch/x86/include/asm/bitops.h:76 [inline]
RIP: 0010:cpumask_set_cpu include/linux/cpumask.h:311 [inline]
RIP: 0010:blk_mq_map_swqueue+0x287/0xa20 block/blk-mq.c:2355
Code: c1 ea 03 80 3c 1a 00 0f 85 cf 06 00 00 89 ee bf 07 00 00 00 4d 8b 3f e8 47 04 fd fd 83 fd 07 0f 87 04 05 00 00 e8 c9 02 fd fd <f0> 4d 0f ab b7 18 01 00 00 49 8d bf 74 01 00 00 48 89 fa 48 c1 ea
RSP: 0018:ffff8880a157f920 EFLAGS: 00010293
RAX: ffff8880916741c0 RBX: dffffc0000000000 RCX: ffffffff83658299
RDX: 0000000000000000 RSI: ffffffff836582a7 RDI: 0000000000000005
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000007
R10: 0000000000000005 R11: 0000000000000000 R12: ffff8880ae47a080
R13: ffffe8ffffd37f80 R14: 0000000000000001 R15: 0000000000000000
FS:  0000555556a17300(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000118 CR3: 00000000b5073000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 blk_mq_queue_reinit block/blk-mq.c:2697 [inline]
 __blk_mq_update_nr_hw_queues block/blk-mq.c:3018 [inline]
 blk_mq_update_nr_hw_queues+0x5bb/0xb50 block/blk-mq.c:3032
 nbd_start_device+0x1f2/0xd60 drivers/block/nbd.c:1214
 nbd_start_device_ioctl drivers/block/nbd.c:1265 [inline]
 __nbd_ioctl drivers/block/nbd.c:1347 [inline]
 nbd_ioctl+0x62c/0xbe0 drivers/block/nbd.c:1387
 __blkdev_driver_ioctl block/ioctl.c:303 [inline]
 blkdev_ioctl+0x5cb/0x1a80 block/ioctl.c:601
 block_ioctl+0xe9/0x130 fs/block_dev.c:1906
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
 __do_sys_ioctl fs/ioctl.c:712 [inline]
 __se_sys_ioctl fs/ioctl.c:710 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f0ba4546dd9
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:00007fffa8781548 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f0ba4546dd9
RDX: 0000000000000000 RSI: 000000000000ab03 RDI: 0000000000000007
RBP: 00007fffa8781550 R08: 0000000000000002 R09: 00007f0ba4003331
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000008
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
CR2: 0000000000000118
---[ end trace 567dfb4804030a99 ]---
RIP: 0010:set_bit arch/x86/include/asm/bitops.h:76 [inline]
RIP: 0010:cpumask_set_cpu include/linux/cpumask.h:311 [inline]
RIP: 0010:blk_mq_map_swqueue+0x287/0xa20 block/blk-mq.c:2355
Code: c1 ea 03 80 3c 1a 00 0f 85 cf 06 00 00 89 ee bf 07 00 00 00 4d 8b 3f e8 47 04 fd fd 83 fd 07 0f 87 04 05 00 00 e8 c9 02 fd fd <f0> 4d 0f ab b7 18 01 00 00 49 8d bf 74 01 00 00 48 89 fa 48 c1 ea
RSP: 0018:ffff8880a157f920 EFLAGS: 00010293
RAX: ffff8880916741c0 RBX: dffffc0000000000 RCX: ffffffff83658299
RDX: 0000000000000000 RSI: ffffffff836582a7 RDI: 0000000000000005
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000007
R10: 0000000000000005 R11: 0000000000000000 R12: ffff8880ae47a080
R13: ffffe8ffffd37f80 R14: 0000000000000001 R15: 0000000000000000
FS:  0000555556a17300(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000118 CR3: 00000000b5073000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	c1 ea 03             	shr    $0x3,%edx
   3:	80 3c 1a 00          	cmpb   $0x0,(%rdx,%rbx,1)
   7:	0f 85 cf 06 00 00    	jne    0x6dc
   d:	89 ee                	mov    %ebp,%esi
   f:	bf 07 00 00 00       	mov    $0x7,%edi
  14:	4d 8b 3f             	mov    (%r15),%r15
  17:	e8 47 04 fd fd       	callq  0xfdfd0463
  1c:	83 fd 07             	cmp    $0x7,%ebp
  1f:	0f 87 04 05 00 00    	ja     0x529
  25:	e8 c9 02 fd fd       	callq  0xfdfd02f3
* 2a:	f0 4d 0f ab b7 18 01 	lock bts %r14,0x118(%r15) <-- trapping instruction
  31:	00 00
  33:	49 8d bf 74 01 00 00 	lea    0x174(%r15),%rdi
  3a:	48 89 fa             	mov    %rdi,%rdx
  3d:	48                   	rex.W
  3e:	c1                   	.byte 0xc1
  3f:	ea                   	(bad)

Crashes (15):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-19 2022/06/05 01:00 linux-4.19.y 3f8a27f9e27b c8857892 .config log report syz C BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue
ci2-linux-4-19 2022/02/09 07:18 linux-4.19.y 3f8a27f9e27b 0b33604d .config log report syz C BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue
ci2-linux-4-19 2022/02/07 01:20 linux-4.19.y 3f8a27f9e27b a7dab638 .config log report syz C BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue
ci2-linux-4-19 2019/12/15 04:49 linux-4.19.y 312017a460d5 eef6e580 .config log report syz C
ci2-linux-4-19 2021/09/06 21:15 linux-4.19.y b172b44fcb17 6ca60148 .config log report info BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue
ci2-linux-4-19 2021/06/02 00:26 linux-4.19.y 6b7b0056defc 032639db .config log report info BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue
ci2-linux-4-19 2021/03/21 01:08 linux-4.19.y 125222814e7b 17810eae .config log report info BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue
ci2-linux-4-19 2021/01/21 00:09 linux-4.19.y 43d555d83c3f d4f4eca5 .config log report info BUG: unable to handle kernel NULL pointer dereference in blk_mq_map_swqueue
ci2-linux-4-19 2020/12/11 20:28 linux-4.19.y 13d2ce42de8c ba24ffcd .config log report info
ci2-linux-4-19 2020/08/12 22:27 linux-4.19.y c14d30dc9987 0d7bd2e0 .config log report
ci2-linux-4-19 2020/05/21 19:05 linux-4.19.y 1bab61d3e8cd 4afdfa20 .config log report
ci2-linux-4-19 2020/03/30 06:02 linux-4.19.y 54b4fa6d3955 05736b29 .config log report
ci2-linux-4-19 2020/03/10 02:55 linux-4.19.y 7472c4028e23 35f53e45 .config log report
ci2-linux-4-19 2020/02/22 09:30 linux-4.19.y 4fccc2503536 2ffa6679 .config log report
ci2-linux-4-19 2019/12/15 04:27 linux-4.19.y 312017a460d5 eef6e580 .config log report