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.0.41' (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: [ 42.145280] ================================================================== [ 42.152843] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 42.159570] Write of size 8 at addr ffff8801cc2a3780 by task syzkaller167035/3044 [ 42.167161] [ 42.168763] CPU: 0 PID: 3044 Comm: syzkaller167035 Not tainted 4.13.0+ #70 [ 42.175757] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.185087] Call Trace: [ 42.187653] dump_stack+0x194/0x257 [ 42.191255] ? arch_local_irq_restore+0x53/0x53 [ 42.195900] ? show_regs_print_info+0x65/0x65 [ 42.200370] ? lock_timer_base+0x1a3/0x2b0 [ 42.204587] ? detach_if_pending+0x557/0x610 [ 42.208979] print_address_description+0x73/0x250 [ 42.213794] ? detach_if_pending+0x557/0x610 [ 42.218174] kasan_report+0x24e/0x340 [ 42.221950] __asan_report_store8_noabort+0x17/0x20 [ 42.226936] detach_if_pending+0x557/0x610 [ 42.231144] ? __next_timer_interrupt+0x150/0x150 [ 42.235968] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.240606] ? lock_timer_base+0x1a3/0x2b0 [ 42.244813] ? lock_timer_base+0x1eb/0x2b0 [ 42.249021] ? __internal_add_timer+0x2d0/0x2d0 [ 42.253674] try_to_del_timer_sync+0xa2/0x120 [ 42.258159] ? del_timer+0x130/0x130 [ 42.261855] ? del_timer_sync+0xeb/0x240 [ 42.265894] del_timer_sync+0x18a/0x240 [ 42.269846] tun_free_netdev+0x105/0x1b0 [ 42.273890] ? tun_show_group+0x170/0x170 [ 42.278023] ? netdev_refcnt_read+0xf4/0x160 [ 42.282429] ? tun_show_group+0x170/0x170 [ 42.286551] netdev_run_todo+0x870/0xca0 [ 42.290595] ? do_group_exit+0x149/0x400 [ 42.295684] ? register_netdev+0x30/0x30 [ 42.299723] ? lock_downgrade+0x990/0x990 [ 42.303851] ? trace_hardirqs_on+0xd/0x10 [ 42.307989] ? refcount_sub_and_test+0x115/0x1b0 [ 42.312717] ? refcount_inc+0x50/0x50 [ 42.316488] ? refcount_inc+0x50/0x50 [ 42.320264] ? sk_destruct+0x4c/0x80 [ 42.323956] ? __sk_free+0x5c/0x230 [ 42.327564] ? sk_free+0x2f/0x40 [ 42.330908] ? __tun_detach+0x176/0x1390 [ 42.334973] ? tun_attach+0xf90/0xf90 [ 42.338752] ? do_raw_spin_trylock+0x190/0x190 [ 42.343307] ? locks_remove_file+0x414/0x560 [ 42.347774] ? fcntl_setlk+0x10d0/0x10d0 [ 42.351815] ? __fsnotify_parent+0xb4/0x3a0 [ 42.356109] ? fsnotify+0x1af0/0x1af0 [ 42.359884] ? __tun_detach+0x1390/0x1390 [ 42.364004] ? __tun_detach+0x1390/0x1390 [ 42.368123] rtnl_unlock+0xe/0x10 [ 42.371548] tun_chr_close+0x49/0x60 [ 42.375233] __fput+0x333/0x7f0 [ 42.378490] ? fput+0x140/0x140 [ 42.381777] ? check_same_owner+0x320/0x320 [ 42.386082] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.390558] ____fput+0x15/0x20 [ 42.393816] task_work_run+0x199/0x270 [ 42.397677] ? task_work_cancel+0x210/0x210 [ 42.401982] ? _raw_spin_unlock+0x22/0x30 [ 42.406111] ? switch_task_namespaces+0x87/0xc0 [ 42.410757] do_exit+0xa52/0x1b40 [ 42.414186] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.419177] ? check_noncircular+0x20/0x20 [ 42.423389] ? mm_update_next_owner+0x930/0x930 [ 42.428034] ? __pmd_alloc+0x4e0/0x4e0 [ 42.431915] ? find_held_lock+0x39/0x1d0 [ 42.435983] ? lock_downgrade+0x990/0x990 [ 42.440123] ? handle_mm_fault+0x4a2/0x860 [ 42.444327] ? down_read_trylock+0xdb/0x170 [ 42.448620] ? __handle_mm_fault+0x3840/0x3840 [ 42.453181] ? vmacache_find+0x61/0x270 [ 42.457132] ? up_read+0x1a/0x40 [ 42.460472] ? __do_page_fault+0x35b/0xb60 [ 42.464676] ? do_vfs_ioctl+0x492/0x1530 [ 42.468716] ? do_page_fault+0xee/0x720 [ 42.472663] ? __do_page_fault+0xb60/0xb60 [ 42.476869] ? putname+0xf3/0x130 [ 42.480309] do_group_exit+0x149/0x400 [ 42.484169] ? lockdep_sys_exit+0x47/0xf0 [ 42.488295] ? SyS_exit+0x30/0x30 [ 42.491722] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.496712] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.501443] SyS_exit_group+0x1d/0x20 [ 42.505216] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.509944] RIP: 0033:0x443aa8 [ 42.513108] RSP: 002b:00007ffd57463dd8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 42.520790] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443aa8 [ 42.528032] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 42.535272] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 42.542513] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 42.549753] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 42.557013] [ 42.558613] Allocated by task 3044: [ 42.562214] save_stack_trace+0x16/0x20 [ 42.566158] save_stack+0x43/0xd0 [ 42.569582] kasan_kmalloc+0xad/0xe0 [ 42.573288] __kmalloc_node+0x47/0x70 [ 42.577059] kvmalloc_node+0x64/0xd0 [ 42.580744] alloc_netdev_mqs+0x16e/0xed0 [ 42.584863] __tun_chr_ioctl+0x12be/0x3d70 [ 42.589079] tun_chr_ioctl+0x2a/0x40 [ 42.592763] do_vfs_ioctl+0x1b1/0x1530 [ 42.596619] SyS_ioctl+0x8f/0xc0 [ 42.599959] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.604682] [ 42.606281] Freed by task 3044: [ 42.609530] save_stack_trace+0x16/0x20 [ 42.613474] save_stack+0x43/0xd0 [ 42.616897] kasan_slab_free+0x71/0xc0 [ 42.620753] kfree+0xca/0x250 [ 42.623828] kvfree+0x36/0x60 [ 42.626928] free_netdev+0x2cf/0x360 [ 42.630614] __tun_chr_ioctl+0x2d30/0x3d70 [ 42.634826] tun_chr_ioctl+0x2a/0x40 [ 42.638509] do_vfs_ioctl+0x1b1/0x1530 [ 42.642366] SyS_ioctl+0x8f/0xc0 [ 42.645705] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.650428] [ 42.652028] The buggy address belongs to the object at ffff8801cc2a0380 [ 42.652028] which belongs to the cache kmalloc-16384 of size 16384 [ 42.665013] The buggy address is located 13312 bytes inside of [ 42.665013] 16384-byte region [ffff8801cc2a0380, ffff8801cc2a4380) [ 42.677203] The buggy address belongs to the page: [ 42.682103] page:ffffea000730a800 count:1 mapcount:0 mapping:ffff8801cc2a0380 index:0x0 compound_mapcount: 0 [ 42.692316] flags: 0x200000000008100(slab|head) [ 42.696971] raw: 0200000000008100 ffff8801cc2a0380 0000000000000000 0000000100000001 [ 42.704821] raw: ffffea00072e9020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 42.712669] page dumped because: kasan: bad access detected [ 42.718347] [ 42.719955] Memory state around the buggy address: [ 42.724854] ffff8801cc2a3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.732183] ffff8801cc2a3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.739535] >ffff8801cc2a3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.746873] ^ [ 42.750222] ffff8801cc2a3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.757551] ffff8801cc2a3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.764879] ================================================================== [ 42.772214] Disabling lock debugging due to kernel taint [ 42.777627] Kernel panic - not syncing: panic_on_warn set ... [ 42.777627] [ 42.784954] CPU: 0 PID: 3044 Comm: syzkaller167035 Tainted: G B 4.13.0+ #70 [ 42.793163] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.802499] Call Trace: [ 42.805059] dump_stack+0x194/0x257 [ 42.808655] ? arch_local_irq_restore+0x53/0x53 [ 42.813293] ? vprintk_default+0x28/0x30 [ 42.817322] ? detach_if_pending+0x4a0/0x610 [ 42.821696] panic+0x1e4/0x417 [ 42.824852] ? __warn+0x1d9/0x1d9 [ 42.828275] ? detach_if_pending+0x557/0x610 [ 42.832650] kasan_end_report+0x50/0x50 [ 42.836587] kasan_report+0x137/0x340 [ 42.840355] __asan_report_store8_noabort+0x17/0x20 [ 42.845352] detach_if_pending+0x557/0x610 [ 42.849551] ? __next_timer_interrupt+0x150/0x150 [ 42.854362] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.858994] ? lock_timer_base+0x1a3/0x2b0 [ 42.863192] ? lock_timer_base+0x1eb/0x2b0 [ 42.867395] ? __internal_add_timer+0x2d0/0x2d0 [ 42.872036] try_to_del_timer_sync+0xa2/0x120 [ 42.876516] ? del_timer+0x130/0x130 [ 42.880195] ? del_timer_sync+0xeb/0x240 [ 42.884245] del_timer_sync+0x18a/0x240 [ 42.888188] tun_free_netdev+0x105/0x1b0 [ 42.892214] ? tun_show_group+0x170/0x170 [ 42.896330] ? netdev_refcnt_read+0xf4/0x160 [ 42.900706] ? tun_show_group+0x170/0x170 [ 42.904917] netdev_run_todo+0x870/0xca0 [ 42.908956] ? do_group_exit+0x149/0x400 [ 42.912984] ? register_netdev+0x30/0x30 [ 42.917014] ? lock_downgrade+0x990/0x990 [ 42.921129] ? trace_hardirqs_on+0xd/0x10 [ 42.925254] ? refcount_sub_and_test+0x115/0x1b0 [ 42.929976] ? refcount_inc+0x50/0x50 [ 42.933743] ? refcount_inc+0x50/0x50 [ 42.937525] ? sk_destruct+0x4c/0x80 [ 42.941202] ? __sk_free+0x5c/0x230 [ 42.944794] ? sk_free+0x2f/0x40 [ 42.948125] ? __tun_detach+0x176/0x1390 [ 42.952155] ? tun_attach+0xf90/0xf90 [ 42.955923] ? do_raw_spin_trylock+0x190/0x190 [ 42.960474] ? locks_remove_file+0x414/0x560 [ 42.964849] ? fcntl_setlk+0x10d0/0x10d0 [ 42.968887] ? __fsnotify_parent+0xb4/0x3a0 [ 42.973175] ? fsnotify+0x1af0/0x1af0 [ 42.976947] ? __tun_detach+0x1390/0x1390 [ 42.981061] ? __tun_detach+0x1390/0x1390 [ 42.985175] rtnl_unlock+0xe/0x10 [ 42.988592] tun_chr_close+0x49/0x60 [ 42.992286] __fput+0x333/0x7f0 [ 42.995550] ? fput+0x140/0x140 [ 42.998798] ? check_same_owner+0x320/0x320 [ 43.003085] ? _raw_spin_unlock_irq+0x27/0x70 [ 43.007570] ____fput+0x15/0x20 [ 43.010819] task_work_run+0x199/0x270 [ 43.014673] ? task_work_cancel+0x210/0x210 [ 43.018960] ? _raw_spin_unlock+0x22/0x30 [ 43.023073] ? switch_task_namespaces+0x87/0xc0 [ 43.027709] do_exit+0xa52/0x1b40 [ 43.031130] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.036134] ? check_noncircular+0x20/0x20 [ 43.040339] ? mm_update_next_owner+0x930/0x930 [ 43.044979] ? __pmd_alloc+0x4e0/0x4e0 [ 43.048837] ? find_held_lock+0x39/0x1d0 [ 43.052867] ? lock_downgrade+0x990/0x990 [ 43.056991] ? handle_mm_fault+0x4a2/0x860 [ 43.061198] ? down_read_trylock+0xdb/0x170 [ 43.065485] ? __handle_mm_fault+0x3840/0x3840 [ 43.070031] ? vmacache_find+0x61/0x270 [ 43.073972] ? up_read+0x1a/0x40 [ 43.077319] ? __do_page_fault+0x35b/0xb60 [ 43.081518] ? do_vfs_ioctl+0x492/0x1530 [ 43.085547] ? do_page_fault+0xee/0x720 [ 43.089495] ? __do_page_fault+0xb60/0xb60 [ 43.093695] ? putname+0xf3/0x130 [ 43.097116] do_group_exit+0x149/0x400 [ 43.100968] ? lockdep_sys_exit+0x47/0xf0 [ 43.105081] ? SyS_exit+0x30/0x30 [ 43.108503] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.113487] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 43.118229] SyS_exit_group+0x1d/0x20 [ 43.121996] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.126716] RIP: 0033:0x443aa8 [ 43.129873] RSP: 002b:00007ffd57463dd8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 43.137557] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443aa8