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-7,10.128.0.13' (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.242444] ================================================================== [ 41.243532] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.244426] Write of size 8 at addr ffff8801ceb4b740 by task syzkaller963454/2982 [ 41.245426] [ 41.245663] CPU: 0 PID: 2982 Comm: syzkaller963454 Not tainted 4.13.0-mm1+ #7 [ 41.246620] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.247859] Call Trace: [ 41.248224] dump_stack+0x194/0x257 [ 41.248721] ? arch_local_irq_restore+0x53/0x53 [ 41.249365] ? show_regs_print_info+0x65/0x65 [ 41.249971] ? lock_timer_base+0x1a3/0x2b0 [ 41.250545] ? detach_if_pending+0x557/0x610 [ 41.251139] print_address_description+0x73/0x250 [ 41.251788] ? detach_if_pending+0x557/0x610 [ 41.252380] kasan_report+0x24e/0x340 [ 41.252901] __asan_report_store8_noabort+0x17/0x20 [ 41.253570] detach_if_pending+0x557/0x610 [ 41.254143] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.254840] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.255506] ? lock_timer_base+0x1a3/0x2b0 [ 41.256077] ? lock_timer_base+0x1eb/0x2b0 [ 41.256682] ? __internal_add_timer+0x2d0/0x2d0 [ 41.257314] ? trace_hardirqs_on+0xd/0x10 [ 41.257930] try_to_del_timer_sync+0xa2/0x120 [ 41.258534] ? del_timer+0x130/0x130 [ 41.259043] ? del_timer_sync+0xeb/0x240 [ 41.259607] del_timer_sync+0x18a/0x240 [ 41.260193] tun_free_netdev+0x105/0x1b0 [ 41.260740] ? tun_xdp+0x410/0x410 [ 41.261220] ? cpumask_next+0x24/0x30 [ 41.261764] ? netdev_refcnt_read+0xed/0x150 [ 41.262360] ? tun_xdp+0x410/0x410 [ 41.264454] netdev_run_todo+0x870/0xca0 [ 41.268487] ? do_group_exit+0x149/0x400 [ 41.272524] ? register_netdev+0x30/0x30 [ 41.276559] ? lock_downgrade+0x990/0x990 [ 41.280681] ? trace_hardirqs_on+0xd/0x10 [ 41.284818] ? refcount_sub_and_test+0x115/0x1b0 [ 41.289542] ? refcount_inc+0x50/0x50 [ 41.293312] ? refcount_inc+0x50/0x50 [ 41.297097] ? sk_destruct+0x4c/0x80 [ 41.300780] ? __sk_free+0x5c/0x230 [ 41.304378] ? sk_free+0x2f/0x40 [ 41.307716] ? __tun_detach+0x176/0x1390 [ 41.311757] ? tun_attach+0xf90/0xf90 [ 41.315537] ? do_raw_spin_trylock+0x190/0x190 [ 41.320092] ? locks_remove_file+0x3fa/0x5a0 [ 41.324474] ? fcntl_setlk+0x10d0/0x10d0 [ 41.328511] ? __fsnotify_parent+0xb4/0x3a0 [ 41.332807] ? fsnotify+0x1af0/0x1af0 [ 41.336582] ? __tun_detach+0x1390/0x1390 [ 41.340699] ? __tun_detach+0x1390/0x1390 [ 41.344817] rtnl_unlock+0xe/0x10 [ 41.348240] tun_chr_close+0x49/0x60 [ 41.351923] __fput+0x333/0x7f0 [ 41.355268] ? fput+0x140/0x140 [ 41.358522] ? check_same_owner+0x320/0x320 [ 41.362813] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.367284] ____fput+0x15/0x20 [ 41.370535] task_work_run+0x199/0x270 [ 41.374399] ? task_work_cancel+0x210/0x210 [ 41.378691] ? _raw_spin_unlock+0x22/0x30 [ 41.382808] ? switch_task_namespaces+0x87/0xc0 [ 41.387455] do_exit+0xa52/0x1b40 [ 41.390879] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.395866] ? check_noncircular+0x20/0x20 [ 41.400079] ? mm_update_next_owner+0x930/0x930 [ 41.404717] ? __pmd_alloc+0x4e0/0x4e0 [ 41.408585] ? find_held_lock+0x39/0x1d0 [ 41.412628] ? lock_downgrade+0x990/0x990 [ 41.416766] ? handle_mm_fault+0x410/0x8d0 [ 41.420970] ? down_read_trylock+0xdb/0x170 [ 41.425261] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.429812] ? vmacache_find+0x61/0x270 [ 41.433762] ? up_read+0x1a/0x40 [ 41.437105] ? __do_page_fault+0x35b/0xb60 [ 41.441308] ? do_vfs_ioctl+0x492/0x1530 [ 41.445347] ? do_page_fault+0xee/0x720 [ 41.449292] ? __do_page_fault+0xb60/0xb60 [ 41.453494] ? putname+0xf3/0x130 [ 41.456923] do_group_exit+0x149/0x400 [ 41.460779] ? lockdep_sys_exit+0x47/0xf0 [ 41.464894] ? SyS_exit+0x30/0x30 [ 41.468319] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.473307] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.478035] SyS_exit_group+0x1d/0x20 [ 41.481804] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.486526] RIP: 0033:0x4435b8 [ 41.489684] RSP: 002b:00007fffac67b068 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 41.497363] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435b8 [ 41.504603] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 41.511842] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 41.519079] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 41.526317] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 41.533575] [ 41.535175] Allocated by task 2982: [ 41.538772] save_stack_trace+0x16/0x20 [ 41.542715] save_stack+0x43/0xd0 [ 41.546136] kasan_kmalloc+0xad/0xe0 [ 41.549820] __kmalloc_node+0x47/0x70 [ 41.553590] kvmalloc_node+0x64/0xd0 [ 41.557276] alloc_netdev_mqs+0x16e/0xed0 [ 41.561392] __tun_chr_ioctl+0x12be/0x3d20 [ 41.565592] tun_chr_ioctl+0x2a/0x40 [ 41.569271] do_vfs_ioctl+0x1b1/0x1530 [ 41.573124] SyS_ioctl+0x8f/0xc0 [ 41.576460] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.581182] [ 41.582779] Freed by task 2982: [ 41.586029] save_stack_trace+0x16/0x20 [ 41.589972] save_stack+0x43/0xd0 [ 41.593392] kasan_slab_free+0x71/0xc0 [ 41.597246] kfree+0xca/0x250 [ 41.600321] kvfree+0x36/0x60 [ 41.603395] free_netdev+0x2cf/0x360 [ 41.607076] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.611277] tun_chr_ioctl+0x2a/0x40 [ 41.614956] do_vfs_ioctl+0x1b1/0x1530 [ 41.619869] SyS_ioctl+0x8f/0xc0 [ 41.623206] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.627926] [ 41.629526] The buggy address belongs to the object at ffff8801ceb48340 [ 41.629526] which belongs to the cache kmalloc-16384 of size 16384 [ 41.642497] The buggy address is located 13312 bytes inside of [ 41.642497] 16384-byte region [ffff8801ceb48340, ffff8801ceb4c340) [ 41.654686] The buggy address belongs to the page: [ 41.659582] page:ffffea00073ad200 count:1 mapcount:0 mapping:ffff8801ceb48340 index:0x0 compound_mapcount: 0 [ 41.669526] flags: 0x200000000008100(slab|head) [ 41.674166] raw: 0200000000008100 ffff8801ceb48340 0000000000000000 0000000100000001 [ 41.682017] raw: ffffea000738da20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.689862] page dumped because: kasan: bad access detected [ 41.695537] [ 41.697149] Memory state around the buggy address: [ 41.702045] ffff8801ceb4b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.709380] ffff8801ceb4b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.716707] >ffff8801ceb4b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.724033] ^ [ 41.729449] ffff8801ceb4b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.736775] ffff8801ceb4b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.744099] ================================================================== [ 41.751425] Disabling lock debugging due to kernel taint [ 41.756836] Kernel panic - not syncing: panic_on_warn set ... [ 41.756836] [ 41.764160] CPU: 0 PID: 2982 Comm: syzkaller963454 Tainted: G B 4.13.0-mm1+ #7 [ 41.772609] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.781925] Call Trace: [ 41.784481] dump_stack+0x194/0x257 [ 41.788073] ? arch_local_irq_restore+0x53/0x53 [ 41.792719] ? vprintk_default+0x28/0x30 [ 41.796746] ? detach_if_pending+0x550/0x610 [ 41.801120] panic+0x1e4/0x417 [ 41.804277] ? __warn+0x1d9/0x1d9 [ 41.807699] ? detach_if_pending+0x557/0x610 [ 41.812072] kasan_end_report+0x50/0x50 [ 41.816008] kasan_report+0x137/0x340 [ 41.819776] __asan_report_store8_noabort+0x17/0x20 [ 41.824752] detach_if_pending+0x557/0x610 [ 41.828957] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.834112] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.838743] ? lock_timer_base+0x1a3/0x2b0 [ 41.842942] ? lock_timer_base+0x1eb/0x2b0 [ 41.847141] ? __internal_add_timer+0x2d0/0x2d0 [ 41.851776] ? trace_hardirqs_on+0xd/0x10 [ 41.855890] try_to_del_timer_sync+0xa2/0x120 [ 41.860347] ? del_timer+0x130/0x130 [ 41.864025] ? del_timer_sync+0xeb/0x240 [ 41.868051] del_timer_sync+0x18a/0x240 [ 41.871990] tun_free_netdev+0x105/0x1b0 [ 41.876015] ? tun_xdp+0x410/0x410 [ 41.879518] ? cpumask_next+0x24/0x30 [ 41.883282] ? netdev_refcnt_read+0xed/0x150 [ 41.887653] ? tun_xdp+0x410/0x410 [ 41.891160] netdev_run_todo+0x870/0xca0 [ 41.895186] ? do_group_exit+0x149/0x400 [ 41.899215] ? register_netdev+0x30/0x30 [ 41.903242] ? lock_downgrade+0x990/0x990 [ 41.907352] ? trace_hardirqs_on+0xd/0x10 [ 41.911483] ? refcount_sub_and_test+0x115/0x1b0 [ 41.916203] ? refcount_inc+0x50/0x50 [ 41.919967] ? refcount_inc+0x50/0x50 [ 41.923734] ? sk_destruct+0x4c/0x80 [ 41.927413] ? __sk_free+0x5c/0x230 [ 41.931178] ? sk_free+0x2f/0x40 [ 41.934509] ? __tun_detach+0x176/0x1390 [ 41.938539] ? tun_attach+0xf90/0xf90 [ 41.942306] ? do_raw_spin_trylock+0x190/0x190 [ 41.946851] ? locks_remove_file+0x3fa/0x5a0 [ 41.951225] ? fcntl_setlk+0x10d0/0x10d0 [ 41.955250] ? __fsnotify_parent+0xb4/0x3a0 [ 41.959536] ? fsnotify+0x1af0/0x1af0 [ 41.963299] ? __tun_detach+0x1390/0x1390 [ 41.967411] ? __tun_detach+0x1390/0x1390 [ 41.971522] rtnl_unlock+0xe/0x10 [ 41.974941] tun_chr_close+0x49/0x60 [ 41.978627] __fput+0x333/0x7f0 [ 41.981874] ? fput+0x140/0x140 [ 41.985119] ? check_same_owner+0x320/0x320 [ 41.989403] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.993864] ____fput+0x15/0x20 [ 41.997107] task_work_run+0x199/0x270 [ 42.000959] ? task_work_cancel+0x210/0x210 [ 42.005244] ? _raw_spin_unlock+0x22/0x30 [ 42.009359] ? switch_task_namespaces+0x87/0xc0 [ 42.013992] do_exit+0xa52/0x1b40 [ 42.017412] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.022393] ? check_noncircular+0x20/0x20 [ 42.026595] ? mm_update_next_owner+0x930/0x930 [ 42.031226] ? __pmd_alloc+0x4e0/0x4e0 [ 42.035084] ? find_held_lock+0x39/0x1d0 [ 42.039114] ? lock_downgrade+0x990/0x990 [ 42.043243] ? handle_mm_fault+0x410/0x8d0 [ 42.047439] ? down_read_trylock+0xdb/0x170 [ 42.051723] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.056271] ? vmacache_find+0x61/0x270 [ 42.060219] ? up_read+0x1a/0x40 [ 42.063552] ? __do_page_fault+0x35b/0xb60 [ 42.067750] ? do_vfs_ioctl+0x492/0x1530 [ 42.071780] ? do_page_fault+0xee/0x720 [ 42.075715] ? __do_page_fault+0xb60/0xb60 [ 42.079914] ? putname+0xf3/0x130 [ 42.083332] do_group_exit+0x149/0x400 [ 42.087184] ? lockdep_sys_exit+0x47/0xf0 [ 42.091295] ? SyS_exit+0x30/0x30 [ 42.094711] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.099691] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.104412] SyS_exit_group+0x1d/0x20 [ 42.108179] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.112898] RIP: 0033:0x4435b8 [ 42.116054] RSP: 002b:00007fffac67b068 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 42.123727] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435b8 [ 42.130959] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 42.138193] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 42.146013] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 42.153249] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000