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-3,10.128.0.29' (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: [ 46.877342] ================================================================== [ 46.884787] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 46.891521] Write of size 8 at addr ffff8801ce2337c0 by task syzkaller130305/2985 [ 46.899108] [ 46.900709] CPU: 1 PID: 2985 Comm: syzkaller130305 Not tainted 4.14.0-rc3+ #120 [ 46.908125] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.917450] Call Trace: [ 46.920012] dump_stack+0x194/0x257 [ 46.923620] ? arch_local_irq_restore+0x53/0x53 [ 46.928270] ? show_regs_print_info+0x65/0x65 [ 46.932738] ? lock_timer_base+0x1a3/0x2b0 [ 46.936946] ? detach_if_pending+0x557/0x610 [ 46.941327] print_address_description+0x73/0x250 [ 46.946142] ? detach_if_pending+0x557/0x610 [ 46.950523] kasan_report+0x25b/0x340 [ 46.954298] __asan_report_store8_noabort+0x17/0x20 [ 46.959283] detach_if_pending+0x557/0x610 [ 46.963491] ? trace_raw_output_tick_stop+0x130/0x130 [ 46.968655] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.973293] ? lock_timer_base+0x1a3/0x2b0 [ 46.977500] ? lock_timer_base+0x1eb/0x2b0 [ 46.981710] ? __internal_add_timer+0x2d0/0x2d0 [ 46.986350] ? trace_hardirqs_on+0xd/0x10 [ 46.990476] try_to_del_timer_sync+0xa2/0x120 [ 46.994944] ? del_timer+0x130/0x130 [ 46.998634] ? del_timer_sync+0xeb/0x240 [ 47.002674] del_timer_sync+0x18a/0x240 [ 47.006627] tun_free_netdev+0x105/0x1b0 [ 47.010661] ? tun_xdp+0x410/0x410 [ 47.014172] ? cpumask_next+0x24/0x30 [ 47.017945] ? netdev_refcnt_read+0xed/0x150 [ 47.022333] ? tun_xdp+0x410/0x410 [ 47.025844] netdev_run_todo+0x870/0xca0 [ 47.029882] ? do_group_exit+0x149/0x400 [ 47.033926] ? register_netdev+0x30/0x30 [ 47.037962] ? lock_downgrade+0x990/0x990 [ 47.042079] ? trace_hardirqs_on+0xd/0x10 [ 47.046215] ? refcount_sub_and_test+0x115/0x1b0 [ 47.050945] ? refcount_inc+0x50/0x50 [ 47.054715] ? refcount_inc+0x50/0x50 [ 47.058491] ? sk_destruct+0x4c/0x80 [ 47.062174] ? __sk_free+0x5c/0x230 [ 47.065772] ? sk_free+0x2f/0x40 [ 47.069110] ? __tun_detach+0x176/0x1390 [ 47.073155] ? tun_attach+0xf90/0xf90 [ 47.076935] ? locks_remove_file+0x3fa/0x5a0 [ 47.081315] ? fcntl_setlk+0x10d0/0x10d0 [ 47.085350] ? __fsnotify_parent+0xb4/0x3a0 [ 47.089644] ? fsnotify+0x1af0/0x1af0 [ 47.093425] ? __tun_detach+0x1390/0x1390 [ 47.097544] rtnl_unlock+0xe/0x10 [ 47.100966] tun_chr_close+0x49/0x60 [ 47.104654] __fput+0x333/0x7f0 [ 47.107910] ? fput+0x140/0x140 [ 47.111161] ? check_same_owner+0x320/0x320 [ 47.115463] ____fput+0x15/0x20 [ 47.118714] task_work_run+0x199/0x270 [ 47.122575] ? task_work_cancel+0x210/0x210 [ 47.126868] ? free_nsproxy+0x185/0x1f0 [ 47.130822] ? switch_task_namespaces+0xa2/0xc0 [ 47.135468] do_exit+0x9d2/0x1af0 [ 47.138901] ? mm_update_next_owner+0x930/0x930 [ 47.143542] ? find_held_lock+0x39/0x1d0 [ 47.147585] ? lock_downgrade+0x990/0x990 [ 47.151728] ? handle_mm_fault+0x410/0x8d0 [ 47.156023] ? __do_page_fault+0x31e/0xd60 [ 47.160230] ? __handle_mm_fault+0x39c0/0x39c0 [ 47.164784] ? vmacache_find+0x5f/0x280 [ 47.168738] ? up_read+0x1a/0x40 [ 47.172076] ? __do_page_fault+0x3d6/0xd60 [ 47.176288] ? mm_fault_error+0x2c0/0x2c0 [ 47.180410] ? do_vfs_ioctl+0x492/0x1530 [ 47.184452] ? do_page_fault+0xee/0x720 [ 47.188401] ? __do_page_fault+0xd60/0xd60 [ 47.192612] ? putname+0xf3/0x130 [ 47.196042] do_group_exit+0x149/0x400 [ 47.199900] ? lockdep_sys_exit+0x47/0xf0 [ 47.204018] ? SyS_exit+0x30/0x30 [ 47.207445] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.212436] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.217167] SyS_exit_group+0x1d/0x20 [ 47.220942] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.225680] RIP: 0033:0x445119 [ 47.228840] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 47.236527] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445119 [ 47.243768] RDX: 0000000000445119 RSI: 0000000020341fd8 RDI: 0000000000000001 [ 47.251009] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 47.258251] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402770 [ 47.265493] R13: 0000000000402800 R14: 0000000000000000 R15: 0000000000000000 [ 47.272753] [ 47.274354] Allocated by task 2985: [ 47.277955] save_stack_trace+0x16/0x20 [ 47.281898] save_stack+0x43/0xd0 [ 47.285320] kasan_kmalloc+0xad/0xe0 [ 47.289006] __kmalloc_node+0x47/0x70 [ 47.292775] kvmalloc_node+0x64/0xd0 [ 47.296459] alloc_netdev_mqs+0x16e/0xed0 [ 47.300578] __tun_chr_ioctl+0x12be/0x3d20 [ 47.304781] tun_chr_ioctl+0x2a/0x40 [ 47.308465] do_vfs_ioctl+0x1b1/0x1530 [ 47.312327] SyS_ioctl+0x8f/0xc0 [ 47.315664] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.320385] [ 47.321982] Freed by task 2985: [ 47.325232] save_stack_trace+0x16/0x20 [ 47.329184] save_stack+0x43/0xd0 [ 47.332606] kasan_slab_free+0x71/0xc0 [ 47.336464] kfree+0xca/0x250 [ 47.339539] kvfree+0x36/0x60 [ 47.342613] free_netdev+0x2cf/0x360 [ 47.346295] __tun_chr_ioctl+0x2cf6/0x3d20 [ 47.350498] tun_chr_ioctl+0x2a/0x40 [ 47.354181] do_vfs_ioctl+0x1b1/0x1530 [ 47.358036] SyS_ioctl+0x8f/0xc0 [ 47.361372] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.366093] [ 47.367690] The buggy address belongs to the object at ffff8801ce2303c0 [ 47.367690] which belongs to the cache kmalloc-16384 of size 16384 [ 47.380662] The buggy address is located 13312 bytes inside of [ 47.380662] 16384-byte region [ffff8801ce2303c0, ffff8801ce2343c0) [ 47.392854] The buggy address belongs to the page: [ 47.397752] page:ffffea0007388c00 count:1 mapcount:0 mapping:ffff8801ce2303c0 index:0x0 compound_mapcount: 0 [ 47.407696] flags: 0x200000000008100(slab|head) [ 47.412334] raw: 0200000000008100 ffff8801ce2303c0 0000000000000000 0000000100000001 [ 47.420182] raw: ffffea0007370e20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 47.428029] page dumped because: kasan: bad access detected [ 47.433709] [ 47.435305] Memory state around the buggy address: [ 47.440203] ffff8801ce233680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.447534] ffff8801ce233700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.454860] >ffff8801ce233780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.462187] ^ [ 47.467606] ffff8801ce233800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.474933] ffff8801ce233880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.482259] ================================================================== [ 47.489590] Disabling lock debugging due to kernel taint [ 47.495003] Kernel panic - not syncing: panic_on_warn set ... [ 47.495003] [ 47.502333] CPU: 1 PID: 2985 Comm: syzkaller130305 Tainted: G B 4.14.0-rc3+ #120 [ 47.510956] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 47.520272] Call Trace: [ 47.522826] dump_stack+0x194/0x257 [ 47.526421] ? arch_local_irq_restore+0x53/0x53 [ 47.531054] ? vprintk_default+0x28/0x30 [ 47.535082] ? detach_if_pending+0x540/0x610 [ 47.539454] panic+0x1e4/0x417 [ 47.542611] ? __warn+0x1d9/0x1d9 [ 47.546033] ? detach_if_pending+0x557/0x610 [ 47.550408] kasan_end_report+0x50/0x50 [ 47.554345] kasan_report+0x144/0x340 [ 47.558113] __asan_report_store8_noabort+0x17/0x20 [ 47.563092] detach_if_pending+0x557/0x610 [ 47.567291] ? trace_raw_output_tick_stop+0x130/0x130 [ 47.572447] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 47.577080] ? lock_timer_base+0x1a3/0x2b0 [ 47.581280] ? lock_timer_base+0x1eb/0x2b0 [ 47.585480] ? __internal_add_timer+0x2d0/0x2d0 [ 47.590113] ? trace_hardirqs_on+0xd/0x10 [ 47.594229] try_to_del_timer_sync+0xa2/0x120 [ 47.598691] ? del_timer+0x130/0x130 [ 47.602382] ? del_timer_sync+0xeb/0x240 [ 47.606413] del_timer_sync+0x18a/0x240 [ 47.610355] tun_free_netdev+0x105/0x1b0 [ 47.614385] ? tun_xdp+0x410/0x410 [ 47.617890] ? cpumask_next+0x24/0x30 [ 47.621657] ? netdev_refcnt_read+0xed/0x150 [ 47.626029] ? tun_xdp+0x410/0x410 [ 47.629533] netdev_run_todo+0x870/0xca0 [ 47.633559] ? do_group_exit+0x149/0x400 [ 47.637591] ? register_netdev+0x30/0x30 [ 47.641621] ? lock_downgrade+0x990/0x990 [ 47.645741] ? trace_hardirqs_on+0xd/0x10 [ 47.649862] ? refcount_sub_and_test+0x115/0x1b0 [ 47.654583] ? refcount_inc+0x50/0x50 [ 47.658346] ? refcount_inc+0x50/0x50 [ 47.662112] ? sk_destruct+0x4c/0x80 [ 47.665789] ? __sk_free+0x5c/0x230 [ 47.669378] ? sk_free+0x2f/0x40 [ 47.672710] ? __tun_detach+0x176/0x1390 [ 47.676739] ? tun_attach+0xf90/0xf90 [ 47.680508] ? locks_remove_file+0x3fa/0x5a0 [ 47.684892] ? fcntl_setlk+0x10d0/0x10d0 [ 47.688917] ? __fsnotify_parent+0xb4/0x3a0 [ 47.693205] ? fsnotify+0x1af0/0x1af0 [ 47.696973] ? __tun_detach+0x1390/0x1390 [ 47.701084] rtnl_unlock+0xe/0x10 [ 47.704499] tun_chr_close+0x49/0x60 [ 47.708177] __fput+0x333/0x7f0 [ 47.711423] ? fput+0x140/0x140 [ 47.714668] ? check_same_owner+0x320/0x320 [ 47.718957] ____fput+0x15/0x20 [ 47.722201] task_work_run+0x199/0x270 [ 47.726053] ? task_work_cancel+0x210/0x210 [ 47.730338] ? free_nsproxy+0x185/0x1f0 [ 47.734276] ? switch_task_namespaces+0xa2/0xc0 [ 47.738909] do_exit+0x9d2/0x1af0 [ 47.742328] ? mm_update_next_owner+0x930/0x930 [ 47.746961] ? find_held_lock+0x39/0x1d0 [ 47.750992] ? lock_downgrade+0x990/0x990 [ 47.755118] ? handle_mm_fault+0x410/0x8d0 [ 47.759316] ? __do_page_fault+0x31e/0xd60 [ 47.763518] ? __handle_mm_fault+0x39c0/0x39c0 [ 47.768064] ? vmacache_find+0x5f/0x280 [ 47.772007] ? up_read+0x1a/0x40 [ 47.775336] ? __do_page_fault+0x3d6/0xd60 [ 47.779538] ? mm_fault_error+0x2c0/0x2c0 [ 47.783654] ? do_vfs_ioctl+0x492/0x1530 [ 47.787681] ? do_page_fault+0xee/0x720 [ 47.791618] ? __do_page_fault+0xd60/0xd60 [ 47.795818] ? putname+0xf3/0x130 [ 47.799237] do_group_exit+0x149/0x400 [ 47.803088] ? lockdep_sys_exit+0x47/0xf0 [ 47.807198] ? SyS_exit+0x30/0x30 [ 47.810615] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.815596] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.820316] SyS_exit_group+0x1d/0x20 [ 47.824081] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.828801] RIP: 0033:0x445119 [ 47.831956] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 47.839627] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445119 [ 47.846859] RDX: 0000000000445119 RSI: 0000000020341fd8 RDI: 0000000000000001 [ 47.854094] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 47.861341] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402770 [ 47.868573] R13: 0000000000402800 R14: 0000000000000000 R15: 0000000000000000