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-3,10.128.0.24' (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: [ 40.265466] ================================================================== [ 40.272877] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.279600] Write of size 8 at addr ffff8801cdf43780 by task syzkaller328415/2986 [ 40.287188] [ 40.288788] CPU: 0 PID: 2986 Comm: syzkaller328415 Not tainted 4.13.0-mm1+ #7 [ 40.296031] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.305365] Call Trace: [ 40.307924] dump_stack+0x194/0x257 [ 40.311525] ? arch_local_irq_restore+0x53/0x53 [ 40.316162] ? show_regs_print_info+0x65/0x65 [ 40.320630] ? lock_timer_base+0x1a3/0x2b0 [ 40.324835] ? detach_if_pending+0x557/0x610 [ 40.329215] print_address_description+0x73/0x250 [ 40.334025] ? detach_if_pending+0x557/0x610 [ 40.338402] kasan_report+0x24e/0x340 [ 40.342177] __asan_report_store8_noabort+0x17/0x20 [ 40.347161] detach_if_pending+0x557/0x610 [ 40.351368] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.356529] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.361163] ? lock_timer_base+0x1a3/0x2b0 [ 40.365367] ? lock_timer_base+0x1eb/0x2b0 [ 40.369577] ? __internal_add_timer+0x2d0/0x2d0 [ 40.374218] ? trace_hardirqs_on+0xd/0x10 [ 40.378347] try_to_del_timer_sync+0xa2/0x120 [ 40.382811] ? del_timer+0x130/0x130 [ 40.386493] ? del_timer_sync+0xeb/0x240 [ 40.390528] del_timer_sync+0x18a/0x240 [ 40.394475] tun_free_netdev+0x105/0x1b0 [ 40.398509] ? tun_xdp+0x410/0x410 [ 40.402016] ? cpumask_next+0x24/0x30 [ 40.405786] ? netdev_refcnt_read+0xed/0x150 [ 40.410169] ? tun_xdp+0x410/0x410 [ 40.413677] netdev_run_todo+0x870/0xca0 [ 40.417709] ? do_group_exit+0x149/0x400 [ 40.421743] ? register_netdev+0x30/0x30 [ 40.425784] ? lock_downgrade+0x990/0x990 [ 40.429900] ? trace_hardirqs_on+0xd/0x10 [ 40.434036] ? refcount_sub_and_test+0x115/0x1b0 [ 40.438765] ? refcount_inc+0x50/0x50 [ 40.442534] ? refcount_inc+0x50/0x50 [ 40.446311] ? sk_destruct+0x4c/0x80 [ 40.450341] ? __sk_free+0x5c/0x230 [ 40.453941] ? sk_free+0x2f/0x40 [ 40.457276] ? __tun_detach+0x176/0x1390 [ 40.461316] ? tun_attach+0xf90/0xf90 [ 40.465095] ? locks_remove_file+0x3fa/0x5a0 [ 40.469473] ? fcntl_setlk+0x10d0/0x10d0 [ 40.473509] ? __fsnotify_parent+0xb4/0x3a0 [ 40.477802] ? fsnotify+0x1af0/0x1af0 [ 40.481577] ? __tun_detach+0x1390/0x1390 [ 40.485695] ? __tun_detach+0x1390/0x1390 [ 40.489813] rtnl_unlock+0xe/0x10 [ 40.493232] tun_chr_close+0x49/0x60 [ 40.496913] __fput+0x333/0x7f0 [ 40.500167] ? fput+0x140/0x140 [ 40.503418] ? check_same_owner+0x320/0x320 [ 40.507713] ____fput+0x15/0x20 [ 40.510961] task_work_run+0x199/0x270 [ 40.514821] ? task_work_cancel+0x210/0x210 [ 40.519111] ? free_nsproxy+0x185/0x1f0 [ 40.523056] ? switch_task_namespaces+0xa2/0xc0 [ 40.527699] do_exit+0xa52/0x1b40 [ 40.531127] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.536116] ? trace_hardirqs_on+0xd/0x10 [ 40.540239] ? kvfree+0x3b/0x60 [ 40.543492] ? mm_update_next_owner+0x930/0x930 [ 40.548130] ? rtnl_unlock+0xe/0x10 [ 40.551726] ? __tun_chr_ioctl+0x27a/0x3d20 [ 40.556027] ? tun_chr_read_iter+0x1e0/0x1e0 [ 40.560418] ? lock_downgrade+0x990/0x990 [ 40.564563] ? check_same_owner+0x320/0x320 [ 40.568854] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.573404] ? vmacache_find+0x61/0x270 [ 40.577351] ? tun_chr_compat_ioctl+0x30/0x30 [ 40.581813] ? tun_chr_ioctl+0x2a/0x40 [ 40.585681] ? tun_chr_ioctl+0x2a/0x40 [ 40.589542] ? do_vfs_ioctl+0x492/0x1530 [ 40.593584] ? ioctl_preallocate+0x2b0/0x2b0 [ 40.597964] ? selinux_capable+0x40/0x40 [ 40.601995] ? putname+0xf3/0x130 [ 40.605425] do_group_exit+0x149/0x400 [ 40.609283] ? SyS_exit+0x30/0x30 [ 40.612708] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.617694] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.622421] SyS_exit_group+0x1d/0x20 [ 40.626194] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.630923] RIP: 0033:0x445679 [ 40.634082] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 40.641770] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445679 [ 40.649009] RDX: 0000000000445679 RSI: 0000000020c12000 RDI: 0000000000000001 [ 40.656248] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 40.663488] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402cd0 [ 40.670727] R13: 0000000000402d60 R14: 0000000000000000 R15: 0000000000000000 [ 40.677982] [ 40.679580] Allocated by task 2986: [ 40.683176] save_stack_trace+0x16/0x20 [ 40.687119] save_stack+0x43/0xd0 [ 40.690538] kasan_kmalloc+0xad/0xe0 [ 40.694221] __kmalloc_node+0x47/0x70 [ 40.697989] kvmalloc_node+0x64/0xd0 [ 40.701670] alloc_netdev_mqs+0x16e/0xed0 [ 40.705784] __tun_chr_ioctl+0x12be/0x3d20 [ 40.709987] tun_chr_ioctl+0x2a/0x40 [ 40.713672] do_vfs_ioctl+0x1b1/0x1530 [ 40.717528] SyS_ioctl+0x8f/0xc0 [ 40.720865] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.725585] [ 40.727181] Freed by task 2986: [ 40.730428] save_stack_trace+0x16/0x20 [ 40.734370] save_stack+0x43/0xd0 [ 40.737789] kasan_slab_free+0x71/0xc0 [ 40.741650] kfree+0xca/0x250 [ 40.744722] kvfree+0x36/0x60 [ 40.747795] free_netdev+0x2cf/0x360 [ 40.751483] __tun_chr_ioctl+0x2cf6/0x3d20 [ 40.755684] tun_chr_ioctl+0x2a/0x40 [ 40.759365] do_vfs_ioctl+0x1b1/0x1530 [ 40.763218] SyS_ioctl+0x8f/0xc0 [ 40.766553] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.771272] [ 40.772868] The buggy address belongs to the object at ffff8801cdf40380 [ 40.772868] which belongs to the cache kmalloc-16384 of size 16384 [ 40.785838] The buggy address is located 13312 bytes inside of [ 40.785838] 16384-byte region [ffff8801cdf40380, ffff8801cdf44380) [ 40.798033] The buggy address belongs to the page: [ 40.802930] page:ffffea000737d000 count:1 mapcount:0 mapping:ffff8801cdf40380 index:0x0 compound_mapcount: 0 [ 40.812878] flags: 0x200000000008100(slab|head) [ 40.817516] raw: 0200000000008100 ffff8801cdf40380 0000000000000000 0000000100000001 [ 40.825366] raw: ffffea000738d020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 40.833211] page dumped because: kasan: bad access detected [ 40.838886] [ 40.840484] Memory state around the buggy address: [ 40.845381] ffff8801cdf43680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.852706] ffff8801cdf43700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.860032] >ffff8801cdf43780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.867356] ^ [ 40.870689] ffff8801cdf43800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.878024] ffff8801cdf43880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.885348] ================================================================== [ 40.892673] Disabling lock debugging due to kernel taint [ 40.898084] Kernel panic - not syncing: panic_on_warn set ... [ 40.898084] [ 40.905409] CPU: 0 PID: 2986 Comm: syzkaller328415 Tainted: G B 4.13.0-mm1+ #7 [ 40.913864] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.923178] Call Trace: [ 40.925732] dump_stack+0x194/0x257 [ 40.929324] ? arch_local_irq_restore+0x53/0x53 [ 40.933957] ? vprintk_default+0x28/0x30 [ 40.937983] ? detach_if_pending+0x550/0x610 [ 40.942358] panic+0x1e4/0x417 [ 40.945518] ? __warn+0x1d9/0x1d9 [ 40.948955] ? detach_if_pending+0x557/0x610 [ 40.953327] kasan_end_report+0x50/0x50 [ 40.957262] kasan_report+0x137/0x340 [ 40.961033] __asan_report_store8_noabort+0x17/0x20 [ 40.966015] detach_if_pending+0x557/0x610 [ 40.970218] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.975370] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.980001] ? lock_timer_base+0x1a3/0x2b0 [ 40.984199] ? lock_timer_base+0x1eb/0x2b0 [ 40.988400] ? __internal_add_timer+0x2d0/0x2d0 [ 40.993033] ? trace_hardirqs_on+0xd/0x10 [ 40.997148] try_to_del_timer_sync+0xa2/0x120 [ 41.001614] ? del_timer+0x130/0x130 [ 41.005291] ? del_timer_sync+0xeb/0x240 [ 41.009325] del_timer_sync+0x18a/0x240 [ 41.013264] tun_free_netdev+0x105/0x1b0 [ 41.017289] ? tun_xdp+0x410/0x410 [ 41.020795] ? cpumask_next+0x24/0x30 [ 41.024561] ? netdev_refcnt_read+0xed/0x150 [ 41.028934] ? tun_xdp+0x410/0x410 [ 41.032436] netdev_run_todo+0x870/0xca0 [ 41.036461] ? do_group_exit+0x149/0x400 [ 41.040499] ? register_netdev+0x30/0x30 [ 41.044529] ? lock_downgrade+0x990/0x990 [ 41.048640] ? trace_hardirqs_on+0xd/0x10 [ 41.052759] ? refcount_sub_and_test+0x115/0x1b0 [ 41.057478] ? refcount_inc+0x50/0x50 [ 41.061242] ? refcount_inc+0x50/0x50 [ 41.065007] ? sk_destruct+0x4c/0x80 [ 41.068682] ? __sk_free+0x5c/0x230 [ 41.072272] ? sk_free+0x2f/0x40 [ 41.075602] ? __tun_detach+0x176/0x1390 [ 41.079630] ? tun_attach+0xf90/0xf90 [ 41.083408] ? locks_remove_file+0x3fa/0x5a0 [ 41.087781] ? fcntl_setlk+0x10d0/0x10d0 [ 41.091809] ? __fsnotify_parent+0xb4/0x3a0 [ 41.096096] ? fsnotify+0x1af0/0x1af0 [ 41.099863] ? __tun_detach+0x1390/0x1390 [ 41.103974] ? __tun_detach+0x1390/0x1390 [ 41.108086] rtnl_unlock+0xe/0x10 [ 41.111501] tun_chr_close+0x49/0x60 [ 41.115181] __fput+0x333/0x7f0 [ 41.118426] ? fput+0x140/0x140 [ 41.121673] ? check_same_owner+0x320/0x320 [ 41.125960] ____fput+0x15/0x20 [ 41.129203] task_work_run+0x199/0x270 [ 41.133053] ? task_work_cancel+0x210/0x210 [ 41.137337] ? free_nsproxy+0x185/0x1f0 [ 41.141275] ? switch_task_namespaces+0xa2/0xc0 [ 41.145910] do_exit+0xa52/0x1b40 [ 41.149328] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.154308] ? trace_hardirqs_on+0xd/0x10 [ 41.158422] ? kvfree+0x3b/0x60 [ 41.161668] ? mm_update_next_owner+0x930/0x930 [ 41.166300] ? rtnl_unlock+0xe/0x10 [ 41.169888] ? __tun_chr_ioctl+0x27a/0x3d20 [ 41.174176] ? tun_chr_read_iter+0x1e0/0x1e0 [ 41.178554] ? lock_downgrade+0x990/0x990 [ 41.182679] ? check_same_owner+0x320/0x320 [ 41.186963] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.191509] ? vmacache_find+0x61/0x270 [ 41.195448] ? tun_chr_compat_ioctl+0x30/0x30 [ 41.199906] ? tun_chr_ioctl+0x2a/0x40 [ 41.203755] ? tun_chr_ioctl+0x2a/0x40 [ 41.207617] ? do_vfs_ioctl+0x492/0x1530 [ 41.211642] ? ioctl_preallocate+0x2b0/0x2b0 [ 41.216015] ? selinux_capable+0x40/0x40 [ 41.220039] ? putname+0xf3/0x130 [ 41.223461] do_group_exit+0x149/0x400 [ 41.227311] ? SyS_exit+0x30/0x30 [ 41.230728] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.235712] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.240432] SyS_exit_group+0x1d/0x20 [ 41.244198] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.248917] RIP: 0033:0x445679 [ 41.252076] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 41.259745] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445679