sg_write: data in/out 110652/603 bytes for SCSI command 0x0-- guessing data in; program syz-executor1 not setting count and/or reply_len properly ================================================================== BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:673 [inline] BUG: KASAN: use-after-free in enqueue_timer kernel/time/timer.c:520 [inline] BUG: KASAN: use-after-free in __mod_timer kernel/time/timer.c:1021 [inline] BUG: KASAN: use-after-free in mod_timer_pending+0x11d5/0x14e0 kernel/time/timer.c:1045 Write of size 8 at addr ffff8801c8cfbf48 by task syz-executor5/5993 CPU: 1 PID: 5993 Comm: syz-executor5 Not tainted 4.14.0-rc3-mm1+ #14 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:435 hlist_add_head include/linux/list.h:673 [inline] enqueue_timer kernel/time/timer.c:520 [inline] __mod_timer kernel/time/timer.c:1021 [inline] mod_timer_pending+0x11d5/0x14e0 kernel/time/timer.c:1045 tcp_check_req+0x1193/0x1620 net/ipv4/tcp_minisocks.c:620 tcp_v4_rcv+0x17ad/0x2f20 net/ipv4/tcp_ipv4.c:1674 ip_local_deliver_finish+0x2e2/0xba0 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:249 [inline] ip_local_deliver+0x1ce/0x6e0 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:464 [inline] ip_rcv_finish+0x8db/0x19c0 net/ipv4/ip_input.c:397 NF_HOOK include/linux/netfilter.h:249 [inline] ip_rcv+0xc3f/0x17d0 net/ipv4/ip_input.c:488 __netif_receive_skb_core+0x19af/0x33d0 net/core/dev.c:4448 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4486 netif_receive_skb_internal+0x10b/0x670 net/core/dev.c:4559 netif_receive_skb+0xae/0x390 net/core/dev.c:4583 tun_rx_batched.isra.49+0x5ed/0x860 drivers/net/tun.c:1372 tun_get_user+0x246b/0x36a0 drivers/net/tun.c:1766 tun_chr_write_iter+0xbf/0x160 drivers/net/tun.c:1792 call_write_iter include/linux/fs.h:1770 [inline] new_sync_write fs/read_write.c:468 [inline] __vfs_write+0x68a/0x970 fs/read_write.c:481 vfs_write+0x18f/0x510 fs/read_write.c:543 SYSC_write fs/read_write.c:588 [inline] SyS_write+0xef/0x220 fs/read_write.c:580 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x40c341 RSP: 002b:00007f6805677c10 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000718000 RCX: 000000000040c341 RDX: 0000000000000036 RSI: 0000000020002000 RDI: 0000000000000015 RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000f4240 R11: 0000000000000293 R12: 00000000004bbaf5 R13: 00000000ffffffff R14: 0000000020486ff8 R15: 0000000000000006 Allocated by task 5611: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 __do_kmalloc_node mm/slab.c:3690 [inline] __kmalloc_node+0x47/0x70 mm/slab.c:3697 kmalloc_node include/linux/slab.h:550 [inline] kvmalloc_node+0x64/0xd0 mm/util.c:397 kvmalloc include/linux/mm.h:529 [inline] kvzalloc include/linux/mm.h:537 [inline] alloc_netdev_mqs+0x16d/0xed0 net/core/dev.c:8044 tun_set_iff drivers/net/tun.c:2245 [inline] __tun_chr_ioctl+0x1386/0x3e40 drivers/net/tun.c:2499 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2744 vfs_ioctl fs/ioctl.c:45 [inline] do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685 SYSC_ioctl fs/ioctl.c:700 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 5611: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3504 [inline] kfree+0xca/0x250 mm/slab.c:3821 kvfree+0x36/0x60 mm/util.c:416 netdev_freemem net/core/dev.c:7996 [inline] free_netdev+0x2cf/0x360 net/core/dev.c:8158 tun_set_iff drivers/net/tun.c:2328 [inline] __tun_chr_ioctl+0x2df6/0x3e40 drivers/net/tun.c:2499 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2744 vfs_ioctl fs/ioctl.c:45 [inline] do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685 SYSC_ioctl fs/ioctl.c:700 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691 entry_SYSCALL_64_fastpath+0x1f/0xbe The buggy address belongs to the object at ffff8801c8cf8b40 which belongs to the cache kmalloc-16384 of size 16384 The buggy address is located 13320 bytes inside of 16384-byte region [ffff8801c8cf8b40, ffff8801c8cfcb40) The buggy address belongs to the page: page:ffffea0007233e00 count:1 mapcount:0 mapping:ffff8801c8cf8b40 index:0x0 compound_mapcount: 0 flags: 0x200000000008100(slab|head) raw: 0200000000008100 ffff8801c8cf8b40 0000000000000000 0000000100000001 raw: ffffea000724fa20 ffffea00070afc20 ffff8801dac02200 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c8cfbe00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c8cfbe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c8cfbf00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c8cfbf80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c8cfc000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================