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-6,10.128.0.60' (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.105313] ================================================================== [ 40.112795] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.119530] Write of size 8 at addr ffff8801ce9b37c0 by task syzkaller136696/2988 [ 40.127123] [ 40.128730] CPU: 0 PID: 2988 Comm: syzkaller136696 Not tainted 4.13.0-next-20170907+ #17 [ 40.136931] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.146258] Call Trace: [ 40.148821] dump_stack+0x194/0x257 [ 40.152430] ? arch_local_irq_restore+0x53/0x53 [ 40.157073] ? show_regs_print_info+0x65/0x65 [ 40.161545] ? lock_timer_base+0x1a3/0x2b0 [ 40.165754] ? detach_if_pending+0x557/0x610 [ 40.170149] print_address_description+0x73/0x250 [ 40.174967] ? detach_if_pending+0x557/0x610 [ 40.179355] kasan_report+0x24e/0x340 [ 40.183152] __asan_report_store8_noabort+0x17/0x20 [ 40.188140] detach_if_pending+0x557/0x610 [ 40.192360] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.197525] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.202165] ? lock_timer_base+0x1a3/0x2b0 [ 40.206370] ? lock_timer_base+0x1eb/0x2b0 [ 40.210585] ? __internal_add_timer+0x2d0/0x2d0 [ 40.215228] ? trace_hardirqs_on+0xd/0x10 [ 40.219356] try_to_del_timer_sync+0xa2/0x120 [ 40.223823] ? del_timer+0x130/0x130 [ 40.227519] ? del_timer_sync+0xeb/0x240 [ 40.231587] del_timer_sync+0x18a/0x240 [ 40.235538] tun_free_netdev+0x105/0x1b0 [ 40.239572] ? tun_xdp+0x410/0x410 [ 40.243084] ? cpumask_next+0x24/0x30 [ 40.246859] ? netdev_refcnt_read+0xed/0x150 [ 40.251260] ? tun_xdp+0x410/0x410 [ 40.254772] netdev_run_todo+0x870/0xca0 [ 40.258818] ? do_group_exit+0x149/0x400 [ 40.262867] ? register_netdev+0x30/0x30 [ 40.267685] ? lock_downgrade+0x990/0x990 [ 40.271815] ? trace_hardirqs_on+0xd/0x10 [ 40.275962] ? refcount_sub_and_test+0x115/0x1b0 [ 40.280701] ? refcount_inc+0x50/0x50 [ 40.284474] ? refcount_inc+0x50/0x50 [ 40.288263] ? sk_destruct+0x4c/0x80 [ 40.291950] ? __sk_free+0x5c/0x230 [ 40.295551] ? sk_free+0x2f/0x40 [ 40.299153] ? __tun_detach+0x176/0x1390 [ 40.303198] ? tun_attach+0xf90/0xf90 [ 40.306983] ? locks_remove_file+0x3fa/0x5a0 [ 40.311368] ? fcntl_setlk+0x10d0/0x10d0 [ 40.315421] ? __fsnotify_parent+0xb4/0x3a0 [ 40.319718] ? fsnotify+0x1af0/0x1af0 [ 40.323504] ? __tun_detach+0x1390/0x1390 [ 40.327624] ? __tun_detach+0x1390/0x1390 [ 40.331747] rtnl_unlock+0xe/0x10 [ 40.335171] tun_chr_close+0x49/0x60 [ 40.338869] __fput+0x333/0x7f0 [ 40.342133] ? fput+0x140/0x140 [ 40.345386] ? check_same_owner+0x320/0x320 [ 40.349693] ____fput+0x15/0x20 [ 40.352947] task_work_run+0x199/0x270 [ 40.356811] ? task_work_cancel+0x210/0x210 [ 40.361107] ? free_nsproxy+0x185/0x1f0 [ 40.365056] ? switch_task_namespaces+0xa2/0xc0 [ 40.369702] do_exit+0xa52/0x1b40 [ 40.373136] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.378136] ? check_noncircular+0x20/0x20 [ 40.382358] ? mm_update_next_owner+0x930/0x930 [ 40.387347] ? __pmd_alloc+0x4e0/0x4e0 [ 40.391228] ? find_held_lock+0x39/0x1d0 [ 40.395273] ? lock_downgrade+0x990/0x990 [ 40.399425] ? handle_mm_fault+0x410/0x8d0 [ 40.403637] ? down_read_trylock+0xdb/0x170 [ 40.407931] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.412494] ? vmacache_find+0x61/0x270 [ 40.416439] ? vmacache_update+0xfe/0x130 [ 40.420564] ? up_read+0x1a/0x40 [ 40.423902] ? __do_page_fault+0x35b/0xb60 [ 40.428119] ? do_vfs_ioctl+0x492/0x1530 [ 40.432159] ? do_page_fault+0xee/0x720 [ 40.436113] ? __do_page_fault+0xb60/0xb60 [ 40.440319] ? putname+0xf3/0x130 [ 40.443768] do_group_exit+0x149/0x400 [ 40.447637] ? lockdep_sys_exit+0x47/0xf0 [ 40.451765] ? SyS_exit+0x30/0x30 [ 40.455203] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.460204] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.464934] SyS_exit_group+0x1d/0x20 [ 40.468719] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.473467] RIP: 0033:0x444ec9 [ 40.476632] RSP: 002b:00007ffc626bc508 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 40.484324] RAX: ffffffffffffffda RBX: 00007ffc626bc550 RCX: 0000000000444ec9 [ 40.491567] RDX: 0000000000444ec9 RSI: 000000002044e000 RDI: 0000000000000001 [ 40.498844] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffc626bc550 [ 40.506086] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402210 [ 40.513339] R13: 00000000004022a0 R14: 0000000000000000 R15: 0000000000000000 [ 40.520599] [ 40.522210] Allocated by task 2988: [ 40.525811] save_stack_trace+0x16/0x20 [ 40.529756] save_stack+0x43/0xd0 [ 40.533180] kasan_kmalloc+0xad/0xe0 [ 40.536865] __kmalloc_node+0x47/0x70 [ 40.540637] kvmalloc_node+0x64/0xd0 [ 40.544323] alloc_netdev_mqs+0x16e/0xed0 [ 40.548448] __tun_chr_ioctl+0x12be/0x3d20 [ 40.552653] tun_chr_ioctl+0x2a/0x40 [ 40.556348] do_vfs_ioctl+0x1b1/0x1530 [ 40.560208] SyS_ioctl+0x8f/0xc0 [ 40.563556] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.568280] [ 40.569879] Freed by task 2988: [ 40.573130] save_stack_trace+0x16/0x20 [ 40.577075] save_stack+0x43/0xd0 [ 40.580499] kasan_slab_free+0x71/0xc0 [ 40.584360] kfree+0xca/0x250 [ 40.587440] kvfree+0x36/0x60 [ 40.590520] free_netdev+0x2cf/0x360 [ 40.594204] __tun_chr_ioctl+0x2cf6/0x3d20 [ 40.598413] tun_chr_ioctl+0x2a/0x40 [ 40.602105] do_vfs_ioctl+0x1b1/0x1530 [ 40.605962] SyS_ioctl+0x8f/0xc0 [ 40.609300] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.614022] [ 40.615622] The buggy address belongs to the object at ffff8801ce9b03c0 [ 40.615622] which belongs to the cache kmalloc-16384 of size 16384 [ 40.628605] The buggy address is located 13312 bytes inside of [ 40.628605] 16384-byte region [ffff8801ce9b03c0, ffff8801ce9b43c0) [ 40.640902] The buggy address belongs to the page: [ 40.645802] page:ffffea00073a6c00 count:1 mapcount:0 mapping:ffff8801ce9b03c0 index:0x0 compound_mapcount: 0 [ 40.655749] flags: 0x200000000008100(slab|head) [ 40.660389] raw: 0200000000008100 ffff8801ce9b03c0 0000000000000000 0000000100000001 [ 40.668254] raw: ffffea0007396620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 40.676105] page dumped because: kasan: bad access detected [ 40.681781] [ 40.683381] Memory state around the buggy address: [ 40.688287] ffff8801ce9b3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.695632] ffff8801ce9b3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.702969] >ffff8801ce9b3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.710299] ^ [ 40.715720] ffff8801ce9b3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.723050] ffff8801ce9b3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.730381] ================================================================== [ 40.737710] Disabling lock debugging due to kernel taint [ 40.743124] Kernel panic - not syncing: panic_on_warn set ... [ 40.743124] [ 40.750453] CPU: 0 PID: 2988 Comm: syzkaller136696 Tainted: G B 4.13.0-next-20170907+ #17 [ 40.759862] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.769197] Call Trace: [ 40.771755] dump_stack+0x194/0x257 [ 40.775358] ? arch_local_irq_restore+0x53/0x53 [ 40.780003] ? vprintk_default+0x28/0x30 [ 40.784045] ? detach_if_pending+0x530/0x610 [ 40.788429] panic+0x1e4/0x417 [ 40.791588] ? __warn+0x1d9/0x1d9 [ 40.795014] ? detach_if_pending+0x557/0x610 [ 40.799403] kasan_end_report+0x50/0x50 [ 40.803355] kasan_report+0x137/0x340 [ 40.807124] __asan_report_store8_noabort+0x17/0x20 [ 40.812115] detach_if_pending+0x557/0x610 [ 40.816316] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.821481] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.826133] ? lock_timer_base+0x1a3/0x2b0 [ 40.830345] ? lock_timer_base+0x1eb/0x2b0 [ 40.834549] ? __internal_add_timer+0x2d0/0x2d0 [ 40.839184] ? trace_hardirqs_on+0xd/0x10 [ 40.843301] try_to_del_timer_sync+0xa2/0x120 [ 40.847764] ? del_timer+0x130/0x130 [ 40.851444] ? del_timer_sync+0xeb/0x240 [ 40.855476] del_timer_sync+0x18a/0x240 [ 40.859420] tun_free_netdev+0x105/0x1b0 [ 40.863447] ? tun_xdp+0x410/0x410 [ 40.866950] ? cpumask_next+0x24/0x30 [ 40.870718] ? netdev_refcnt_read+0xed/0x150 [ 40.875528] ? tun_xdp+0x410/0x410 [ 40.879034] netdev_run_todo+0x870/0xca0 [ 40.883073] ? do_group_exit+0x149/0x400 [ 40.887102] ? register_netdev+0x30/0x30 [ 40.891130] ? lock_downgrade+0x990/0x990 [ 40.895242] ? trace_hardirqs_on+0xd/0x10 [ 40.899364] ? refcount_sub_and_test+0x115/0x1b0 [ 40.904091] ? refcount_inc+0x50/0x50 [ 40.907857] ? refcount_inc+0x50/0x50 [ 40.911625] ? sk_destruct+0x4c/0x80 [ 40.915324] ? __sk_free+0x5c/0x230 [ 40.918917] ? sk_free+0x2f/0x40 [ 40.922249] ? __tun_detach+0x176/0x1390 [ 40.926282] ? tun_attach+0xf90/0xf90 [ 40.930055] ? locks_remove_file+0x3fa/0x5a0 [ 40.934430] ? fcntl_setlk+0x10d0/0x10d0 [ 40.938458] ? __fsnotify_parent+0xb4/0x3a0 [ 40.942745] ? fsnotify+0x1af0/0x1af0 [ 40.946513] ? __tun_detach+0x1390/0x1390 [ 40.950637] ? __tun_detach+0x1390/0x1390 [ 40.954751] rtnl_unlock+0xe/0x10 [ 40.958169] tun_chr_close+0x49/0x60 [ 40.961848] __fput+0x333/0x7f0 [ 40.965105] ? fput+0x140/0x140 [ 40.968353] ? check_same_owner+0x320/0x320 [ 40.972642] ____fput+0x15/0x20 [ 40.975889] task_work_run+0x199/0x270 [ 40.979743] ? task_work_cancel+0x210/0x210 [ 40.984041] ? free_nsproxy+0x185/0x1f0 [ 40.988001] ? switch_task_namespaces+0xa2/0xc0 [ 40.992649] do_exit+0xa52/0x1b40 [ 40.996071] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.001056] ? check_noncircular+0x20/0x20 [ 41.005262] ? mm_update_next_owner+0x930/0x930 [ 41.009896] ? __pmd_alloc+0x4e0/0x4e0 [ 41.013754] ? find_held_lock+0x39/0x1d0 [ 41.017786] ? lock_downgrade+0x990/0x990 [ 41.021912] ? handle_mm_fault+0x410/0x8d0 [ 41.026112] ? down_read_trylock+0xdb/0x170 [ 41.030409] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.034956] ? vmacache_find+0x61/0x270 [ 41.038895] ? vmacache_update+0xfe/0x130 [ 41.043010] ? up_read+0x1a/0x40 [ 41.046345] ? __do_page_fault+0x35b/0xb60 [ 41.050545] ? do_vfs_ioctl+0x492/0x1530 [ 41.054576] ? do_page_fault+0xee/0x720 [ 41.058516] ? __do_page_fault+0xb60/0xb60 [ 41.062714] ? putname+0xf3/0x130 [ 41.066135] do_group_exit+0x149/0x400 [ 41.069989] ? lockdep_sys_exit+0x47/0xf0 [ 41.074102] ? SyS_exit+0x30/0x30 [ 41.077521] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.082525] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.087248] SyS_exit_group+0x1d/0x20 [ 41.091015] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.095743] RIP: 0033:0x444ec9 [ 41.098899] RSP: 002b:00007ffc626bc508 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7