syzbot


general protection fault in scsi_queue_rq

Status: fixed on 2021/12/01 19:46
Reported-by: syzbot+5516b30f5401d4dcbcae@syzkaller.appspotmail.com
Fix commit: 06cc8187dbb6 scsi: core: Remove command size deduction from scsi_setup_scsi_cmnd()
First crash: 1120d, last: 1095d
Cause bisection: failed (error log, bisect log)
  
Discussions (6)
Title Replies (including bot) Last reply
[PATCH 5.10 000/575] 5.10.80-rc1 review 595 (595) 2022/07/31 10:51
[PATCH 5.15 000/917] 5.15.3-rc1 review 945 (945) 2021/11/24 18:04
[PATCH 5.14 000/849] 5.14.19-rc1 review 859 (859) 2021/11/16 14:04
[PATCH v2 1/2] scsi: scsi_ioctl: Validate command size 7 (7) 2021/11/03 17:20
[PATCH 1/2] scsi: scsi_ioctl: Validate command size 5 (5) 2021/11/03 14:40
[PATCH] scsi: core: initialize cmd->cmnd before it is used 10 (10) 2021/11/02 23:01
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in scsi_queue_rq fuse scsi C done done 4000 1107d 1502d 20/28 fixed on 2022/03/08 16:11

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: 1 PID: 366 Comm: syz-executor416 Not tainted 5.10.76-syzkaller-01178-g4944ec82ebb9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:scsi_command_size syzkaller/managers/android-5-10/kernel/./include/scsi/scsi_common.h:24 [inline]
RIP: 0010:scsi_setup_scsi_cmnd syzkaller/managers/android-5-10/kernel/drivers/scsi/scsi_lib.c:1197 [inline]
RIP: 0010:scsi_prepare_cmd syzkaller/managers/android-5-10/kernel/drivers/scsi/scsi_lib.c:1581 [inline]
RIP: 0010:scsi_queue_rq+0x14d0/0x23c0 syzkaller/managers/android-5-10/kernel/drivers/scsi/scsi_lib.c:1670
Code: 00 00 00 00 00 fc ff df 80 3c 08 00 74 08 48 89 df e8 c4 bd c3 fe 4c 8b 3b 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <8a> 04 08 84 c0 0f 85 fe 0d 00 00 41 0f b6 1f bf 7f 00 00 00 89 de
RSP: 0018:ffffc90000be7210 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88810a8e4200 RCX: dffffc0000000000
RDX: ffff8881071e13c0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90000be72d0 R08: ffffffff82e30c78 R09: ffff88810a8e4208
R10: ffffed102151c844 R11: 0000000000000000 R12: 1ffff1102151c83e
R13: ffff888109ee8000 R14: ffff88810a8e41f4 R15: 0000000000000000
FS:  00007f2363bc1700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2363ba0718 CR3: 000000011caf0000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 blk_mq_dispatch_rq_list+0x9a4/0x1800 syzkaller/managers/android-5-10/kernel/block/blk-mq.c:1373
 __blk_mq_sched_dispatch_requests+0x3c6/0x4d0 syzkaller/managers/android-5-10/kernel/block/blk-mq-sched.c:308
 blk_mq_sched_dispatch_requests+0xf0/0x160 syzkaller/managers/android-5-10/kernel/block/blk-mq-sched.c:341
 __blk_mq_run_hw_queue+0x14f/0x260 syzkaller/managers/android-5-10/kernel/block/blk-mq.c:1517
 __blk_mq_delay_run_hw_queue+0x230/0x570 syzkaller/managers/android-5-10/kernel/block/blk-mq.c:1594
 blk_mq_run_hw_queue+0x29d/0x3b0 syzkaller/managers/android-5-10/kernel/block/blk-mq.c:1647
 blk_mq_sched_insert_request+0x3d7/0x520 syzkaller/managers/android-5-10/kernel/block/blk-mq-sched.c:469
 blk_execute_rq_nowait syzkaller/managers/android-5-10/kernel/block/blk-exec.c:64 [inline]
 blk_execute_rq+0x208/0x2f0 syzkaller/managers/android-5-10/kernel/block/blk-exec.c:86
 sg_io+0x868/0xf90 syzkaller/managers/android-5-10/kernel/block/scsi_ioctl.c:360
 scsi_cmd_ioctl+0x7de/0x1990 syzkaller/managers/android-5-10/kernel/block/scsi_ioctl.c:809
 scsi_cmd_blk_ioctl+0x117/0x150 syzkaller/managers/android-5-10/kernel/block/scsi_ioctl.c:867
 sd_ioctl_common syzkaller/managers/android-5-10/kernel/drivers/scsi/sd.c:1591 [inline]
 sd_ioctl+0x156/0x210 syzkaller/managers/android-5-10/kernel/drivers/scsi/sd.c:1781
 __blkdev_driver_ioctl syzkaller/managers/android-5-10/kernel/block/ioctl.c:237 [inline]
 blkdev_ioctl+0x2c3/0x5f0 syzkaller/managers/android-5-10/kernel/block/ioctl.c:632
 block_ioctl+0xaf/0xf0 syzkaller/managers/android-5-10/kernel/fs/block_dev.c:1886
 vfs_ioctl syzkaller/managers/android-5-10/kernel/fs/ioctl.c:48 [inline]
 __do_sys_ioctl syzkaller/managers/android-5-10/kernel/fs/ioctl.c:753 [inline]
 __se_sys_ioctl+0x115/0x190 syzkaller/managers/android-5-10/kernel/fs/ioctl.c:739
 __x64_sys_ioctl+0x7b/0x90 syzkaller/managers/android-5-10/kernel/fs/ioctl.c:739
 do_syscall_64+0x31/0x70 syzkaller/managers/android-5-10/kernel/arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f2363c0f509
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 14 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:00007f2363bc12f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f2363c994c0 RCX: 00007f2363c0f509
RDX: 0000000020002100 RSI: 0000000000002285 RDI: 0000000000000004
RBP: 00007f2363c6703c R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0080000000000007 R14: 2f30656c69662f2e R15: 00007f2363c994c8
Modules linked in:
---[ end trace 21b06b38ac2acf10 ]---
RIP: 0010:scsi_command_size syzkaller/managers/android-5-10/kernel/./include/scsi/scsi_common.h:24 [inline]
RIP: 0010:scsi_setup_scsi_cmnd syzkaller/managers/android-5-10/kernel/drivers/scsi/scsi_lib.c:1197 [inline]
RIP: 0010:scsi_prepare_cmd syzkaller/managers/android-5-10/kernel/drivers/scsi/scsi_lib.c:1581 [inline]
RIP: 0010:scsi_queue_rq+0x14d0/0x23c0 syzkaller/managers/android-5-10/kernel/drivers/scsi/scsi_lib.c:1670
Code: 00 00 00 00 00 fc ff df 80 3c 08 00 74 08 48 89 df e8 c4 bd c3 fe 4c 8b 3b 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <8a> 04 08 84 c0 0f 85 fe 0d 00 00 41 0f b6 1f bf 7f 00 00 00 89 de
RSP: 0018:ffffc90000be7210 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88810a8e4200 RCX: dffffc0000000000
RDX: ffff8881071e13c0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90000be72d0 R08: ffffffff82e30c78 R09: ffff88810a8e4208
R10: ffffed102151c844 R11: 0000000000000000 R12: 1ffff1102151c83e
R13: ffff888109ee8000 R14: ffff88810a8e41f4 R15: 0000000000000000
FS:  00007f2363bc1700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2363ba0718 CR3: 000000011caf0000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	00 00                	add    %al,(%rax)
   2:	00 00                	add    %al,(%rax)
   4:	00 fc                	add    %bh,%ah
   6:	ff                   	(bad)
   7:	df 80 3c 08 00 74    	filds  0x7400083c(%rax)
   d:	08 48 89             	or     %cl,-0x77(%rax)
  10:	df e8                	fucomip %st(0),%st
  12:	c4                   	(bad)
  13:	bd c3 fe 4c 8b       	mov    $0x8b4cfec3,%ebp
  18:	3b 4c 89 f8          	cmp    -0x8(%rcx,%rcx,4),%ecx
  1c:	48 c1 e8 03          	shr    $0x3,%rax
  20:	48 b9 00 00 00 00 00 	movabs $0xdffffc0000000000,%rcx
  27:	fc ff df
* 2a:	8a 04 08             	mov    (%rax,%rcx,1),%al <-- trapping instruction
  2d:	84 c0                	test   %al,%al
  2f:	0f 85 fe 0d 00 00    	jne    0xe33
  35:	41 0f b6 1f          	movzbl (%r15),%ebx
  39:	bf 7f 00 00 00       	mov    $0x7f,%edi
  3e:	89 de                	mov    %ebx,%esi

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/10/29 16:53 android12-5.10-lts 4944ec82ebb9 2353a3ec .config console log report syz C ci2-android-5-10 general protection fault in scsi_queue_rq
2021/11/23 14:19 android12-5.10-lts 76698ea35fd3 545ab074 .config console log report info ci2-android-5-10 general protection fault in scsi_queue_rq
2021/10/29 16:36 android12-5.10-lts 4944ec82ebb9 2353a3ec .config console log report info ci2-android-5-10 general protection fault in scsi_queue_rq
* Struck through repros no longer work on HEAD.