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-2,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: [ 39.200238] ================================================================== [ 39.207697] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 39.214423] Write of size 8 at addr ffff8801ce7d37c0 by task syzkaller814460/2986 [ 39.222010] [ 39.223612] CPU: 0 PID: 2986 Comm: syzkaller814460 Not tainted 4.13.0-mm1+ #7 [ 39.230855] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 39.240182] Call Trace: [ 39.242746] dump_stack+0x194/0x257 [ 39.246352] ? arch_local_irq_restore+0x53/0x53 [ 39.250994] ? show_regs_print_info+0x65/0x65 [ 39.255462] ? lock_timer_base+0x1a3/0x2b0 [ 39.259670] ? detach_if_pending+0x557/0x610 [ 39.264051] print_address_description+0x73/0x250 [ 39.268866] ? detach_if_pending+0x557/0x610 [ 39.273244] kasan_report+0x24e/0x340 [ 39.277019] __asan_report_store8_noabort+0x17/0x20 [ 39.282003] detach_if_pending+0x557/0x610 [ 39.286213] ? trace_raw_output_tick_stop+0x130/0x130 [ 39.291374] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 39.296013] ? lock_timer_base+0x1a3/0x2b0 [ 39.300219] ? lock_timer_base+0x1eb/0x2b0 [ 39.304429] ? __internal_add_timer+0x2d0/0x2d0 [ 39.309073] ? trace_hardirqs_on+0xd/0x10 [ 39.313197] try_to_del_timer_sync+0xa2/0x120 [ 39.317670] ? del_timer+0x130/0x130 [ 39.321356] ? del_timer_sync+0xeb/0x240 [ 39.325396] del_timer_sync+0x18a/0x240 [ 39.329343] tun_free_netdev+0x105/0x1b0 [ 39.333373] ? tun_xdp+0x410/0x410 [ 39.336882] ? cpumask_next+0x24/0x30 [ 39.340657] ? netdev_refcnt_read+0xed/0x150 [ 39.345040] ? tun_xdp+0x410/0x410 [ 39.348551] netdev_run_todo+0x870/0xca0 [ 39.352581] ? do_group_exit+0x149/0x400 [ 39.356617] ? register_netdev+0x30/0x30 [ 39.360651] ? lock_downgrade+0x990/0x990 [ 39.364771] ? trace_hardirqs_on+0xd/0x10 [ 39.368906] ? refcount_sub_and_test+0x115/0x1b0 [ 39.373634] ? refcount_inc+0x50/0x50 [ 39.377405] ? refcount_inc+0x50/0x50 [ 39.381183] ? sk_destruct+0x4c/0x80 [ 39.384867] ? __sk_free+0x5c/0x230 [ 39.388466] ? sk_free+0x2f/0x40 [ 39.391804] ? __tun_detach+0x176/0x1390 [ 39.395851] ? tun_attach+0xf90/0xf90 [ 39.399630] ? locks_remove_file+0x3fa/0x5a0 [ 39.404010] ? fcntl_setlk+0x10d0/0x10d0 [ 39.408045] ? __fsnotify_parent+0xb4/0x3a0 [ 39.412337] ? fsnotify+0x1af0/0x1af0 [ 39.416111] ? __tun_detach+0x1390/0x1390 [ 39.420230] ? __tun_detach+0x1390/0x1390 [ 39.424349] rtnl_unlock+0xe/0x10 [ 39.427770] tun_chr_close+0x49/0x60 [ 39.431454] __fput+0x333/0x7f0 [ 39.434711] ? fput+0x140/0x140 [ 39.437962] ? check_same_owner+0x320/0x320 [ 39.442260] ____fput+0x15/0x20 [ 39.445511] task_work_run+0x199/0x270 [ 39.449373] ? task_work_cancel+0x210/0x210 [ 39.453665] ? free_nsproxy+0x185/0x1f0 [ 39.457609] ? switch_task_namespaces+0xa2/0xc0 [ 39.462254] do_exit+0xa52/0x1b40 [ 39.465678] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 39.470665] ? check_noncircular+0x20/0x20 [ 39.474880] ? mm_update_next_owner+0x930/0x930 [ 39.479519] ? __pmd_alloc+0x4e0/0x4e0 [ 39.483386] ? find_held_lock+0x39/0x1d0 [ 39.487428] ? lock_downgrade+0x990/0x990 [ 39.491565] ? handle_mm_fault+0x410/0x8d0 [ 39.495770] ? down_read_trylock+0xdb/0x170 [ 39.500079] ? __handle_mm_fault+0x39c0/0x39c0 [ 39.504633] ? vmacache_find+0x61/0x270 [ 39.508576] ? vmacache_update+0xfe/0x130 [ 39.512701] ? up_read+0x1a/0x40 [ 39.516039] ? __do_page_fault+0x35b/0xb60 [ 39.520257] ? do_vfs_ioctl+0x492/0x1530 [ 39.524296] ? do_page_fault+0xee/0x720 [ 39.528242] ? __do_page_fault+0xb60/0xb60 [ 39.532446] ? putname+0xf3/0x130 [ 39.535876] do_group_exit+0x149/0x400 [ 39.539734] ? lockdep_sys_exit+0x47/0xf0 [ 39.543852] ? SyS_exit+0x30/0x30 [ 39.547276] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 39.552263] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 39.556994] SyS_exit_group+0x1d/0x20 [ 39.560769] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 39.565494] RIP: 0033:0x445159 [ 39.568654] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 39.576334] RAX: ffffffffffffffda RBX: 73b9e2a942250939 RCX: 0000000000445159 [ 39.583574] RDX: 0000000000445159 RSI: 00000000206d8fd8 RDI: 0000000000000001 [ 39.590828] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 39.598070] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004027b0 [ 39.605319] R13: 0000000000402840 R14: 0000000000000000 R15: 0000000000000000 [ 39.612577] [ 39.614178] Allocated by task 2986: [ 39.617778] save_stack_trace+0x16/0x20 [ 39.621722] save_stack+0x43/0xd0 [ 39.625145] kasan_kmalloc+0xad/0xe0 [ 39.628829] __kmalloc_node+0x47/0x70 [ 39.632597] kvmalloc_node+0x64/0xd0 [ 39.636280] alloc_netdev_mqs+0x16e/0xed0 [ 39.640399] __tun_chr_ioctl+0x12be/0x3d20 [ 39.644603] tun_chr_ioctl+0x2a/0x40 [ 39.648284] do_vfs_ioctl+0x1b1/0x1530 [ 39.652138] SyS_ioctl+0x8f/0xc0 [ 39.655474] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 39.660198] [ 39.661797] Freed by task 2986: [ 39.665048] save_stack_trace+0x16/0x20 [ 39.668994] save_stack+0x43/0xd0 [ 39.672415] kasan_slab_free+0x71/0xc0 [ 39.676272] kfree+0xca/0x250 [ 39.679345] kvfree+0x36/0x60 [ 39.682421] free_netdev+0x2cf/0x360 [ 39.686102] __tun_chr_ioctl+0x2cf6/0x3d20 [ 39.690304] tun_chr_ioctl+0x2a/0x40 [ 39.693986] do_vfs_ioctl+0x1b1/0x1530 [ 39.697843] SyS_ioctl+0x8f/0xc0 [ 39.701178] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 39.705899] [ 39.707500] The buggy address belongs to the object at ffff8801ce7d03c0 [ 39.707500] which belongs to the cache kmalloc-16384 of size 16384 [ 39.720474] The buggy address is located 13312 bytes inside of [ 39.720474] 16384-byte region [ffff8801ce7d03c0, ffff8801ce7d43c0) [ 39.732673] The buggy address belongs to the page: [ 39.737571] page:ffffea000739f400 count:1 mapcount:0 mapping:ffff8801ce7d03c0 index:0x0 compound_mapcount: 0 [ 39.747514] flags: 0x200000000008100(slab|head) [ 39.752155] raw: 0200000000008100 ffff8801ce7d03c0 0000000000000000 0000000100000001 [ 39.760006] raw: ffffea0007369e20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 39.767853] page dumped because: kasan: bad access detected [ 39.773529] [ 39.775124] Memory state around the buggy address: [ 39.780019] ffff8801ce7d3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.787347] ffff8801ce7d3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.794674] >ffff8801ce7d3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.802001] ^ [ 39.807418] ffff8801ce7d3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.814745] ffff8801ce7d3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.822070] ================================================================== [ 39.829395] Disabling lock debugging due to kernel taint [ 39.834810] Kernel panic - not syncing: panic_on_warn set ... [ 39.834810] [ 39.842134] CPU: 0 PID: 2986 Comm: syzkaller814460 Tainted: G B 4.13.0-mm1+ #7 [ 39.850583] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 39.859901] Call Trace: [ 39.862454] dump_stack+0x194/0x257 [ 39.866048] ? arch_local_irq_restore+0x53/0x53 [ 39.870689] ? vprintk_default+0x28/0x30 [ 39.874718] ? detach_if_pending+0x550/0x610 [ 39.879101] panic+0x1e4/0x417 [ 39.882258] ? __warn+0x1d9/0x1d9 [ 39.885683] ? detach_if_pending+0x557/0x610 [ 39.890054] kasan_end_report+0x50/0x50 [ 39.893991] kasan_report+0x137/0x340 [ 39.897758] __asan_report_store8_noabort+0x17/0x20 [ 39.902737] detach_if_pending+0x557/0x610 [ 39.906937] ? trace_raw_output_tick_stop+0x130/0x130 [ 39.912092] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 39.916816] ? lock_timer_base+0x1a3/0x2b0 [ 39.921014] ? lock_timer_base+0x1eb/0x2b0 [ 39.925215] ? __internal_add_timer+0x2d0/0x2d0 [ 39.929853] ? trace_hardirqs_on+0xd/0x10 [ 39.933968] try_to_del_timer_sync+0xa2/0x120 [ 39.938436] ? del_timer+0x130/0x130 [ 39.942114] ? del_timer_sync+0xeb/0x240 [ 39.946142] del_timer_sync+0x18a/0x240 [ 39.950081] tun_free_netdev+0x105/0x1b0 [ 39.954104] ? tun_xdp+0x410/0x410 [ 39.957608] ? cpumask_next+0x24/0x30 [ 39.961374] ? netdev_refcnt_read+0xed/0x150 [ 39.965748] ? tun_xdp+0x410/0x410 [ 39.970013] netdev_run_todo+0x870/0xca0 [ 39.974041] ? do_group_exit+0x149/0x400 [ 39.978067] ? register_netdev+0x30/0x30 [ 39.982097] ? lock_downgrade+0x990/0x990 [ 39.986208] ? trace_hardirqs_on+0xd/0x10 [ 39.990329] ? refcount_sub_and_test+0x115/0x1b0 [ 39.995051] ? refcount_inc+0x50/0x50 [ 39.998816] ? refcount_inc+0x50/0x50 [ 40.002586] ? sk_destruct+0x4c/0x80 [ 40.006263] ? __sk_free+0x5c/0x230 [ 40.009855] ? sk_free+0x2f/0x40 [ 40.013186] ? __tun_detach+0x176/0x1390 [ 40.017225] ? tun_attach+0xf90/0xf90 [ 40.020998] ? locks_remove_file+0x3fa/0x5a0 [ 40.025371] ? fcntl_setlk+0x10d0/0x10d0 [ 40.029400] ? __fsnotify_parent+0xb4/0x3a0 [ 40.033686] ? fsnotify+0x1af0/0x1af0 [ 40.037453] ? __tun_detach+0x1390/0x1390 [ 40.041567] ? __tun_detach+0x1390/0x1390 [ 40.045681] rtnl_unlock+0xe/0x10 [ 40.049096] tun_chr_close+0x49/0x60 [ 40.052777] __fput+0x333/0x7f0 [ 40.056028] ? fput+0x140/0x140 [ 40.059273] ? check_same_owner+0x320/0x320 [ 40.063570] ____fput+0x15/0x20 [ 40.066815] task_work_run+0x199/0x270 [ 40.070668] ? task_work_cancel+0x210/0x210 [ 40.074954] ? free_nsproxy+0x185/0x1f0 [ 40.078895] ? switch_task_namespaces+0xa2/0xc0 [ 40.083530] do_exit+0xa52/0x1b40 [ 40.086951] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.091933] ? check_noncircular+0x20/0x20 [ 40.096144] ? mm_update_next_owner+0x930/0x930 [ 40.100779] ? __pmd_alloc+0x4e0/0x4e0 [ 40.104640] ? find_held_lock+0x39/0x1d0 [ 40.108669] ? lock_downgrade+0x990/0x990 [ 40.112793] ? handle_mm_fault+0x410/0x8d0 [ 40.116991] ? down_read_trylock+0xdb/0x170 [ 40.121277] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.125824] ? vmacache_find+0x61/0x270 [ 40.129762] ? vmacache_update+0xfe/0x130 [ 40.133877] ? up_read+0x1a/0x40 [ 40.137207] ? __do_page_fault+0x35b/0xb60 [ 40.141408] ? do_vfs_ioctl+0x492/0x1530 [ 40.145438] ? do_page_fault+0xee/0x720 [ 40.149378] ? __do_page_fault+0xb60/0xb60 [ 40.153577] ? putname+0xf3/0x130 [ 40.157002] do_group_exit+0x149/0x400 [ 40.160854] ? lockdep_sys_exit+0x47/0xf0 [ 40.164965] ? SyS_exit+0x30/0x30 [ 40.168383] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.173367] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.178088] SyS_exit_group+0x1d/0x20 [ 40.181858] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.186579] RIP: 0033:0x445159 [ 40.189737] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 40.197408] RAX: ffffffffffffffda RBX: 73b9e2a942250939 RCX: 0000000000445159