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-6,10.128.15.227' (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.706393] ================================================================== [ 40.713812] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.720538] Write of size 8 at addr ffff8801ce17b740 by task syzkaller780075/2984 [ 40.728217] [ 40.729820] CPU: 0 PID: 2984 Comm: syzkaller780075 Not tainted 4.13.0-mm1+ #7 [ 40.737064] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.746398] Call Trace: [ 40.748962] dump_stack+0x194/0x257 [ 40.752573] ? arch_local_irq_restore+0x53/0x53 [ 40.757216] ? show_regs_print_info+0x65/0x65 [ 40.761694] ? lock_timer_base+0x1a3/0x2b0 [ 40.765905] ? detach_if_pending+0x557/0x610 [ 40.770296] print_address_description+0x73/0x250 [ 40.775119] ? detach_if_pending+0x557/0x610 [ 40.779499] kasan_report+0x24e/0x340 [ 40.783286] __asan_report_store8_noabort+0x17/0x20 [ 40.788272] detach_if_pending+0x557/0x610 [ 40.792481] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.797643] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.802288] ? lock_timer_base+0x1a3/0x2b0 [ 40.806493] ? lock_timer_base+0x1eb/0x2b0 [ 40.810703] ? __internal_add_timer+0x2d0/0x2d0 [ 40.815349] ? trace_hardirqs_on+0xd/0x10 [ 40.819475] try_to_del_timer_sync+0xa2/0x120 [ 40.823944] ? del_timer+0x130/0x130 [ 40.827630] ? del_timer_sync+0xeb/0x240 [ 40.831669] del_timer_sync+0x18a/0x240 [ 40.835615] tun_free_netdev+0x105/0x1b0 [ 40.839645] ? tun_xdp+0x410/0x410 [ 40.843159] ? cpumask_next+0x24/0x30 [ 40.846933] ? netdev_refcnt_read+0xed/0x150 [ 40.851405] ? tun_xdp+0x410/0x410 [ 40.854916] netdev_run_todo+0x870/0xca0 [ 40.858946] ? do_group_exit+0x149/0x400 [ 40.862982] ? register_netdev+0x30/0x30 [ 40.867017] ? lock_downgrade+0x990/0x990 [ 40.871135] ? trace_hardirqs_on+0xd/0x10 [ 40.875269] ? refcount_sub_and_test+0x115/0x1b0 [ 40.879995] ? refcount_inc+0x50/0x50 [ 40.883769] ? refcount_inc+0x50/0x50 [ 40.887547] ? sk_destruct+0x4c/0x80 [ 40.891230] ? __sk_free+0x5c/0x230 [ 40.894826] ? sk_free+0x2f/0x40 [ 40.898162] ? __tun_detach+0x176/0x1390 [ 40.902203] ? tun_attach+0xf90/0xf90 [ 40.905978] ? do_raw_spin_trylock+0x190/0x190 [ 40.910542] ? locks_remove_file+0x3fa/0x5a0 [ 40.914923] ? fcntl_setlk+0x10d0/0x10d0 [ 40.918955] ? __fsnotify_parent+0xb4/0x3a0 [ 40.923250] ? fsnotify+0x1af0/0x1af0 [ 40.927024] ? __tun_detach+0x1390/0x1390 [ 40.931147] ? __tun_detach+0x1390/0x1390 [ 40.935264] rtnl_unlock+0xe/0x10 [ 40.938686] tun_chr_close+0x49/0x60 [ 40.942368] __fput+0x333/0x7f0 [ 40.945622] ? fput+0x140/0x140 [ 40.948874] ? check_same_owner+0x320/0x320 [ 40.953164] ? _raw_spin_unlock_irq+0x27/0x70 [ 40.957645] ____fput+0x15/0x20 [ 40.960895] task_work_run+0x199/0x270 [ 40.964757] ? task_work_cancel+0x210/0x210 [ 40.969053] ? _raw_spin_unlock+0x22/0x30 [ 40.973170] ? switch_task_namespaces+0x87/0xc0 [ 40.977819] do_exit+0xa52/0x1b40 [ 40.981242] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.986230] ? check_noncircular+0x20/0x20 [ 40.990445] ? mm_update_next_owner+0x930/0x930 [ 40.995084] ? __pmd_alloc+0x4e0/0x4e0 [ 40.998952] ? find_held_lock+0x39/0x1d0 [ 41.003000] ? lock_downgrade+0x990/0x990 [ 41.007143] ? handle_mm_fault+0x410/0x8d0 [ 41.011347] ? down_read_trylock+0xdb/0x170 [ 41.015639] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.020188] ? vmacache_find+0x61/0x270 [ 41.024145] ? up_read+0x1a/0x40 [ 41.027482] ? __do_page_fault+0x35b/0xb60 [ 41.031690] ? do_vfs_ioctl+0x492/0x1530 [ 41.035730] ? do_page_fault+0xee/0x720 [ 41.039675] ? __do_page_fault+0xb60/0xb60 [ 41.043879] ? putname+0xf3/0x130 [ 41.047314] do_group_exit+0x149/0x400 [ 41.051170] ? lockdep_sys_exit+0x47/0xf0 [ 41.055288] ? SyS_exit+0x30/0x30 [ 41.058712] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.063699] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.068430] SyS_exit_group+0x1d/0x20 [ 41.072204] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.076930] RIP: 0033:0x443ba8 [ 41.080092] RSP: 002b:00007ffdbd06e208 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 41.087773] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ba8 [ 41.095013] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 41.102254] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 41.109499] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 41.116746] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 41.124004] [ 41.125604] Allocated by task 2984: [ 41.129204] save_stack_trace+0x16/0x20 [ 41.133148] save_stack+0x43/0xd0 [ 41.136567] kasan_kmalloc+0xad/0xe0 [ 41.140250] __kmalloc_node+0x47/0x70 [ 41.144018] kvmalloc_node+0x64/0xd0 [ 41.147720] alloc_netdev_mqs+0x16e/0xed0 [ 41.151836] __tun_chr_ioctl+0x12be/0x3d20 [ 41.156043] tun_chr_ioctl+0x2a/0x40 [ 41.159724] do_vfs_ioctl+0x1b1/0x1530 [ 41.163577] SyS_ioctl+0x8f/0xc0 [ 41.166912] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.171631] [ 41.173227] Freed by task 2984: [ 41.176474] save_stack_trace+0x16/0x20 [ 41.180414] save_stack+0x43/0xd0 [ 41.183835] kasan_slab_free+0x71/0xc0 [ 41.187689] kfree+0xca/0x250 [ 41.190761] kvfree+0x36/0x60 [ 41.193837] free_netdev+0x2cf/0x360 [ 41.197518] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.201721] tun_chr_ioctl+0x2a/0x40 [ 41.205404] do_vfs_ioctl+0x1b1/0x1530 [ 41.209258] SyS_ioctl+0x8f/0xc0 [ 41.212593] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.217313] [ 41.218909] The buggy address belongs to the object at ffff8801ce178340 [ 41.218909] which belongs to the cache kmalloc-16384 of size 16384 [ 41.231879] The buggy address is located 13312 bytes inside of [ 41.231879] 16384-byte region [ffff8801ce178340, ffff8801ce17c340) [ 41.244068] The buggy address belongs to the page: [ 41.249138] page:ffffea0007385e00 count:1 mapcount:0 mapping:ffff8801ce178340 index:0x0 compound_mapcount: 0 [ 41.259078] flags: 0x200000000008100(slab|head) [ 41.263717] raw: 0200000000008100 ffff8801ce178340 0000000000000000 0000000100000001 [ 41.271573] raw: ffffea0007385220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.279418] page dumped because: kasan: bad access detected [ 41.285095] [ 41.286693] Memory state around the buggy address: [ 41.291588] ffff8801ce17b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.298914] ffff8801ce17b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.306241] >ffff8801ce17b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.313566] ^ [ 41.318983] ffff8801ce17b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.326311] ffff8801ce17b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.333634] ================================================================== [ 41.340959] Disabling lock debugging due to kernel taint [ 41.346372] Kernel panic - not syncing: panic_on_warn set ... [ 41.346372] [ 41.353697] CPU: 0 PID: 2984 Comm: syzkaller780075 Tainted: G B 4.13.0-mm1+ #7 [ 41.362146] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.371466] Call Trace: [ 41.374025] dump_stack+0x194/0x257 [ 41.377618] ? arch_local_irq_restore+0x53/0x53 [ 41.382254] ? vprintk_default+0x28/0x30 [ 41.386282] ? detach_if_pending+0x550/0x610 [ 41.390655] panic+0x1e4/0x417 [ 41.393812] ? __warn+0x1d9/0x1d9 [ 41.397234] ? detach_if_pending+0x557/0x610 [ 41.401607] kasan_end_report+0x50/0x50 [ 41.405544] kasan_report+0x137/0x340 [ 41.409311] __asan_report_store8_noabort+0x17/0x20 [ 41.414291] detach_if_pending+0x557/0x610 [ 41.418490] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.423644] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.428276] ? lock_timer_base+0x1a3/0x2b0 [ 41.432474] ? lock_timer_base+0x1eb/0x2b0 [ 41.436676] ? __internal_add_timer+0x2d0/0x2d0 [ 41.441313] ? trace_hardirqs_on+0xd/0x10 [ 41.445428] try_to_del_timer_sync+0xa2/0x120 [ 41.449887] ? del_timer+0x130/0x130 [ 41.453566] ? del_timer_sync+0xeb/0x240 [ 41.457591] del_timer_sync+0x18a/0x240 [ 41.461533] tun_free_netdev+0x105/0x1b0 [ 41.465558] ? tun_xdp+0x410/0x410 [ 41.469061] ? cpumask_next+0x24/0x30 [ 41.472828] ? netdev_refcnt_read+0xed/0x150 [ 41.477204] ? tun_xdp+0x410/0x410 [ 41.480708] netdev_run_todo+0x870/0xca0 [ 41.484732] ? do_group_exit+0x149/0x400 [ 41.488760] ? register_netdev+0x30/0x30 [ 41.492788] ? lock_downgrade+0x990/0x990 [ 41.496897] ? trace_hardirqs_on+0xd/0x10 [ 41.501019] ? refcount_sub_and_test+0x115/0x1b0 [ 41.505739] ? refcount_inc+0x50/0x50 [ 41.509502] ? refcount_inc+0x50/0x50 [ 41.513279] ? sk_destruct+0x4c/0x80 [ 41.516957] ? __sk_free+0x5c/0x230 [ 41.520546] ? sk_free+0x2f/0x40 [ 41.523878] ? __tun_detach+0x176/0x1390 [ 41.527907] ? tun_attach+0xf90/0xf90 [ 41.531676] ? do_raw_spin_trylock+0x190/0x190 [ 41.536223] ? locks_remove_file+0x3fa/0x5a0 [ 41.540596] ? fcntl_setlk+0x10d0/0x10d0 [ 41.544620] ? __fsnotify_parent+0xb4/0x3a0 [ 41.548907] ? fsnotify+0x1af0/0x1af0 [ 41.552671] ? __tun_detach+0x1390/0x1390 [ 41.556781] ? __tun_detach+0x1390/0x1390 [ 41.560891] rtnl_unlock+0xe/0x10 [ 41.564309] tun_chr_close+0x49/0x60 [ 41.567988] __fput+0x333/0x7f0 [ 41.571237] ? fput+0x140/0x140 [ 41.574482] ? check_same_owner+0x320/0x320 [ 41.578769] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.583317] ____fput+0x15/0x20 [ 41.586569] task_work_run+0x199/0x270 [ 41.590422] ? task_work_cancel+0x210/0x210 [ 41.594708] ? _raw_spin_unlock+0x22/0x30 [ 41.598829] ? switch_task_namespaces+0x87/0xc0 [ 41.603467] do_exit+0xa52/0x1b40 [ 41.606884] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.611866] ? check_noncircular+0x20/0x20 [ 41.616069] ? mm_update_next_owner+0x930/0x930 [ 41.620702] ? __pmd_alloc+0x4e0/0x4e0 [ 41.624557] ? find_held_lock+0x39/0x1d0 [ 41.628593] ? lock_downgrade+0x990/0x990 [ 41.632715] ? handle_mm_fault+0x410/0x8d0 [ 41.636913] ? down_read_trylock+0xdb/0x170 [ 41.641286] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.645833] ? vmacache_find+0x61/0x270 [ 41.649911] ? up_read+0x1a/0x40 [ 41.653243] ? __do_page_fault+0x35b/0xb60 [ 41.657440] ? do_vfs_ioctl+0x492/0x1530 [ 41.661467] ? do_page_fault+0xee/0x720 [ 41.665413] ? __do_page_fault+0xb60/0xb60 [ 41.669612] ? putname+0xf3/0x130 [ 41.673034] do_group_exit+0x149/0x400 [ 41.676888] ? lockdep_sys_exit+0x47/0xf0 [ 41.680999] ? SyS_exit+0x30/0x30 [ 41.684419] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.689398] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.694119] SyS_exit_group+0x1d/0x20 [ 41.697886] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.702606] RIP: 0033:0x443ba8