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.193' (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: [ 30.299414] ================================================================== [ 30.306868] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 30.313592] Write of size 8 at addr ffff8801ce733740 by task syzkaller367285/2980 [ 30.321180] [ 30.322782] CPU: 1 PID: 2980 Comm: syzkaller367285 Not tainted 4.14.0-rc4-mm1+ #16 [ 30.330459] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.339783] Call Trace: [ 30.342345] dump_stack+0x194/0x257 [ 30.345966] ? arch_local_irq_restore+0x53/0x53 [ 30.350612] ? show_regs_print_info+0x65/0x65 [ 30.355083] ? lock_timer_base+0x1a3/0x2b0 [ 30.359295] ? detach_if_pending+0x557/0x610 [ 30.363682] print_address_description+0x73/0x250 [ 30.368509] ? detach_if_pending+0x557/0x610 [ 30.372892] kasan_report+0x25b/0x340 [ 30.376672] __asan_report_store8_noabort+0x17/0x20 [ 30.381660] detach_if_pending+0x557/0x610 [ 30.385872] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.391035] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.395676] ? lock_timer_base+0x1a3/0x2b0 [ 30.399882] ? lock_timer_base+0x1eb/0x2b0 [ 30.404101] ? __internal_add_timer+0x2d0/0x2d0 [ 30.408744] ? trace_hardirqs_on+0xd/0x10 [ 30.412882] try_to_del_timer_sync+0xa2/0x120 [ 30.417349] ? del_timer+0x130/0x130 [ 30.421035] ? del_timer_sync+0xeb/0x240 [ 30.425085] del_timer_sync+0x18a/0x240 [ 30.429047] tun_free_netdev+0x105/0x1b0 [ 30.433085] ? tun_xdp+0x410/0x410 [ 30.436595] ? cpumask_next+0x24/0x30 [ 30.440372] ? netdev_refcnt_read+0xed/0x150 [ 30.444772] netdev_run_todo+0x683/0xae0 [ 30.448811] ? tun_xdp+0x410/0x410 [ 30.452328] ? register_netdev+0x30/0x30 [ 30.456361] ? refcount_inc+0x50/0x50 [ 30.460133] ? refcount_inc+0x50/0x50 [ 30.463908] ? sk_destruct+0x4c/0x80 [ 30.467594] ? __sk_free+0x5c/0x230 [ 30.471281] ? sk_free+0x2f/0x40 [ 30.474622] ? __tun_detach+0x760/0x1570 [ 30.478690] ? locks_remove_file+0x3fa/0x5a0 [ 30.483073] ? fcntl_setlk+0x10d0/0x10d0 [ 30.487116] ? fsnotify+0x1af0/0x1af0 [ 30.490896] ? __tun_detach+0x1570/0x1570 [ 30.495017] rtnl_unlock+0xe/0x10 [ 30.498441] tun_chr_close+0x49/0x60 [ 30.502134] __fput+0x333/0x7f0 [ 30.505394] ? fput+0x140/0x140 [ 30.508651] ? check_same_owner+0x320/0x320 [ 30.512945] ? _raw_spin_unlock_irq+0x27/0x70 [ 30.517420] ____fput+0x15/0x20 [ 30.520671] task_work_run+0x199/0x270 [ 30.524534] ? task_work_cancel+0x210/0x210 [ 30.528828] ? _raw_spin_unlock+0x22/0x30 [ 30.532948] ? switch_task_namespaces+0x87/0xc0 [ 30.537594] do_exit+0x9c8/0x1b00 [ 30.541027] ? mm_update_next_owner+0x930/0x930 [ 30.545671] ? find_held_lock+0x39/0x1d0 [ 30.549714] ? lock_downgrade+0x990/0x990 [ 30.553857] ? handle_mm_fault+0x410/0x8d0 [ 30.558064] ? __do_page_fault+0x31e/0xd60 [ 30.562274] ? __handle_mm_fault+0x39c0/0x39c0 [ 30.566826] ? vmacache_find+0x5f/0x280 [ 30.570779] ? up_read+0x1a/0x40 [ 30.574116] ? __do_page_fault+0x3d6/0xd60 [ 30.578330] ? mm_fault_error+0x2c0/0x2c0 [ 30.582454] ? do_vfs_ioctl+0x492/0x1530 [ 30.586503] ? do_page_fault+0xee/0x720 [ 30.590453] ? __do_page_fault+0xd60/0xd60 [ 30.594677] ? iterate_fd+0x3f0/0x3f0 [ 30.598449] ? putname+0xf3/0x130 [ 30.601894] do_group_exit+0x149/0x400 [ 30.605752] ? lockdep_sys_exit+0x47/0xf0 [ 30.609872] ? SyS_exit+0x30/0x30 [ 30.613300] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 30.618291] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.623020] SyS_exit_group+0x1d/0x20 [ 30.626795] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 30.631521] RIP: 0033:0x4436a8 [ 30.634682] RSP: 002b:00007ffd3db12ab8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 30.642365] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436a8 [ 30.649605] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 30.656845] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 30.664085] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 30.671328] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 30.678587] [ 30.680186] Allocated by task 2980: [ 30.683786] save_stack+0x43/0xd0 [ 30.687208] kasan_kmalloc+0xad/0xe0 [ 30.690890] __kmalloc_node+0x47/0x70 [ 30.694661] kvmalloc_node+0x64/0xd0 [ 30.698346] alloc_netdev_mqs+0x16d/0xed0 [ 30.702466] __tun_chr_ioctl+0x1386/0x3e40 [ 30.706669] tun_chr_ioctl+0x2a/0x40 [ 30.710353] do_vfs_ioctl+0x1b1/0x1530 [ 30.714208] SyS_ioctl+0x8f/0xc0 [ 30.717544] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 30.722267] [ 30.723868] Freed by task 2980: [ 30.727123] save_stack+0x43/0xd0 [ 30.730545] kasan_slab_free+0x71/0xc0 [ 30.734401] kfree+0xca/0x250 [ 30.737476] kvfree+0x36/0x60 [ 30.740551] free_netdev+0x2cf/0x360 [ 30.744235] __tun_chr_ioctl+0x2df6/0x3e40 [ 30.748440] tun_chr_ioctl+0x2a/0x40 [ 30.752123] do_vfs_ioctl+0x1b1/0x1530 [ 30.755980] SyS_ioctl+0x8f/0xc0 [ 30.759314] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 30.764036] [ 30.765641] The buggy address belongs to the object at ffff8801ce730340 [ 30.765641] which belongs to the cache kmalloc-16384 of size 16384 [ 30.778613] The buggy address is located 13312 bytes inside of [ 30.778613] 16384-byte region [ffff8801ce730340, ffff8801ce734340) [ 30.790810] The buggy address belongs to the page: [ 30.795708] page:ffffea000739cc00 count:1 mapcount:0 mapping:ffff8801ce730340 index:0x0 compound_mapcount: 0 [ 30.805653] flags: 0x200000000008100(slab|head) [ 30.810297] raw: 0200000000008100 ffff8801ce730340 0000000000000000 0000000100000001 [ 30.818153] raw: ffffea000734a620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 30.826000] page dumped because: kasan: bad access detected [ 30.831678] [ 30.833276] Memory state around the buggy address: [ 30.838173] ffff8801ce733600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.845500] ffff8801ce733680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.852827] >ffff8801ce733700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.860156] ^ [ 30.865575] ffff8801ce733780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.872903] ffff8801ce733800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.880229] ================================================================== [ 30.887553] Disabling lock debugging due to kernel taint [ 30.892966] Kernel panic - not syncing: panic_on_warn set ... [ 30.892966] [ 30.900296] CPU: 1 PID: 2980 Comm: syzkaller367285 Tainted: G B 4.14.0-rc4-mm1+ #16 [ 30.909268] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.918596] Call Trace: [ 30.921155] dump_stack+0x194/0x257 [ 30.924747] ? arch_local_irq_restore+0x53/0x53 [ 30.929386] ? vprintk_default+0x28/0x30 [ 30.933417] ? detach_if_pending+0x540/0x610 [ 30.937794] panic+0x1e4/0x41c [ 30.940952] ? refcount_error_report+0x214/0x214 [ 30.945679] ? detach_if_pending+0x557/0x610 [ 30.950054] kasan_end_report+0x50/0x50 [ 30.953992] kasan_report+0x144/0x340 [ 30.957758] __asan_report_store8_noabort+0x17/0x20 [ 30.962737] detach_if_pending+0x557/0x610 [ 30.966939] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.972093] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.976725] ? lock_timer_base+0x1a3/0x2b0 [ 30.980924] ? lock_timer_base+0x1eb/0x2b0 [ 30.985126] ? __internal_add_timer+0x2d0/0x2d0 [ 30.989766] ? trace_hardirqs_on+0xd/0x10 [ 30.993880] try_to_del_timer_sync+0xa2/0x120 [ 30.998339] ? del_timer+0x130/0x130 [ 31.002018] ? del_timer_sync+0xeb/0x240 [ 31.006046] del_timer_sync+0x18a/0x240 [ 31.009987] tun_free_netdev+0x105/0x1b0 [ 31.014014] ? tun_xdp+0x410/0x410 [ 31.017519] ? cpumask_next+0x24/0x30 [ 31.021287] ? netdev_refcnt_read+0xed/0x150 [ 31.025669] netdev_run_todo+0x683/0xae0 [ 31.029697] ? tun_xdp+0x410/0x410 [ 31.033204] ? register_netdev+0x30/0x30 [ 31.037230] ? refcount_inc+0x50/0x50 [ 31.040994] ? refcount_inc+0x50/0x50 [ 31.044763] ? sk_destruct+0x4c/0x80 [ 31.048441] ? __sk_free+0x5c/0x230 [ 31.052032] ? sk_free+0x2f/0x40 [ 31.055367] ? __tun_detach+0x760/0x1570 [ 31.059404] ? locks_remove_file+0x3fa/0x5a0 [ 31.063779] ? fcntl_setlk+0x10d0/0x10d0 [ 31.067809] ? fsnotify+0x1af0/0x1af0 [ 31.071577] ? __tun_detach+0x1570/0x1570 [ 31.075691] rtnl_unlock+0xe/0x10 [ 31.079109] tun_chr_close+0x49/0x60 [ 31.082790] __fput+0x333/0x7f0 [ 31.086039] ? fput+0x140/0x140 [ 31.089287] ? check_same_owner+0x320/0x320 [ 31.093574] ? _raw_spin_unlock_irq+0x27/0x70 [ 31.098037] ____fput+0x15/0x20 [ 31.101282] task_work_run+0x199/0x270 [ 31.105135] ? task_work_cancel+0x210/0x210 [ 31.109423] ? _raw_spin_unlock+0x22/0x30 [ 31.113548] ? switch_task_namespaces+0x87/0xc0 [ 31.118186] do_exit+0x9c8/0x1b00 [ 31.121607] ? mm_update_next_owner+0x930/0x930 [ 31.126248] ? find_held_lock+0x39/0x1d0 [ 31.130278] ? lock_downgrade+0x990/0x990 [ 31.134403] ? handle_mm_fault+0x410/0x8d0 [ 31.138603] ? __do_page_fault+0x31e/0xd60 [ 31.142803] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.147363] ? vmacache_find+0x5f/0x280 [ 31.151306] ? up_read+0x1a/0x40 [ 31.154638] ? __do_page_fault+0x3d6/0xd60 [ 31.158843] ? mm_fault_error+0x2c0/0x2c0 [ 31.162959] ? do_vfs_ioctl+0x492/0x1530 [ 31.166989] ? do_page_fault+0xee/0x720 [ 31.170929] ? __do_page_fault+0xd60/0xd60 [ 31.175129] ? iterate_fd+0x3f0/0x3f0 [ 31.178895] ? putname+0xf3/0x130 [ 31.182316] do_group_exit+0x149/0x400 [ 31.186166] ? lockdep_sys_exit+0x47/0xf0 [ 31.190281] ? SyS_exit+0x30/0x30 [ 31.193701] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.198683] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 31.203406] SyS_exit_group+0x1d/0x20 [ 31.207177] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.211898] RIP: 0033:0x4436a8 [ 31.215053] RSP: 002b:00007ffd3db12ab8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 31.222724] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436a8 [ 31.229958] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 31.237194] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 31.244429] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 31.251665] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000