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-next-kasan-gce-2,10.128.15.213' (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: [ 41.009460] ================================================================== [ 41.016927] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.023653] Write of size 8 at addr ffff8801ce29b780 by task syzkaller335487/2983 [ 41.031244] [ 41.032848] CPU: 0 PID: 2983 Comm: syzkaller335487 Not tainted 4.13.0-next-20170906+ #16 [ 41.041235] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.050565] Call Trace: [ 41.053129] dump_stack+0x194/0x257 [ 41.056734] ? arch_local_irq_restore+0x53/0x53 [ 41.061380] ? show_regs_print_info+0x65/0x65 [ 41.065854] ? lock_timer_base+0x1a3/0x2b0 [ 41.070067] ? detach_if_pending+0x557/0x610 [ 41.074453] print_address_description+0x73/0x250 [ 41.079275] ? detach_if_pending+0x557/0x610 [ 41.083659] kasan_report+0x24e/0x340 [ 41.087443] __asan_report_store8_noabort+0x17/0x20 [ 41.092434] detach_if_pending+0x557/0x610 [ 41.096647] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.101814] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.106457] ? lock_timer_base+0x1a3/0x2b0 [ 41.110668] ? lock_timer_base+0x1eb/0x2b0 [ 41.114881] ? __internal_add_timer+0x2d0/0x2d0 [ 41.119529] ? trace_hardirqs_on+0xd/0x10 [ 41.123664] try_to_del_timer_sync+0xa2/0x120 [ 41.128136] ? del_timer+0x130/0x130 [ 41.131828] ? del_timer_sync+0xeb/0x240 [ 41.135872] del_timer_sync+0x18a/0x240 [ 41.139827] tun_free_netdev+0x105/0x1b0 [ 41.143863] ? tun_xdp+0x410/0x410 [ 41.147378] ? cpumask_next+0x24/0x30 [ 41.151157] ? netdev_refcnt_read+0xed/0x150 [ 41.155546] ? tun_xdp+0x410/0x410 [ 41.159064] netdev_run_todo+0x870/0xca0 [ 41.163112] ? do_group_exit+0x149/0x400 [ 41.167156] ? register_netdev+0x30/0x30 [ 41.171196] ? lock_downgrade+0x990/0x990 [ 41.175323] ? trace_hardirqs_on+0xd/0x10 [ 41.179466] ? refcount_sub_and_test+0x115/0x1b0 [ 41.184202] ? refcount_inc+0x50/0x50 [ 41.187976] ? refcount_inc+0x50/0x50 [ 41.191755] ? sk_destruct+0x4c/0x80 [ 41.195656] ? __sk_free+0x5c/0x230 [ 41.199261] ? sk_free+0x2f/0x40 [ 41.202609] ? __tun_detach+0x176/0x1390 [ 41.206659] ? tun_attach+0xf90/0xf90 [ 41.210444] ? do_raw_spin_trylock+0x190/0x190 [ 41.215006] ? locks_remove_file+0x3fa/0x5a0 [ 41.219393] ? fcntl_setlk+0x10d0/0x10d0 [ 41.223436] ? __fsnotify_parent+0xb4/0x3a0 [ 41.227755] ? fsnotify+0x1af0/0x1af0 [ 41.231542] ? __tun_detach+0x1390/0x1390 [ 41.235664] ? __tun_detach+0x1390/0x1390 [ 41.239790] rtnl_unlock+0xe/0x10 [ 41.243221] tun_chr_close+0x49/0x60 [ 41.246911] __fput+0x333/0x7f0 [ 41.250171] ? fput+0x140/0x140 [ 41.253430] ? check_same_owner+0x320/0x320 [ 41.257729] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.262207] ____fput+0x15/0x20 [ 41.265465] task_work_run+0x199/0x270 [ 41.269340] ? task_work_cancel+0x210/0x210 [ 41.273643] ? _raw_spin_unlock+0x22/0x30 [ 41.277769] ? switch_task_namespaces+0x87/0xc0 [ 41.282420] do_exit+0xa52/0x1b40 [ 41.285849] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.290845] ? check_noncircular+0x20/0x20 [ 41.295064] ? mm_update_next_owner+0x930/0x930 [ 41.299712] ? __pmd_alloc+0x4e0/0x4e0 [ 41.303590] ? find_held_lock+0x39/0x1d0 [ 41.307651] ? lock_downgrade+0x990/0x990 [ 41.311801] ? handle_mm_fault+0x4a2/0x860 [ 41.316010] ? down_read_trylock+0xdb/0x170 [ 41.320310] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.324871] ? vmacache_find+0x61/0x270 [ 41.328830] ? up_read+0x1a/0x40 [ 41.332177] ? __do_page_fault+0x35b/0xb60 [ 41.336389] ? do_vfs_ioctl+0x492/0x1530 [ 41.340438] ? do_page_fault+0xee/0x720 [ 41.344390] ? __do_page_fault+0xb60/0xb60 [ 41.348606] ? putname+0xf3/0x130 [ 41.352043] do_group_exit+0x149/0x400 [ 41.355908] ? lockdep_sys_exit+0x47/0xf0 [ 41.360033] ? SyS_exit+0x30/0x30 [ 41.363466] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.368474] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.373225] SyS_exit_group+0x1d/0x20 [ 41.377007] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.381737] RIP: 0033:0x443bf8 [ 41.384902] RSP: 002b:00007ffdf4ce66d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 41.392589] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443bf8 [ 41.399836] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 41.407083] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 41.414331] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 41.421576] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 41.428842] [ 41.430457] Allocated by task 2983: [ 41.434064] save_stack_trace+0x16/0x20 [ 41.438023] save_stack+0x43/0xd0 [ 41.441451] kasan_kmalloc+0xad/0xe0 [ 41.445157] __kmalloc_node+0x47/0x70 [ 41.448931] kvmalloc_node+0x64/0xd0 [ 41.452621] alloc_netdev_mqs+0x16e/0xed0 [ 41.456743] __tun_chr_ioctl+0x12be/0x3d20 [ 41.460958] tun_chr_ioctl+0x2a/0x40 [ 41.464646] do_vfs_ioctl+0x1b1/0x1530 [ 41.468508] SyS_ioctl+0x8f/0xc0 [ 41.471851] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.476579] [ 41.478179] Freed by task 2983: [ 41.481432] save_stack_trace+0x16/0x20 [ 41.485380] save_stack+0x43/0xd0 [ 41.488809] kasan_slab_free+0x71/0xc0 [ 41.492670] kfree+0xca/0x250 [ 41.495749] kvfree+0x36/0x60 [ 41.498839] free_netdev+0x2cf/0x360 [ 41.502529] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.506740] tun_chr_ioctl+0x2a/0x40 [ 41.510441] do_vfs_ioctl+0x1b1/0x1530 [ 41.514305] SyS_ioctl+0x8f/0xc0 [ 41.517646] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.522373] [ 41.523976] The buggy address belongs to the object at ffff8801ce298380 [ 41.523976] which belongs to the cache kmalloc-16384 of size 16384 [ 41.536951] The buggy address is located 13312 bytes inside of [ 41.536951] 16384-byte region [ffff8801ce298380, ffff8801ce29c380) [ 41.549143] The buggy address belongs to the page: [ 41.554046] page:ffffea000738a600 count:1 mapcount:0 mapping:ffff8801ce298380 index:0x0 compound_mapcount: 0 [ 41.563995] flags: 0x200000000008100(slab|head) [ 41.568638] raw: 0200000000008100 ffff8801ce298380 0000000000000000 0000000100000001 [ 41.576495] raw: ffffea0007374820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.584348] page dumped because: kasan: bad access detected [ 41.590028] [ 41.591627] Memory state around the buggy address: [ 41.596530] ffff8801ce29b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.603862] ffff8801ce29b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.611193] >ffff8801ce29b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.618531] ^ [ 41.621868] ffff8801ce29b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.629198] ffff8801ce29b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.636968] ================================================================== [ 41.644300] Disabling lock debugging due to kernel taint [ 41.649736] Kernel panic - not syncing: panic_on_warn set ... [ 41.649736] [ 41.657069] CPU: 0 PID: 2983 Comm: syzkaller335487 Tainted: G B 4.13.0-next-20170906+ #16 [ 41.666476] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.675801] Call Trace: [ 41.678368] dump_stack+0x194/0x257 [ 41.681972] ? arch_local_irq_restore+0x53/0x53 [ 41.686659] ? vprintk_default+0x28/0x30 [ 41.690725] ? detach_if_pending+0x530/0x610 [ 41.695107] panic+0x1e4/0x417 [ 41.698268] ? __warn+0x1d9/0x1d9 [ 41.701701] ? detach_if_pending+0x557/0x610 [ 41.706079] kasan_end_report+0x50/0x50 [ 41.710023] kasan_report+0x137/0x340 [ 41.713794] __asan_report_store8_noabort+0x17/0x20 [ 41.718784] detach_if_pending+0x557/0x610 [ 41.722996] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.728155] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.732794] ? lock_timer_base+0x1a3/0x2b0 [ 41.736999] ? lock_timer_base+0x1eb/0x2b0 [ 41.741206] ? __internal_add_timer+0x2d0/0x2d0 [ 41.745846] ? trace_hardirqs_on+0xd/0x10 [ 41.749966] try_to_del_timer_sync+0xa2/0x120 [ 41.754432] ? del_timer+0x130/0x130 [ 41.758119] ? del_timer_sync+0xeb/0x240 [ 41.762165] del_timer_sync+0x18a/0x240 [ 41.766114] tun_free_netdev+0x105/0x1b0 [ 41.770146] ? tun_xdp+0x410/0x410 [ 41.773663] ? cpumask_next+0x24/0x30 [ 41.777436] ? netdev_refcnt_read+0xed/0x150 [ 41.781816] ? tun_xdp+0x410/0x410 [ 41.785327] netdev_run_todo+0x870/0xca0 [ 41.789361] ? do_group_exit+0x149/0x400 [ 41.793393] ? register_netdev+0x30/0x30 [ 41.797428] ? lock_downgrade+0x990/0x990 [ 41.801548] ? trace_hardirqs_on+0xd/0x10 [ 41.805676] ? refcount_sub_and_test+0x115/0x1b0 [ 41.810402] ? refcount_inc+0x50/0x50 [ 41.814170] ? refcount_inc+0x50/0x50 [ 41.817947] ? sk_destruct+0x4c/0x80 [ 41.821632] ? __sk_free+0x5c/0x230 [ 41.825229] ? sk_free+0x2f/0x40 [ 41.828571] ? __tun_detach+0x176/0x1390 [ 41.832639] ? tun_attach+0xf90/0xf90 [ 41.836431] ? do_raw_spin_trylock+0x190/0x190 [ 41.840989] ? locks_remove_file+0x3fa/0x5a0 [ 41.845379] ? fcntl_setlk+0x10d0/0x10d0 [ 41.849422] ? __fsnotify_parent+0xb4/0x3a0 [ 41.853717] ? fsnotify+0x1af0/0x1af0 [ 41.857499] ? __tun_detach+0x1390/0x1390 [ 41.861619] ? __tun_detach+0x1390/0x1390 [ 41.865742] rtnl_unlock+0xe/0x10 [ 41.869170] tun_chr_close+0x49/0x60 [ 41.872854] __fput+0x333/0x7f0 [ 41.876103] ? fput+0x140/0x140 [ 41.879372] ? check_same_owner+0x320/0x320 [ 41.883674] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.888146] ____fput+0x15/0x20 [ 41.891398] task_work_run+0x199/0x270 [ 41.895259] ? task_work_cancel+0x210/0x210 [ 41.899566] ? _raw_spin_unlock+0x22/0x30 [ 41.903683] ? switch_task_namespaces+0x87/0xc0 [ 41.908326] do_exit+0xa52/0x1b40 [ 41.911752] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.916741] ? check_noncircular+0x20/0x20 [ 41.920955] ? mm_update_next_owner+0x930/0x930 [ 41.925593] ? __pmd_alloc+0x4e0/0x4e0 [ 41.929456] ? find_held_lock+0x39/0x1d0 [ 41.933497] ? lock_downgrade+0x990/0x990 [ 41.937624] ? handle_mm_fault+0x4a2/0x860 [ 41.941826] ? down_read_trylock+0xdb/0x170 [ 41.946118] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.950674] ? vmacache_find+0x61/0x270 [ 41.954627] ? up_read+0x1a/0x40 [ 41.957961] ? __do_page_fault+0x35b/0xb60 [ 41.962175] ? do_vfs_ioctl+0x492/0x1530 [ 41.966221] ? do_page_fault+0xee/0x720 [ 41.970165] ? __do_page_fault+0xb60/0xb60 [ 41.974382] ? putname+0xf3/0x130 [ 41.977808] do_group_exit+0x149/0x400 [ 41.981665] ? lockdep_sys_exit+0x47/0xf0 [ 41.985780] ? SyS_exit+0x30/0x30 [ 41.989202] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.994199] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.998952] SyS_exit_group+0x1d/0x20 [ 42.002730] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.007455] RIP: 0033:0x443bf8