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.192' (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.364315] ================================================================== [ 41.365549] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.366461] Write of size 8 at addr ffff8801ce16b780 by task syzkaller487272/2984 [ 41.367461] [ 41.367700] CPU: 0 PID: 2984 Comm: syzkaller487272 Not tainted 4.13.0-mm1+ #7 [ 41.368658] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.369882] Call Trace: [ 41.370248] dump_stack+0x194/0x257 [ 41.370749] ? arch_local_irq_restore+0x53/0x53 [ 41.371376] ? show_regs_print_info+0x65/0x65 [ 41.371983] ? lock_timer_base+0x1a3/0x2b0 [ 41.372556] ? detach_if_pending+0x557/0x610 [ 41.373153] print_address_description+0x73/0x250 [ 41.373825] ? detach_if_pending+0x557/0x610 [ 41.374437] kasan_report+0x24e/0x340 [ 41.374958] __asan_report_store8_noabort+0x17/0x20 [ 41.375629] detach_if_pending+0x557/0x610 [ 41.376203] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.376899] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.377525] ? lock_timer_base+0x1a3/0x2b0 [ 41.378097] ? lock_timer_base+0x1eb/0x2b0 [ 41.378673] ? __internal_add_timer+0x2d0/0x2d0 [ 41.379302] ? trace_hardirqs_on+0xd/0x10 [ 41.379869] try_to_del_timer_sync+0xa2/0x120 [ 41.380472] ? del_timer+0x130/0x130 [ 41.380977] ? del_timer_sync+0xeb/0x240 [ 41.381533] del_timer_sync+0x18a/0x240 [ 41.382075] tun_free_netdev+0x105/0x1b0 [ 41.382625] ? tun_xdp+0x410/0x410 [ 41.383104] ? cpumask_next+0x24/0x30 [ 41.383626] ? netdev_refcnt_read+0xed/0x150 [ 41.384225] ? tun_xdp+0x410/0x410 [ 41.384710] netdev_run_todo+0x870/0xca0 [ 41.388744] ? do_group_exit+0x149/0x400 [ 41.392786] ? register_netdev+0x30/0x30 [ 41.396824] ? lock_downgrade+0x990/0x990 [ 41.400947] ? trace_hardirqs_on+0xd/0x10 [ 41.405088] ? refcount_sub_and_test+0x115/0x1b0 [ 41.409820] ? refcount_inc+0x50/0x50 [ 41.413597] ? refcount_inc+0x50/0x50 [ 41.417380] ? sk_destruct+0x4c/0x80 [ 41.421069] ? __sk_free+0x5c/0x230 [ 41.424669] ? sk_free+0x2f/0x40 [ 41.428010] ? __tun_detach+0x176/0x1390 [ 41.432056] ? tun_attach+0xf90/0xf90 [ 41.435831] ? do_raw_spin_trylock+0x190/0x190 [ 41.440389] ? locks_remove_file+0x3fa/0x5a0 [ 41.444770] ? fcntl_setlk+0x10d0/0x10d0 [ 41.448807] ? __fsnotify_parent+0xb4/0x3a0 [ 41.453101] ? fsnotify+0x1af0/0x1af0 [ 41.456878] ? __tun_detach+0x1390/0x1390 [ 41.460995] ? __tun_detach+0x1390/0x1390 [ 41.465117] rtnl_unlock+0xe/0x10 [ 41.468538] tun_chr_close+0x49/0x60 [ 41.472223] __fput+0x333/0x7f0 [ 41.475478] ? fput+0x140/0x140 [ 41.478729] ? check_same_owner+0x320/0x320 [ 41.483021] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.487491] ____fput+0x15/0x20 [ 41.490744] task_work_run+0x199/0x270 [ 41.494603] ? task_work_cancel+0x210/0x210 [ 41.498897] ? _raw_spin_unlock+0x22/0x30 [ 41.503016] ? switch_task_namespaces+0x87/0xc0 [ 41.507660] do_exit+0xa52/0x1b40 [ 41.511084] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.516072] ? check_noncircular+0x20/0x20 [ 41.520284] ? mm_update_next_owner+0x930/0x930 [ 41.524924] ? __pmd_alloc+0x4e0/0x4e0 [ 41.528792] ? find_held_lock+0x39/0x1d0 [ 41.532833] ? lock_downgrade+0x990/0x990 [ 41.536971] ? handle_mm_fault+0x410/0x8d0 [ 41.541176] ? down_read_trylock+0xdb/0x170 [ 41.545469] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.550022] ? vmacache_find+0x61/0x270 [ 41.553974] ? up_read+0x1a/0x40 [ 41.557314] ? __do_page_fault+0x35b/0xb60 [ 41.561519] ? do_vfs_ioctl+0x492/0x1530 [ 41.565557] ? do_page_fault+0xee/0x720 [ 41.569504] ? __do_page_fault+0xb60/0xb60 [ 41.573710] ? putname+0xf3/0x130 [ 41.577142] do_group_exit+0x149/0x400 [ 41.581002] ? lockdep_sys_exit+0x47/0xf0 [ 41.585121] ? SyS_exit+0x30/0x30 [ 41.588546] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.593535] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.598264] SyS_exit_group+0x1d/0x20 [ 41.602035] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.606762] RIP: 0033:0x443ab8 [ 41.609922] RSP: 002b:00007fff0a522f08 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 41.617601] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ab8 [ 41.624841] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 41.632080] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 41.639320] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 41.646561] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 41.653824] [ 41.655424] Allocated by task 2984: [ 41.659024] save_stack_trace+0x16/0x20 [ 41.662969] save_stack+0x43/0xd0 [ 41.666389] kasan_kmalloc+0xad/0xe0 [ 41.670070] __kmalloc_node+0x47/0x70 [ 41.673842] kvmalloc_node+0x64/0xd0 [ 41.677526] alloc_netdev_mqs+0x16e/0xed0 [ 41.681643] __tun_chr_ioctl+0x12be/0x3d20 [ 41.685856] tun_chr_ioctl+0x2a/0x40 [ 41.689537] do_vfs_ioctl+0x1b1/0x1530 [ 41.693393] SyS_ioctl+0x8f/0xc0 [ 41.696738] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.701460] [ 41.703058] Freed by task 2984: [ 41.706308] save_stack_trace+0x16/0x20 [ 41.710250] save_stack+0x43/0xd0 [ 41.713672] kasan_slab_free+0x71/0xc0 [ 41.718050] kfree+0xca/0x250 [ 41.721124] kvfree+0x36/0x60 [ 41.724199] free_netdev+0x2cf/0x360 [ 41.727882] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.732084] tun_chr_ioctl+0x2a/0x40 [ 41.735769] do_vfs_ioctl+0x1b1/0x1530 [ 41.739625] SyS_ioctl+0x8f/0xc0 [ 41.742970] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.747692] [ 41.749289] The buggy address belongs to the object at ffff8801ce168380 [ 41.749289] which belongs to the cache kmalloc-16384 of size 16384 [ 41.762262] The buggy address is located 13312 bytes inside of [ 41.762262] 16384-byte region [ffff8801ce168380, ffff8801ce16c380) [ 41.774460] The buggy address belongs to the page: [ 41.779361] page:ffffea0007385a00 count:1 mapcount:0 mapping:ffff8801ce168380 index:0x0 compound_mapcount: 0 [ 41.789304] flags: 0x200000000008100(slab|head) [ 41.793944] raw: 0200000000008100 ffff8801ce168380 0000000000000000 0000000100000001 [ 41.801793] raw: ffffea000735ee20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.809640] page dumped because: kasan: bad access detected [ 41.815317] [ 41.816912] Memory state around the buggy address: [ 41.821812] ffff8801ce16b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.829139] ffff8801ce16b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.836465] >ffff8801ce16b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.843791] ^ [ 41.847138] ffff8801ce16b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.854465] ffff8801ce16b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.861790] ================================================================== [ 41.869114] Disabling lock debugging due to kernel taint [ 41.874527] Kernel panic - not syncing: panic_on_warn set ... [ 41.874527] [ 41.881854] CPU: 0 PID: 2984 Comm: syzkaller487272 Tainted: G B 4.13.0-mm1+ #7 [ 41.890308] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.900304] Call Trace: [ 41.902868] dump_stack+0x194/0x257 [ 41.906463] ? arch_local_irq_restore+0x53/0x53 [ 41.911102] ? vprintk_default+0x28/0x30 [ 41.915131] ? detach_if_pending+0x550/0x610 [ 41.919507] panic+0x1e4/0x417 [ 41.922666] ? __warn+0x1d9/0x1d9 [ 41.926094] ? detach_if_pending+0x557/0x610 [ 41.930471] kasan_end_report+0x50/0x50 [ 41.934413] kasan_report+0x137/0x340 [ 41.938181] __asan_report_store8_noabort+0x17/0x20 [ 41.943163] detach_if_pending+0x557/0x610 [ 41.947362] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.952515] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.957149] ? lock_timer_base+0x1a3/0x2b0 [ 41.961349] ? lock_timer_base+0x1eb/0x2b0 [ 41.965550] ? __internal_add_timer+0x2d0/0x2d0 [ 41.970201] ? trace_hardirqs_on+0xd/0x10 [ 41.974319] try_to_del_timer_sync+0xa2/0x120 [ 41.978788] ? del_timer+0x130/0x130 [ 41.982466] ? del_timer_sync+0xeb/0x240 [ 41.986494] del_timer_sync+0x18a/0x240 [ 41.990435] tun_free_netdev+0x105/0x1b0 [ 41.994462] ? tun_xdp+0x410/0x410 [ 41.997964] ? cpumask_next+0x24/0x30 [ 42.001732] ? netdev_refcnt_read+0xed/0x150 [ 42.006107] ? tun_xdp+0x410/0x410 [ 42.009611] netdev_run_todo+0x870/0xca0 [ 42.013637] ? do_group_exit+0x149/0x400 [ 42.017663] ? register_netdev+0x30/0x30 [ 42.021694] ? lock_downgrade+0x990/0x990 [ 42.025808] ? trace_hardirqs_on+0xd/0x10 [ 42.029928] ? refcount_sub_and_test+0x115/0x1b0 [ 42.034646] ? refcount_inc+0x50/0x50 [ 42.038410] ? refcount_inc+0x50/0x50 [ 42.042177] ? sk_destruct+0x4c/0x80 [ 42.045853] ? __sk_free+0x5c/0x230 [ 42.049444] ? sk_free+0x2f/0x40 [ 42.052774] ? __tun_detach+0x176/0x1390 [ 42.056803] ? tun_attach+0xf90/0xf90 [ 42.060570] ? do_raw_spin_trylock+0x190/0x190 [ 42.065116] ? locks_remove_file+0x3fa/0x5a0 [ 42.069491] ? fcntl_setlk+0x10d0/0x10d0 [ 42.073519] ? __fsnotify_parent+0xb4/0x3a0 [ 42.077803] ? fsnotify+0x1af0/0x1af0 [ 42.081569] ? __tun_detach+0x1390/0x1390 [ 42.085681] ? __tun_detach+0x1390/0x1390 [ 42.089795] rtnl_unlock+0xe/0x10 [ 42.093211] tun_chr_close+0x49/0x60 [ 42.096889] __fput+0x333/0x7f0 [ 42.100137] ? fput+0x140/0x140 [ 42.103384] ? check_same_owner+0x320/0x320 [ 42.107670] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.112133] ____fput+0x15/0x20 [ 42.115380] task_work_run+0x199/0x270 [ 42.119234] ? task_work_cancel+0x210/0x210 [ 42.123521] ? _raw_spin_unlock+0x22/0x30 [ 42.127634] ? switch_task_namespaces+0x87/0xc0 [ 42.132270] do_exit+0xa52/0x1b40 [ 42.135702] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.140684] ? check_noncircular+0x20/0x20 [ 42.144888] ? mm_update_next_owner+0x930/0x930 [ 42.149524] ? __pmd_alloc+0x4e0/0x4e0 [ 42.153381] ? find_held_lock+0x39/0x1d0 [ 42.157412] ? lock_downgrade+0x990/0x990 [ 42.161534] ? handle_mm_fault+0x410/0x8d0 [ 42.165734] ? down_read_trylock+0xdb/0x170 [ 42.170021] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.174570] ? vmacache_find+0x61/0x270 [ 42.178514] ? up_read+0x1a/0x40 [ 42.181847] ? __do_page_fault+0x35b/0xb60 [ 42.186063] ? do_vfs_ioctl+0x492/0x1530 [ 42.190095] ? do_page_fault+0xee/0x720 [ 42.194033] ? __do_page_fault+0xb60/0xb60 [ 42.198233] ? putname+0xf3/0x130 [ 42.201654] do_group_exit+0x149/0x400 [ 42.205506] ? lockdep_sys_exit+0x47/0xf0 [ 42.209624] ? SyS_exit+0x30/0x30 [ 42.213043] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.218024] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.222746] SyS_exit_group+0x1d/0x20 [ 42.226515] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.231237] RIP: 0033:0x443ab8 [ 42.234393] RSP: 002b:00007fff0a522f08 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 42.242066] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ab8 [ 42.249302] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 42.256535] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 42.263770] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 42.271004] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000