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.6' (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.988296] ================================================================== [ 41.995729] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 42.002452] Write of size 8 at addr ffff8801ce5a3740 by task syzkaller223973/2985 [ 42.010038] [ 42.011642] CPU: 0 PID: 2985 Comm: syzkaller223973 Not tainted 4.13.0-mm1+ #7 [ 42.018882] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.028208] Call Trace: [ 42.030771] dump_stack+0x194/0x257 [ 42.034372] ? arch_local_irq_restore+0x53/0x53 [ 42.039013] ? show_regs_print_info+0x65/0x65 [ 42.043483] ? lock_timer_base+0x1a3/0x2b0 [ 42.047691] ? detach_if_pending+0x557/0x610 [ 42.052072] print_address_description+0x73/0x250 [ 42.056886] ? detach_if_pending+0x557/0x610 [ 42.061264] kasan_report+0x24e/0x340 [ 42.065038] __asan_report_store8_noabort+0x17/0x20 [ 42.070021] detach_if_pending+0x557/0x610 [ 42.074227] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.079386] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.084022] ? lock_timer_base+0x1a3/0x2b0 [ 42.088226] ? lock_timer_base+0x1eb/0x2b0 [ 42.092432] ? __internal_add_timer+0x2d0/0x2d0 [ 42.097075] ? trace_hardirqs_on+0xd/0x10 [ 42.101201] try_to_del_timer_sync+0xa2/0x120 [ 42.105666] ? del_timer+0x130/0x130 [ 42.109351] ? del_timer_sync+0xeb/0x240 [ 42.113387] del_timer_sync+0x18a/0x240 [ 42.117335] tun_free_netdev+0x105/0x1b0 [ 42.121367] ? tun_xdp+0x410/0x410 [ 42.124878] ? cpumask_next+0x24/0x30 [ 42.128652] ? netdev_refcnt_read+0xed/0x150 [ 42.133038] ? tun_xdp+0x410/0x410 [ 42.136551] netdev_run_todo+0x870/0xca0 [ 42.140583] ? do_group_exit+0x149/0x400 [ 42.144621] ? register_netdev+0x30/0x30 [ 42.148655] ? lock_downgrade+0x990/0x990 [ 42.152772] ? trace_hardirqs_on+0xd/0x10 [ 42.156907] ? refcount_sub_and_test+0x115/0x1b0 [ 42.161632] ? refcount_inc+0x50/0x50 [ 42.165403] ? refcount_inc+0x50/0x50 [ 42.169178] ? sk_destruct+0x4c/0x80 [ 42.172862] ? __sk_free+0x5c/0x230 [ 42.176458] ? sk_free+0x2f/0x40 [ 42.179795] ? __tun_detach+0x176/0x1390 [ 42.183837] ? tun_attach+0xf90/0xf90 [ 42.187611] ? do_raw_spin_trylock+0x190/0x190 [ 42.192165] ? locks_remove_file+0x3fa/0x5a0 [ 42.196546] ? fcntl_setlk+0x10d0/0x10d0 [ 42.200581] ? __fsnotify_parent+0xb4/0x3a0 [ 42.204878] ? fsnotify+0x1af0/0x1af0 [ 42.208653] ? __tun_detach+0x1390/0x1390 [ 42.212770] ? __tun_detach+0x1390/0x1390 [ 42.216887] rtnl_unlock+0xe/0x10 [ 42.220311] tun_chr_close+0x49/0x60 [ 42.223998] __fput+0x333/0x7f0 [ 42.227255] ? fput+0x140/0x140 [ 42.230507] ? check_same_owner+0x320/0x320 [ 42.234799] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.239269] ____fput+0x15/0x20 [ 42.242522] task_work_run+0x199/0x270 [ 42.246382] ? task_work_cancel+0x210/0x210 [ 42.250677] ? _raw_spin_unlock+0x22/0x30 [ 42.254793] ? switch_task_namespaces+0x87/0xc0 [ 42.259436] do_exit+0xa52/0x1b40 [ 42.262860] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.267850] ? check_noncircular+0x20/0x20 [ 42.272062] ? mm_update_next_owner+0x930/0x930 [ 42.276703] ? __pmd_alloc+0x4e0/0x4e0 [ 42.280572] ? find_held_lock+0x39/0x1d0 [ 42.284614] ? lock_downgrade+0x990/0x990 [ 42.288754] ? handle_mm_fault+0x410/0x8d0 [ 42.292957] ? down_read_trylock+0xdb/0x170 [ 42.297250] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.301801] ? vmacache_find+0x61/0x270 [ 42.305760] ? up_read+0x1a/0x40 [ 42.309098] ? __do_page_fault+0x35b/0xb60 [ 42.313302] ? do_vfs_ioctl+0x492/0x1530 [ 42.317339] ? do_page_fault+0xee/0x720 [ 42.321283] ? __do_page_fault+0xb60/0xb60 [ 42.325487] ? putname+0xf3/0x130 [ 42.328918] do_group_exit+0x149/0x400 [ 42.332774] ? lockdep_sys_exit+0x47/0xf0 [ 42.336890] ? SyS_exit+0x30/0x30 [ 42.340316] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.345303] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.350031] SyS_exit_group+0x1d/0x20 [ 42.353800] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.358523] RIP: 0033:0x4435b8 [ 42.361682] RSP: 002b:00007ffd6df83268 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 42.369362] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435b8 [ 42.376600] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 42.383840] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 42.391077] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 42.398318] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 42.405574] [ 42.407172] Allocated by task 2985: [ 42.410770] save_stack_trace+0x16/0x20 [ 42.414715] save_stack+0x43/0xd0 [ 42.418134] kasan_kmalloc+0xad/0xe0 [ 42.421814] __kmalloc_node+0x47/0x70 [ 42.425583] kvmalloc_node+0x64/0xd0 [ 42.429265] alloc_netdev_mqs+0x16e/0xed0 [ 42.433385] __tun_chr_ioctl+0x12be/0x3d20 [ 42.437587] tun_chr_ioctl+0x2a/0x40 [ 42.441267] do_vfs_ioctl+0x1b1/0x1530 [ 42.445122] SyS_ioctl+0x8f/0xc0 [ 42.448457] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.453178] [ 42.454776] Freed by task 2985: [ 42.458026] save_stack_trace+0x16/0x20 [ 42.461966] save_stack+0x43/0xd0 [ 42.465389] kasan_slab_free+0x71/0xc0 [ 42.469243] kfree+0xca/0x250 [ 42.472315] kvfree+0x36/0x60 [ 42.475388] free_netdev+0x2cf/0x360 [ 42.479069] __tun_chr_ioctl+0x2cf6/0x3d20 [ 42.483270] tun_chr_ioctl+0x2a/0x40 [ 42.486951] do_vfs_ioctl+0x1b1/0x1530 [ 42.490805] SyS_ioctl+0x8f/0xc0 [ 42.494139] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.498859] [ 42.500456] The buggy address belongs to the object at ffff8801ce5a0340 [ 42.500456] which belongs to the cache kmalloc-16384 of size 16384 [ 42.513426] The buggy address is located 13312 bytes inside of [ 42.513426] 16384-byte region [ffff8801ce5a0340, ffff8801ce5a4340) [ 42.525613] The buggy address belongs to the page: [ 42.530512] page:ffffea0007396800 count:1 mapcount:0 mapping:ffff8801ce5a0340 index:0x0 compound_mapcount: 0 [ 42.540458] flags: 0x200000000008100(slab|head) [ 42.545106] raw: 0200000000008100 ffff8801ce5a0340 0000000000000000 0000000100000001 [ 42.552963] raw: ffffea0007390e20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 42.560815] page dumped because: kasan: bad access detected [ 42.566498] [ 42.568093] Memory state around the buggy address: [ 42.572989] ffff8801ce5a3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.580315] ffff8801ce5a3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.587643] >ffff8801ce5a3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.594968] ^ [ 42.600383] ffff8801ce5a3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.607710] ffff8801ce5a3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.615035] ================================================================== [ 42.622360] Disabling lock debugging due to kernel taint [ 42.627773] Kernel panic - not syncing: panic_on_warn set ... [ 42.627773] [ 42.635099] CPU: 0 PID: 2985 Comm: syzkaller223973 Tainted: G B 4.13.0-mm1+ #7 [ 42.643551] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.652868] Call Trace: [ 42.655426] dump_stack+0x194/0x257 [ 42.659019] ? arch_local_irq_restore+0x53/0x53 [ 42.663657] ? vprintk_default+0x28/0x30 [ 42.667688] ? detach_if_pending+0x550/0x610 [ 42.672060] panic+0x1e4/0x417 [ 42.675215] ? __warn+0x1d9/0x1d9 [ 42.678640] ? detach_if_pending+0x557/0x610 [ 42.683011] kasan_end_report+0x50/0x50 [ 42.686949] kasan_report+0x137/0x340 [ 42.690715] __asan_report_store8_noabort+0x17/0x20 [ 42.695695] detach_if_pending+0x557/0x610 [ 42.699895] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.705069] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.709702] ? lock_timer_base+0x1a3/0x2b0 [ 42.713900] ? lock_timer_base+0x1eb/0x2b0 [ 42.718098] ? __internal_add_timer+0x2d0/0x2d0 [ 42.722735] ? trace_hardirqs_on+0xd/0x10 [ 42.726849] try_to_del_timer_sync+0xa2/0x120 [ 42.731306] ? del_timer+0x130/0x130 [ 42.734984] ? del_timer_sync+0xeb/0x240 [ 42.739011] del_timer_sync+0x18a/0x240 [ 42.742951] tun_free_netdev+0x105/0x1b0 [ 42.746976] ? tun_xdp+0x410/0x410 [ 42.750480] ? cpumask_next+0x24/0x30 [ 42.754246] ? netdev_refcnt_read+0xed/0x150 [ 42.758619] ? tun_xdp+0x410/0x410 [ 42.762123] netdev_run_todo+0x870/0xca0 [ 42.766147] ? do_group_exit+0x149/0x400 [ 42.770175] ? register_netdev+0x30/0x30 [ 42.774201] ? lock_downgrade+0x990/0x990 [ 42.778314] ? trace_hardirqs_on+0xd/0x10 [ 42.782436] ? refcount_sub_and_test+0x115/0x1b0 [ 42.787155] ? refcount_inc+0x50/0x50 [ 42.790919] ? refcount_inc+0x50/0x50 [ 42.794685] ? sk_destruct+0x4c/0x80 [ 42.798361] ? __sk_free+0x5c/0x230 [ 42.801951] ? sk_free+0x2f/0x40 [ 42.805280] ? __tun_detach+0x176/0x1390 [ 42.809309] ? tun_attach+0xf90/0xf90 [ 42.813074] ? do_raw_spin_trylock+0x190/0x190 [ 42.817621] ? locks_remove_file+0x3fa/0x5a0 [ 42.821994] ? fcntl_setlk+0x10d0/0x10d0 [ 42.826019] ? __fsnotify_parent+0xb4/0x3a0 [ 42.830675] ? fsnotify+0x1af0/0x1af0 [ 42.834443] ? __tun_detach+0x1390/0x1390 [ 42.838560] ? __tun_detach+0x1390/0x1390 [ 42.842674] rtnl_unlock+0xe/0x10 [ 42.846090] tun_chr_close+0x49/0x60 [ 42.849767] __fput+0x333/0x7f0 [ 42.853013] ? fput+0x140/0x140 [ 42.856260] ? check_same_owner+0x320/0x320 [ 42.860557] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.865018] ____fput+0x15/0x20 [ 42.868263] task_work_run+0x199/0x270 [ 42.872114] ? task_work_cancel+0x210/0x210 [ 42.876409] ? _raw_spin_unlock+0x22/0x30 [ 42.880522] ? switch_task_namespaces+0x87/0xc0 [ 42.885158] do_exit+0xa52/0x1b40 [ 42.888579] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.893563] ? check_noncircular+0x20/0x20 [ 42.897767] ? mm_update_next_owner+0x930/0x930 [ 42.902398] ? __pmd_alloc+0x4e0/0x4e0 [ 42.906264] ? find_held_lock+0x39/0x1d0 [ 42.910304] ? lock_downgrade+0x990/0x990 [ 42.914424] ? handle_mm_fault+0x410/0x8d0 [ 42.918633] ? down_read_trylock+0xdb/0x170 [ 42.922920] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.927468] ? vmacache_find+0x61/0x270 [ 42.931408] ? up_read+0x1a/0x40 [ 42.934739] ? __do_page_fault+0x35b/0xb60 [ 42.938938] ? do_vfs_ioctl+0x492/0x1530 [ 42.942972] ? do_page_fault+0xee/0x720 [ 42.946914] ? __do_page_fault+0xb60/0xb60 [ 42.951121] ? putname+0xf3/0x130 [ 42.954541] do_group_exit+0x149/0x400 [ 42.958394] ? lockdep_sys_exit+0x47/0xf0 [ 42.962504] ? SyS_exit+0x30/0x30 [ 42.965920] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.970901] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.975621] SyS_exit_group+0x1d/0x20 [ 42.979387] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.984105] RIP: 0033:0x4435b8