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-kasan-gce-5,10.128.15.216' (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: [ 49.634503] ================================================================== [ 49.635721] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 49.636657] Write of size 8 at addr ffff8801cfd636b8 by task syzkaller110725/2985 [ 49.637703] [ 49.637966] CPU: 1 PID: 2985 Comm: syzkaller110725 Not tainted 4.14.0-rc5+ #138 [ 49.638950] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 49.640170] Call Trace: [ 49.640535] dump_stack+0x194/0x257 [ 49.641034] ? arch_local_irq_restore+0x53/0x53 [ 49.641675] ? show_regs_print_info+0x65/0x65 [ 49.642285] ? lock_timer_base+0x1a3/0x2b0 [ 49.642858] ? detach_if_pending+0x557/0x610 [ 49.643452] print_address_description+0x73/0x250 [ 49.644099] ? detach_if_pending+0x557/0x610 [ 49.644693] kasan_report+0x25b/0x340 [ 49.645230] __asan_report_store8_noabort+0x17/0x20 [ 49.645911] detach_if_pending+0x557/0x610 [ 49.646503] ? trace_raw_output_tick_stop+0x130/0x130 [ 49.647224] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 49.647847] ? lock_timer_base+0x1a3/0x2b0 [ 49.648421] ? lock_timer_base+0x1eb/0x2b0 [ 49.648997] ? __internal_add_timer+0x2d0/0x2d0 [ 49.649623] ? lock_downgrade+0x990/0x990 [ 49.650179] ? trace_hardirqs_on+0xd/0x10 [ 49.650827] try_to_del_timer_sync+0xa2/0x120 [ 49.651440] ? del_timer+0x130/0x130 [ 49.651945] ? del_timer_sync+0xeb/0x240 [ 49.652502] del_timer_sync+0x18a/0x240 [ 49.653043] tun_free_netdev+0x105/0x1b0 [ 49.653622] ? tun_xdp+0x410/0x410 [ 49.654113] ? cpumask_next+0x24/0x30 [ 49.654640] ? netdev_refcnt_read+0xed/0x150 [ 49.658739] ? tun_xdp+0x410/0x410 [ 49.662249] netdev_run_todo+0x870/0xca0 [ 49.666281] ? do_group_exit+0x149/0x400 [ 49.670315] ? mark_held_locks+0xaf/0x100 [ 49.674434] ? register_netdev+0x30/0x30 [ 49.678470] ? find_held_lock+0x35/0x1d0 [ 49.682514] ? lock_downgrade+0x990/0x990 [ 49.686638] ? refcount_sub_and_test+0x115/0x1b0 [ 49.691365] ? refcount_inc+0x50/0x50 [ 49.695134] ? refcount_inc+0x50/0x50 [ 49.698910] ? sk_destruct+0x4c/0x80 [ 49.702595] ? __sk_free+0x5c/0x230 [ 49.706193] ? sk_free+0x2f/0x40 [ 49.709528] ? __tun_detach+0x176/0x1390 [ 49.713573] ? tun_attach+0xfa0/0xfa0 [ 49.717350] ? lock_downgrade+0x990/0x990 [ 49.721470] ? locks_remove_file+0x3fa/0x5a0 [ 49.725851] ? fcntl_setlk+0x10c0/0x10c0 [ 49.729888] ? __fsnotify_parent+0xb4/0x3a0 [ 49.734184] ? fsnotify+0x1af0/0x1af0 [ 49.737964] ? __tun_detach+0x1390/0x1390 [ 49.742083] rtnl_unlock+0xe/0x10 [ 49.745504] tun_chr_close+0x49/0x60 [ 49.749187] __fput+0x327/0x7e0 [ 49.752446] ? fput+0x140/0x140 [ 49.755697] ? check_same_owner+0x320/0x320 [ 49.759987] ? _raw_spin_unlock_irq+0x27/0x70 [ 49.764462] ____fput+0x15/0x20 [ 49.767712] task_work_run+0x199/0x270 [ 49.771574] ? task_work_cancel+0x210/0x210 [ 49.775866] ? _raw_spin_unlock+0x22/0x30 [ 49.779983] ? switch_task_namespaces+0x87/0xc0 [ 49.784630] do_exit+0x9b5/0x1ad0 [ 49.788058] ? kvfree+0x3b/0x60 [ 49.791311] ? mm_update_next_owner+0x930/0x930 [ 49.795949] ? find_held_lock+0x35/0x1d0 [ 49.799992] ? handle_mm_fault+0x248/0x8d0 [ 49.804204] ? find_held_lock+0x35/0x1d0 [ 49.808248] ? __do_page_fault+0x64c/0xd60 [ 49.812455] ? lock_downgrade+0x990/0x990 [ 49.816584] ? handle_mm_fault+0x410/0x8d0 [ 49.820791] ? __do_page_fault+0x31e/0xd60 [ 49.824997] ? __handle_mm_fault+0x39c0/0x39c0 [ 49.829550] ? vmacache_find+0x5f/0x280 [ 49.833592] ? up_read+0x1a/0x40 [ 49.836927] ? __do_page_fault+0x3d6/0xd60 [ 49.841145] ? mm_fault_error+0x2c0/0x2c0 [ 49.845264] ? do_vfs_ioctl+0x486/0x1520 [ 49.849306] ? do_page_fault+0xee/0x720 [ 49.853254] ? __do_page_fault+0xd60/0xd60 [ 49.857459] ? iterate_fd+0x3f0/0x3f0 [ 49.861238] ? putname+0xf3/0x130 [ 49.864671] do_group_exit+0x149/0x400 [ 49.868531] ? SyS_exit+0x30/0x30 [ 49.871956] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.876944] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 49.881676] SyS_exit_group+0x1d/0x20 [ 49.885446] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.890169] RIP: 0033:0x443728 [ 49.893329] RSP: 002b:00007ffc5d8ab148 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 49.901006] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443728 [ 49.908247] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 49.915486] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 49.922723] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 49.929961] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 49.937224] [ 49.938823] Allocated by task 2985: [ 49.942419] save_stack_trace+0x16/0x20 [ 49.946360] save_stack+0x43/0xd0 [ 49.949784] kasan_kmalloc+0xad/0xe0 [ 49.953466] __kmalloc_node+0x47/0x70 [ 49.957234] kvmalloc_node+0x64/0xd0 [ 49.960914] alloc_netdev_mqs+0x16e/0xed0 [ 49.965032] __tun_chr_ioctl+0x12b2/0x3d20 [ 49.969234] tun_chr_ioctl+0x2a/0x40 [ 49.973088] do_vfs_ioctl+0x1b1/0x1520 [ 49.976944] SyS_ioctl+0x8f/0xc0 [ 49.980364] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.985083] [ 49.986678] Freed by task 2985: [ 49.989923] save_stack_trace+0x16/0x20 [ 49.993864] save_stack+0x43/0xd0 [ 49.997281] kasan_slab_free+0x71/0xc0 [ 50.001136] kfree+0xca/0x250 [ 50.004208] kvfree+0x36/0x60 [ 50.007279] free_netdev+0x2cf/0x360 [ 50.010961] __tun_chr_ioctl+0x2cea/0x3d20 [ 50.015162] tun_chr_ioctl+0x2a/0x40 [ 50.018875] do_vfs_ioctl+0x1b1/0x1520 [ 50.022733] SyS_ioctl+0x8f/0xc0 [ 50.026069] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 50.030787] [ 50.032382] The buggy address belongs to the object at ffff8801cfd60380 [ 50.032382] which belongs to the cache kmalloc-16384 of size 16384 [ 50.045351] The buggy address is located 13112 bytes inside of [ 50.045351] 16384-byte region [ffff8801cfd60380, ffff8801cfd64380) [ 50.057537] The buggy address belongs to the page: [ 50.062433] page:ffffea00073f5800 count:1 mapcount:0 mapping:ffff8801cfd60380 index:0x0 compound_mapcount: 0 [ 50.072522] flags: 0x200000000008100(slab|head) [ 50.077380] raw: 0200000000008100 ffff8801cfd60380 0000000000000000 0000000100000001 [ 50.085232] raw: ffffea0007021e20 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 50.093074] page dumped because: kasan: bad access detected [ 50.098748] [ 50.100340] Memory state around the buggy address: [ 50.105235] ffff8801cfd63580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.112567] ffff8801cfd63600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.119892] >ffff8801cfd63680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.127308] ^ [ 50.132461] ffff8801cfd63700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.139784] ffff8801cfd63780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.147106] ================================================================== [ 50.154428] Disabling lock debugging due to kernel taint [ 50.159841] Kernel panic - not syncing: panic_on_warn set ... [ 50.159841] [ 50.167168] CPU: 1 PID: 2985 Comm: syzkaller110725 Tainted: G B 4.14.0-rc5+ #138 [ 50.175802] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.185119] Call Trace: [ 50.187680] dump_stack+0x194/0x257 [ 50.191275] ? arch_local_irq_restore+0x53/0x53 [ 50.195908] ? kasan_end_report+0x32/0x50 [ 50.200024] ? lock_downgrade+0x990/0x990 [ 50.204138] ? detach_if_pending+0x510/0x610 [ 50.208519] panic+0x1e4/0x417 [ 50.211677] ? __warn+0x1d9/0x1d9 [ 50.215100] ? detach_if_pending+0x557/0x610 [ 50.219472] kasan_end_report+0x50/0x50 [ 50.223409] kasan_report+0x144/0x340 [ 50.227176] __asan_report_store8_noabort+0x17/0x20 [ 50.232155] detach_if_pending+0x557/0x610 [ 50.236356] ? trace_raw_output_tick_stop+0x130/0x130 [ 50.241523] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 50.246161] ? lock_timer_base+0x1a3/0x2b0 [ 50.250359] ? lock_timer_base+0x1eb/0x2b0 [ 50.254562] ? __internal_add_timer+0x2d0/0x2d0 [ 50.259199] ? lock_downgrade+0x990/0x990 [ 50.263312] ? trace_hardirqs_on+0xd/0x10 [ 50.267431] try_to_del_timer_sync+0xa2/0x120 [ 50.271891] ? del_timer+0x130/0x130 [ 50.275569] ? del_timer_sync+0xeb/0x240 [ 50.279597] del_timer_sync+0x18a/0x240 [ 50.283675] tun_free_netdev+0x105/0x1b0 [ 50.287709] ? tun_xdp+0x410/0x410 [ 50.291223] ? cpumask_next+0x24/0x30 [ 50.294991] ? netdev_refcnt_read+0xed/0x150 [ 50.299365] ? tun_xdp+0x410/0x410 [ 50.302875] netdev_run_todo+0x870/0xca0 [ 50.306900] ? do_group_exit+0x149/0x400 [ 50.310928] ? mark_held_locks+0xaf/0x100 [ 50.315040] ? register_netdev+0x30/0x30 [ 50.319068] ? find_held_lock+0x35/0x1d0 [ 50.323099] ? lock_downgrade+0x990/0x990 [ 50.327215] ? refcount_sub_and_test+0x115/0x1b0 [ 50.331934] ? refcount_inc+0x50/0x50 [ 50.335701] ? refcount_inc+0x50/0x50 [ 50.339468] ? sk_destruct+0x4c/0x80 [ 50.343145] ? __sk_free+0x5c/0x230 [ 50.346735] ? sk_free+0x2f/0x40 [ 50.350065] ? __tun_detach+0x176/0x1390 [ 50.354095] ? tun_attach+0xfa0/0xfa0 [ 50.357863] ? lock_downgrade+0x990/0x990 [ 50.361977] ? locks_remove_file+0x3fa/0x5a0 [ 50.366351] ? fcntl_setlk+0x10c0/0x10c0 [ 50.370381] ? __fsnotify_parent+0xb4/0x3a0 [ 50.374667] ? fsnotify+0x1af0/0x1af0 [ 50.378436] ? __tun_detach+0x1390/0x1390 [ 50.382552] rtnl_unlock+0xe/0x10 [ 50.385968] tun_chr_close+0x49/0x60 [ 50.389646] __fput+0x327/0x7e0 [ 50.392893] ? fput+0x140/0x140 [ 50.396142] ? check_same_owner+0x320/0x320 [ 50.400433] ? _raw_spin_unlock_irq+0x27/0x70 [ 50.404895] ____fput+0x15/0x20 [ 50.408140] task_work_run+0x199/0x270 [ 50.411994] ? task_work_cancel+0x210/0x210 [ 50.416289] ? _raw_spin_unlock+0x22/0x30 [ 50.420403] ? switch_task_namespaces+0x87/0xc0 [ 50.425040] do_exit+0x9b5/0x1ad0 [ 50.428460] ? kvfree+0x3b/0x60 [ 50.431706] ? mm_update_next_owner+0x930/0x930 [ 50.436338] ? find_held_lock+0x35/0x1d0 [ 50.440366] ? handle_mm_fault+0x248/0x8d0 [ 50.444565] ? find_held_lock+0x35/0x1d0 [ 50.448594] ? __do_page_fault+0x64c/0xd60 [ 50.452794] ? lock_downgrade+0x990/0x990 [ 50.456911] ? handle_mm_fault+0x410/0x8d0 [ 50.461109] ? __do_page_fault+0x31e/0xd60 [ 50.465308] ? __handle_mm_fault+0x39c0/0x39c0 [ 50.469853] ? vmacache_find+0x5f/0x280 [ 50.473795] ? up_read+0x1a/0x40 [ 50.477126] ? __do_page_fault+0x3d6/0xd60 [ 50.481330] ? mm_fault_error+0x2c0/0x2c0 [ 50.485442] ? do_vfs_ioctl+0x486/0x1520 [ 50.489470] ? do_page_fault+0xee/0x720 [ 50.493408] ? __do_page_fault+0xd60/0xd60 [ 50.497608] ? iterate_fd+0x3f0/0x3f0 [ 50.501371] ? putname+0xf3/0x130 [ 50.504792] do_group_exit+0x149/0x400 [ 50.508645] ? SyS_exit+0x30/0x30 [ 50.512063] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 50.517046] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 50.522091] SyS_exit_group+0x1d/0x20 [ 50.525867] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 50.530586] RIP: 0033:0x443728 [ 50.533740] RSP: 002b:00007ffc5d8ab148 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 50.541412] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443728 [ 50.548646] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 50.555881] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 50.563119] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 50.570354] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000