program syz-executor5 not setting count and/or reply_len properly ================================================================== BUG: KASAN: wild-memory-access on address ffe708746e2dd000 Read of size 183 by task syz-executor5/8533 CPU: 0 PID: 8533 Comm: syz-executor5 Not tainted 4.9.56-g05c85a6 #64 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801a9d5f9e8 ffffffff81d93979 ffe708746e2dd000 00000000000000b7 0000000000000000 ffff8801a5ea9360 ffe708746e2dd000 ffff8801a9d5fa70 ffffffff8153d5cf 0000000000000000 0000000000000001 ffffffff8266525b Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] kasan_report_error mm/kasan/report.c:284 [inline] [] kasan_report.part.1+0x40f/0x500 mm/kasan/report.c:309 [] kasan_report+0x20/0x30 mm/kasan/report.c:296 [] check_memory_region_inline mm/kasan/kasan.c:308 [inline] [] check_memory_region+0x137/0x190 mm/kasan/kasan.c:315 [] kasan_check_read+0x11/0x20 mm/kasan/kasan.c:320 [] __copy_to_user arch/x86/include/asm/uaccess_64.h:182 [inline] [] sg_read_oxfer drivers/scsi/sg.c:1978 [inline] [] sg_read+0x124b/0x1400 drivers/scsi/sg.c:520 [] do_loop_readv_writev.part.17+0x141/0x1e0 fs/read_write.c:714 [] do_loop_readv_writev fs/read_write.c:880 [inline] [] do_readv_writev+0x520/0x750 fs/read_write.c:874 [] vfs_readv+0x84/0xc0 fs/read_write.c:898 [] do_readv+0xe6/0x250 fs/read_write.c:924 [] SYSC_readv fs/read_write.c:1011 [inline] [] SyS_readv+0x27/0x30 fs/read_write.c:1008 [] entry_SYSCALL_64_fastpath+0x23/0xc6 ================================================================== kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 8533 Comm: syz-executor5 Tainted: G B 4.9.56-g05c85a6 #64 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801cf68e000 task.stack: ffff8801a9d58000 RIP: 0010:[] [] __read_once_size include/linux/compiler.h:243 [inline] RIP: 0010:[] [] atomic_read arch/x86/include/asm/atomic.h:26 [inline] RIP: 0010:[] [] page_ref_count include/linux/page_ref.h:66 [inline] RIP: 0010:[] [] put_page_testzero include/linux/mm.h:445 [inline] RIP: 0010:[] [] __free_pages+0x21/0x80 mm/page_alloc.c:3901 RSP: 0018:ffff8801a9d5fb00 EFLAGS: 00010a07 RAX: dffffc0000000000 RBX: dead4ead00000000 RCX: ffffc90003052000 RDX: 1bd5a9d5a0000003 RSI: 0000000000000000 RDI: dead4ead0000001c RBP: ffff8801a9d5fb10 R08: ffffed0034bd5240 R09: 0000000000000000 R10: fffc9dc000000000 R11: ffffed0034bd5240 R12: 0000000000000004 R13: 0000000000000020 R14: ffff8801c668a100 R15: dffffc0000000000 FS: 00007f60d8b48700(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f336bba5db8 CR3: 00000001c98f8000 CR4: 00000000001406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: 0000000000000000 ffff8801c668a258 ffff8801a9d5fb70 ffffffff82662851 ffff8801c668a270 ffffed0038cd144b ffffed0038cd144e ffff8801c668a268 dead4ead00000000 ffff8801c668a240 0000000000000000 0000000000000000 Call Trace: [] sg_remove_scat.isra.20+0x1c1/0x2d0 drivers/scsi/sg.c:1954 [] sg_finish_rem_req+0x2b5/0x340 drivers/scsi/sg.c:1836 [] sg_read+0x91c/0x1400 drivers/scsi/sg.c:527 [] __vfs_read+0x103/0x670 fs/read_write.c:452 [] vfs_read+0x107/0x330 fs/read_write.c:475 [] SYSC_read fs/read_write.c:591 [inline] [] SyS_read+0xd9/0x1b0 fs/read_write.c:584 [] entry_SYSCALL_64_fastpath+0x23/0xc6 Code: ff 66 0f 1f 84 00 00 00 00 00 48 b8 00 00 00 00 00 fc ff df 55 48 89 e5 53 48 89 fb 48 83 c7 1c 48 89 fa 48 83 ec 08 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 3d RIP [] __read_once_size include/linux/compiler.h:243 [inline] RIP [] atomic_read arch/x86/include/asm/atomic.h:26 [inline] RIP [] page_ref_count include/linux/page_ref.h:66 [inline] RIP [] put_page_testzero include/linux/mm.h:445 [inline] RIP [] __free_pages+0x21/0x80 mm/page_alloc.c:3901 RSP ---[ end trace ac9f2f2435c7cef8 ]---