Re: general protection fault in scsi_queue_rq

2020-10-13 Thread syzbot
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any 
issue:

Reported-and-tested-by: syzbot+0796b72dc61f223d8...@syzkaller.appspotmail.com

Tested on:

commit: 69f4ec1e scsi: hisi_sas: Recover PHY state according to th..
git tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git 
scsi-misc
kernel config:  https://syzkaller.appspot.com/x/.config?x=caba25cc405f3c66
dashboard link: https://syzkaller.appspot.com/bug?extid=0796b72dc61f223d8cc5
compiler:   gcc (GCC) 10.1.0-syz 20200507

Note: testing is done by a robot and is best-effort only.


Re: general protection fault in scsi_queue_rq

2020-10-13 Thread James Bottomley
On Mon, 2020-10-12 at 07:51 -0700, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:e4fb79c7 Add linux-next specific files for 20201008
> git tree:   linux-next
> console output: 
> https://syzkaller.appspot.com/x/log.txt?x=125c9a9f90
> kernel config:  
> https://syzkaller.appspot.com/x/.config?x=568d41fe4341ed0f
> dashboard link: 
> https://syzkaller.appspot.com/bug?extid=0796b72dc61f223d8cc5
> compiler:   gcc (GCC) 10.1.0-syz 20200507
> syz repro:  
> https://syzkaller.appspot.com/x/repro.syz?x=12582fe790
> C reproducer:   
> https://syzkaller.appspot.com/x/repro.c?x=124ac7d050
> 
> The issue was bisected to:
> 
> commit 2ceda20f0a99a74a82b78870f3b3e5fa93087a7f
> Author: Christoph Hellwig 
> Date:   Mon Oct 5 08:41:23 2020 +
> 
> scsi: core: Move command size detection out of the fast path

#syz: test git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-misc




general protection fault in scsi_queue_rq

2020-10-12 Thread syzbot
Hello,

syzbot found the following issue on:

HEAD commit:e4fb79c7 Add linux-next specific files for 20201008
git tree:   linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=125c9a9f90
kernel config:  https://syzkaller.appspot.com/x/.config?x=568d41fe4341ed0f
dashboard link: https://syzkaller.appspot.com/bug?extid=0796b72dc61f223d8cc5
compiler:   gcc (GCC) 10.1.0-syz 20200507
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=12582fe790
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=124ac7d050

The issue was bisected to:

commit 2ceda20f0a99a74a82b78870f3b3e5fa93087a7f
Author: Christoph Hellwig 
Date:   Mon Oct 5 08:41:23 2020 +

scsi: core: Move command size detection out of the fast path

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=135ea77790
final oops: https://syzkaller.appspot.com/x/report.txt?x=10dea77790
console output: https://syzkaller.appspot.com/x/log.txt?x=175ea77790

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0796b72dc61f223d8...@syzkaller.appspotmail.com
Fixes: 2ceda20f0a99 ("scsi: core: Move command size detection out of the fast 
path")

general protection fault, probably for non-canonical address 
0xdc00:  [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x-0x0007]
CPU: 1 PID: 6889 Comm: syz-executor086 Not tainted 
5.9.0-rc8-next-20201008-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 
01/01/2011
RIP: 0010:scsi_command_size include/scsi/scsi_common.h:24 [inline]
RIP: 0010:scsi_setup_scsi_cmnd drivers/scsi/scsi_lib.c:1186 [inline]
RIP: 0010:scsi_prepare_cmd drivers/scsi/scsi_lib.c:1565 [inline]
RIP: 0010:scsi_queue_rq+0x2155/0x3020 drivers/scsi/scsi_lib.c:1654
Code: 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 98 0c 00 00 48 8b 83 58 02 00 
00 48 ba 00 00 00 00 00 fc ff df 48 89 c1 48 c1 e9 03 <0f> b6 14 11 48 89 c1 83 
e1 07 38 ca 7f 08 84 d2 0f 85 53 0c 00 00
RSP: 0018:c90005627580 EFLAGS: 00010246
RAX:  RBX: 88801b6bd400 RCX: 
RDX: dc00 RSI: 84aaad82 RDI: 0003
RBP: 88801967 R08: 0001 R09: 88801b6bd7c0
R10:  R11:  R12: 
R13: 88801b6bd658 R14: 8881341bc000 R15: 
FS:  7f1d217b3700() GS:8880ae50() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 5617bf6e4410 CR3: 1f08b000 CR4: 001506e0
DR0:  DR1:  DR2: 
DR3:  DR6: fffe0ff0 DR7: 0400
Call Trace:
 blk_mq_dispatch_rq_list+0x3a1/0x1eb0 block/blk-mq.c:1388
 __blk_mq_sched_dispatch_requests+0x263/0x490 block/blk-mq-sched.c:308
 blk_mq_sched_dispatch_requests+0xfb/0x180 block/blk-mq-sched.c:341
 __blk_mq_run_hw_queue+0x13a/0x2d0 block/blk-mq.c:1532
 __blk_mq_delay_run_hw_queue+0x522/0x5f0 block/blk-mq.c:1609
 blk_mq_run_hw_queue+0x16c/0x2f0 block/blk-mq.c:1662
 blk_mq_sched_insert_request+0x4d7/0x5e0 block/blk-mq-sched.c:473
 blk_execute_rq+0xd4/0x1b0 block/blk-exec.c:86
 sg_io+0x609/0xf50 block/scsi_ioctl.c:360
 scsi_cmd_ioctl+0x5ce/0x660 block/scsi_ioctl.c:808
 scsi_cmd_blk_ioctl block/scsi_ioctl.c:866 [inline]
 scsi_cmd_blk_ioctl+0xe1/0x130 block/scsi_ioctl.c:857
 sd_ioctl_common+0x17e/0x280 drivers/scsi/sd.c:1575
 sd_ioctl+0x26/0xf0 drivers/scsi/sd.c:1765
 __blkdev_driver_ioctl block/ioctl.c:228 [inline]
 blkdev_ioctl+0x2a7/0x7f0 block/ioctl.c:623
 block_ioctl+0xf9/0x140 fs/block_dev.c:1869
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x446059
Code: e8 fc b8 02 00 48 83 c4 18 c3 0f 1f 80 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 0f 83 
0b 12 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:7f1d217b2d98 EFLAGS: 0246 ORIG_RAX: 0010
RAX: ffda RBX: 006ddc48 RCX: 00446059
RDX: 200046c0 RSI: 2285 RDI: 0004
RBP: 006ddc40 R08:  R09: 
R10:  R11: 0246 R12: 006ddc4c
R13: 2000 R14: 004ae698 R15: 0003
Modules linked in:
---[ end trace 2bb961546eae45fe ]---
RIP: 0010:scsi_command_size include/scsi/scsi_common.h:24 [inline]
RIP: 0010:scsi_setup_scsi_cmnd drivers/scsi/scsi_lib.c:1186 [inline]
RIP: 0010:scsi_prepare_cmd drivers/scsi/scsi_lib.c:1565 [inline]
RIP: 0010:scsi_queue_rq+0x2155/0x3020 drivers/scsi/scsi_lib.c:1654
Code: 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 98 0c 00 00 48 8b 83 58 02 00 
00 48 ba 00 00 00 00 00 fc ff df 48 89 c1