INIT: Entering runlevel: 2 [info] Using makefile-style concurrent boot in runlevel 2. [....] Starting enhanced syslogd: rsyslogd[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting periodic command scheduler: cron[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting OpenBSD Secure Shell server: sshd[?25l[?1c7[ ok 8[?25h[?0c. Debian GNU/Linux 7 syzkaller ttyS0 Warning: Permanently added 'ci-upstream-mmots-kasan-gce-5,10.128.0.23' (ECDSA) to the list of known hosts. net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 29.930503] ================================================================== [ 29.937945] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 29.944674] Write of size 8 at addr ffff8801ce0c3780 by task syzkaller695841/2983 [ 29.952268] [ 29.953868] CPU: 0 PID: 2983 Comm: syzkaller695841 Not tainted 4.13.0-mm1+ #7 [ 29.961116] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.970439] Call Trace: [ 29.973000] dump_stack+0x194/0x257 [ 29.976599] ? arch_local_irq_restore+0x53/0x53 [ 29.981236] ? show_regs_print_info+0x65/0x65 [ 29.985702] ? lock_timer_base+0x1a3/0x2b0 [ 29.989918] ? detach_if_pending+0x557/0x610 [ 29.994300] print_address_description+0x73/0x250 [ 29.999111] ? detach_if_pending+0x557/0x610 [ 30.003488] kasan_report+0x24e/0x340 [ 30.007264] __asan_report_store8_noabort+0x17/0x20 [ 30.012248] detach_if_pending+0x557/0x610 [ 30.016456] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.021616] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.026252] ? lock_timer_base+0x1a3/0x2b0 [ 30.030459] ? lock_timer_base+0x1eb/0x2b0 [ 30.034672] ? __internal_add_timer+0x2d0/0x2d0 [ 30.039312] ? trace_hardirqs_on+0xd/0x10 [ 30.043437] try_to_del_timer_sync+0xa2/0x120 [ 30.047902] ? del_timer+0x130/0x130 [ 30.051586] ? del_timer_sync+0xeb/0x240 [ 30.055624] del_timer_sync+0x18a/0x240 [ 30.059572] tun_free_netdev+0x105/0x1b0 [ 30.063602] ? tun_xdp+0x410/0x410 [ 30.067112] ? cpumask_next+0x24/0x30 [ 30.070887] ? netdev_refcnt_read+0xed/0x150 [ 30.075271] ? tun_xdp+0x410/0x410 [ 30.078783] netdev_run_todo+0x870/0xca0 [ 30.082816] ? do_group_exit+0x149/0x400 [ 30.086854] ? register_netdev+0x30/0x30 [ 30.090890] ? lock_downgrade+0x990/0x990 [ 30.095009] ? trace_hardirqs_on+0xd/0x10 [ 30.099140] ? refcount_sub_and_test+0x115/0x1b0 [ 30.103868] ? refcount_inc+0x50/0x50 [ 30.107986] ? refcount_inc+0x50/0x50 [ 30.111763] ? sk_destruct+0x4c/0x80 [ 30.115448] ? __sk_free+0x5c/0x230 [ 30.119048] ? sk_free+0x2f/0x40 [ 30.122387] ? __tun_detach+0x176/0x1390 [ 30.126430] ? tun_attach+0xf90/0xf90 [ 30.130209] ? locks_remove_file+0x3fa/0x5a0 [ 30.134591] ? fcntl_setlk+0x10d0/0x10d0 [ 30.138628] ? __fsnotify_parent+0xb4/0x3a0 [ 30.142922] ? fsnotify+0x1af0/0x1af0 [ 30.146696] ? __tun_detach+0x1390/0x1390 [ 30.150818] ? __tun_detach+0x1390/0x1390 [ 30.154939] rtnl_unlock+0xe/0x10 [ 30.158361] tun_chr_close+0x49/0x60 [ 30.162045] __fput+0x333/0x7f0 [ 30.165301] ? fput+0x140/0x140 [ 30.168553] ? check_same_owner+0x320/0x320 [ 30.172853] ____fput+0x15/0x20 [ 30.176105] task_work_run+0x199/0x270 [ 30.179967] ? task_work_cancel+0x210/0x210 [ 30.184257] ? free_nsproxy+0x185/0x1f0 [ 30.188202] ? switch_task_namespaces+0xa2/0xc0 [ 30.192847] do_exit+0xa52/0x1b40 [ 30.196273] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 30.201260] ? check_noncircular+0x20/0x20 [ 30.205473] ? mm_update_next_owner+0x930/0x930 [ 30.210115] ? __pmd_alloc+0x4e0/0x4e0 [ 30.213983] ? find_held_lock+0x39/0x1d0 [ 30.218025] ? lock_downgrade+0x990/0x990 [ 30.222165] ? handle_mm_fault+0x410/0x8d0 [ 30.226366] ? down_read_trylock+0xdb/0x170 [ 30.230660] ? __handle_mm_fault+0x39c0/0x39c0 [ 30.235210] ? vmacache_find+0x61/0x270 [ 30.239153] ? vmacache_update+0xfe/0x130 [ 30.243278] ? up_read+0x1a/0x40 [ 30.246615] ? __do_page_fault+0x35b/0xb60 [ 30.250821] ? do_vfs_ioctl+0x492/0x1530 [ 30.254858] ? do_page_fault+0xee/0x720 [ 30.258803] ? __do_page_fault+0xb60/0xb60 [ 30.263009] ? putname+0xf3/0x130 [ 30.266439] do_group_exit+0x149/0x400 [ 30.270296] ? lockdep_sys_exit+0x47/0xf0 [ 30.274411] ? SyS_exit+0x30/0x30 [ 30.277836] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 30.282824] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.287552] SyS_exit_group+0x1d/0x20 [ 30.291322] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 30.296044] RIP: 0033:0x445109 [ 30.299205] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 30.306883] RAX: ffffffffffffffda RBX: 802f8fe229dbf318 RCX: 0000000000445109 [ 30.314124] RDX: 0000000000445109 RSI: 0000000020fbcfd8 RDI: 0000000000000001 [ 30.321363] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 30.328602] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402760 [ 30.335841] R13: 00000000004027f0 R14: 0000000000000000 R15: 0000000000000000 [ 30.343105] [ 30.344702] Allocated by task 2983: [ 30.348475] save_stack_trace+0x16/0x20 [ 30.352417] save_stack+0x43/0xd0 [ 30.355836] kasan_kmalloc+0xad/0xe0 [ 30.359517] __kmalloc_node+0x47/0x70 [ 30.363289] kvmalloc_node+0x64/0xd0 [ 30.366971] alloc_netdev_mqs+0x16e/0xed0 [ 30.371094] __tun_chr_ioctl+0x12be/0x3d20 [ 30.375294] tun_chr_ioctl+0x2a/0x40 [ 30.378975] do_vfs_ioctl+0x1b1/0x1530 [ 30.382828] SyS_ioctl+0x8f/0xc0 [ 30.386168] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 30.390989] [ 30.392584] Freed by task 2983: [ 30.395831] save_stack_trace+0x16/0x20 [ 30.399774] save_stack+0x43/0xd0 [ 30.403193] kasan_slab_free+0x71/0xc0 [ 30.407047] kfree+0xca/0x250 [ 30.410120] kvfree+0x36/0x60 [ 30.413194] free_netdev+0x2cf/0x360 [ 30.416877] __tun_chr_ioctl+0x2cf6/0x3d20 [ 30.421079] tun_chr_ioctl+0x2a/0x40 [ 30.424760] do_vfs_ioctl+0x1b1/0x1530 [ 30.428614] SyS_ioctl+0x8f/0xc0 [ 30.432564] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 30.437284] [ 30.438879] The buggy address belongs to the object at ffff8801ce0c0380 [ 30.438879] which belongs to the cache kmalloc-16384 of size 16384 [ 30.451850] The buggy address is located 13312 bytes inside of [ 30.451850] 16384-byte region [ffff8801ce0c0380, ffff8801ce0c4380) [ 30.464037] The buggy address belongs to the page: [ 30.468932] page:ffffea0007383000 count:1 mapcount:0 mapping:ffff8801ce0c0380 index:0x0 compound_mapcount: 0 [ 30.478882] flags: 0x200000000008100(slab|head) [ 30.483518] raw: 0200000000008100 ffff8801ce0c0380 0000000000000000 0000000100000001 [ 30.491366] raw: ffffea0007354020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 30.499212] page dumped because: kasan: bad access detected [ 30.504887] [ 30.506483] Memory state around the buggy address: [ 30.511379] ffff8801ce0c3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.518707] ffff8801ce0c3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.526041] >ffff8801ce0c3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.533366] ^ [ 30.536698] ffff8801ce0c3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.544035] ffff8801ce0c3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.551359] ================================================================== [ 30.558682] Disabling lock debugging due to kernel taint [ 30.564093] Kernel panic - not syncing: panic_on_warn set ... [ 30.564093] [ 30.571416] CPU: 0 PID: 2983 Comm: syzkaller695841 Tainted: G B 4.13.0-mm1+ #7 [ 30.579873] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.589191] Call Trace: [ 30.591743] dump_stack+0x194/0x257 [ 30.595334] ? arch_local_irq_restore+0x53/0x53 [ 30.599969] ? vprintk_default+0x28/0x30 [ 30.603996] ? detach_if_pending+0x550/0x610 [ 30.608377] panic+0x1e4/0x417 [ 30.611532] ? __warn+0x1d9/0x1d9 [ 30.614953] ? detach_if_pending+0x557/0x610 [ 30.619327] kasan_end_report+0x50/0x50 [ 30.623264] kasan_report+0x137/0x340 [ 30.627032] __asan_report_store8_noabort+0x17/0x20 [ 30.632011] detach_if_pending+0x557/0x610 [ 30.636209] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.641370] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.646002] ? lock_timer_base+0x1a3/0x2b0 [ 30.650198] ? lock_timer_base+0x1eb/0x2b0 [ 30.654397] ? __internal_add_timer+0x2d0/0x2d0 [ 30.659034] ? trace_hardirqs_on+0xd/0x10 [ 30.663156] try_to_del_timer_sync+0xa2/0x120 [ 30.667613] ? del_timer+0x130/0x130 [ 30.671290] ? del_timer_sync+0xeb/0x240 [ 30.675316] del_timer_sync+0x18a/0x240 [ 30.679253] tun_free_netdev+0x105/0x1b0 [ 30.683279] ? tun_xdp+0x410/0x410 [ 30.686784] ? cpumask_next+0x24/0x30 [ 30.690549] ? netdev_refcnt_read+0xed/0x150 [ 30.694933] ? tun_xdp+0x410/0x410 [ 30.698435] netdev_run_todo+0x870/0xca0 [ 30.702459] ? do_group_exit+0x149/0x400 [ 30.706492] ? register_netdev+0x30/0x30 [ 30.710520] ? lock_downgrade+0x990/0x990 [ 30.714630] ? trace_hardirqs_on+0xd/0x10 [ 30.718749] ? refcount_sub_and_test+0x115/0x1b0 [ 30.723468] ? refcount_inc+0x50/0x50 [ 30.727233] ? refcount_inc+0x50/0x50 [ 30.731001] ? sk_destruct+0x4c/0x80 [ 30.734678] ? __sk_free+0x5c/0x230 [ 30.738270] ? sk_free+0x2f/0x40 [ 30.741601] ? __tun_detach+0x176/0x1390 [ 30.745630] ? tun_attach+0xf90/0xf90 [ 30.749398] ? locks_remove_file+0x3fa/0x5a0 [ 30.753772] ? fcntl_setlk+0x10d0/0x10d0 [ 30.757797] ? __fsnotify_parent+0xb4/0x3a0 [ 30.762082] ? fsnotify+0x1af0/0x1af0 [ 30.765846] ? __tun_detach+0x1390/0x1390 [ 30.769959] ? __tun_detach+0x1390/0x1390 [ 30.774071] rtnl_unlock+0xe/0x10 [ 30.777487] tun_chr_close+0x49/0x60 [ 30.781163] __fput+0x333/0x7f0 [ 30.784409] ? fput+0x140/0x140 [ 30.787654] ? check_same_owner+0x320/0x320 [ 30.791940] ____fput+0x15/0x20 [ 30.795183] task_work_run+0x199/0x270 [ 30.799034] ? task_work_cancel+0x210/0x210 [ 30.803327] ? free_nsproxy+0x185/0x1f0 [ 30.807265] ? switch_task_namespaces+0xa2/0xc0 [ 30.811899] do_exit+0xa52/0x1b40 [ 30.815316] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 30.820298] ? check_noncircular+0x20/0x20 [ 30.824502] ? mm_update_next_owner+0x930/0x930 [ 30.829135] ? __pmd_alloc+0x4e0/0x4e0 [ 30.832991] ? find_held_lock+0x39/0x1d0 [ 30.837021] ? lock_downgrade+0x990/0x990 [ 30.841145] ? handle_mm_fault+0x410/0x8d0 [ 30.845341] ? down_read_trylock+0xdb/0x170 [ 30.849624] ? __handle_mm_fault+0x39c0/0x39c0 [ 30.854169] ? vmacache_find+0x61/0x270 [ 30.858108] ? vmacache_update+0xfe/0x130 [ 30.862221] ? up_read+0x1a/0x40 [ 30.865552] ? __do_page_fault+0x35b/0xb60 [ 30.869749] ? do_vfs_ioctl+0x492/0x1530 [ 30.873777] ? do_page_fault+0xee/0x720 [ 30.877715] ? __do_page_fault+0xb60/0xb60 [ 30.881913] ? putname+0xf3/0x130 [ 30.885333] do_group_exit+0x149/0x400 [ 30.889183] ? lockdep_sys_exit+0x47/0xf0 [ 30.893293] ? SyS_exit+0x30/0x30 [ 30.896718] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 30.901708] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.906427] SyS_exit_group+0x1d/0x20 [ 30.910191] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 30.914908] RIP: 0033:0x445109 [ 30.918061] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 30.925733] RAX: ffffffffffffffda RBX: 802f8fe229dbf318 RCX: 0000000000445109