------------[ cut here ]------------ WARNING: CPU: 1 PID: 3965 at drivers/scsi/scsi_lib.c:1024 scsi_alloc_sgtables+0xc78/0xf70 drivers/scsi/scsi_lib.c:1024 Modules linked in: CPU: 1 PID: 3965 Comm: syz-executor.3 Not tainted 5.18.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 RIP: 0010:scsi_alloc_sgtables+0xc78/0xf70 drivers/scsi/scsi_lib.c:1024 Code: cf fc 31 ff 44 89 f6 e8 a6 06 cf fc 45 85 f6 0f 84 1a f5 ff ff e8 78 04 cf fc 83 c5 01 0f b7 ed e9 0f f5 ff ff e8 68 04 cf fc <0f> 0b 41 bc 0a 00 00 00 e9 2b fb ff ff 41 bc 09 00 00 00 e9 20 fb RSP: 0018:ffffc9000306f550 EFLAGS: 00010212 RAX: 000000000000186f RBX: ffff88801c503120 RCX: ffffc90003882000 RDX: 0000000000040000 RSI: ffffffff84a97128 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff84a96624 R11: 0000000000000000 R12: ffff888014886000 R13: ffff88801c503000 R14: 0000000000000000 R15: ffff888042fc0000 FS: 00007fb8d8d18700(0000) GS:ffff88802cb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b32629000 CR3: 0000000042f05000 CR4: 0000000000150ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: scsi_setup_scsi_cmnd drivers/scsi/scsi_lib.c:1179 [inline] scsi_prepare_cmd drivers/scsi/scsi_lib.c:1594 [inline] scsi_queue_rq+0x2a6f/0x3800 drivers/scsi/scsi_lib.c:1726 blk_mq_dispatch_rq_list+0x6ea/0x2340 block/blk-mq.c:1857 __blk_mq_sched_dispatch_requests+0x206/0x3d0 block/blk-mq-sched.c:306 blk_mq_sched_dispatch_requests+0x101/0x180 block/blk-mq-sched.c:339 __blk_mq_run_hw_queue+0xff/0x350 block/blk-mq.c:1974 __blk_mq_delay_run_hw_queue+0x5bc/0x6d0 block/blk-mq.c:2051 blk_mq_run_hw_queue+0x321/0x4a0 block/blk-mq.c:2102 blk_mq_sched_insert_request+0x340/0x440 block/blk-mq-sched.c:458 blk_execute_rq+0xcc/0x340 block/blk-mq.c:1237 sg_io+0x65a/0xf90 drivers/scsi/scsi_ioctl.c:479 scsi_ioctl_sg_io drivers/scsi/scsi_ioctl.c:857 [inline] scsi_ioctl+0xa66/0x1520 drivers/scsi/scsi_ioctl.c:912 sd_ioctl+0x195/0x2a0 drivers/scsi/sd.c:1466 blkdev_ioctl+0x36e/0x800 block/ioctl.c:588 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+0x193/0x200 fs/ioctl.c:856 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:0x7fb8d7c890e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb8d8d18168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fb8d7d9bf60 RCX: 00007fb8d7c890e9 RDX: 0000000020002300 RSI: 0000000000002285 RDI: 0000000000000004 RBP: 00007fb8d7ce308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd50d3e1af R14: 00007fb8d8d18300 R15: 0000000000022000