Debian GNU/Linux 7 syzkaller ttyS0 executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program syzkaller login: [ 38.821070] ================================================================== [ 38.821550] BUG: KASAN: double-free or invalid-free in selinux_tun_dev_free_security+0x15/0x20 [ 38.822290] [ 38.822433] CPU: 2 PID: 7669 Comm: syzkaller550482 Not tainted 4.13.0-rc5-next-20170817+ #5 [ 38.823135] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 38.823671] Call Trace: [ 38.823845] dump_stack+0x194/0x257 [ 38.824086] ? arch_local_irq_restore+0x53/0x53 [ 38.824392] ? show_regs_print_info+0x65/0x65 [ 38.824690] ? selinux_tun_dev_free_security+0x15/0x20 [ 38.825037] print_address_description+0x73/0x250 [ 38.825349] ? selinux_tun_dev_free_security+0x15/0x20 [ 38.825684] ? selinux_tun_dev_free_security+0x15/0x20 [ 38.826021] kasan_report_double_free+0x55/0x80 [ 38.826318] kasan_slab_free+0xa3/0xc0 [ 38.826571] kfree+0xca/0x250 [ 38.826773] selinux_tun_dev_free_security+0x15/0x20 [ 38.827098] security_tun_dev_free_security+0x48/0x80 [ 38.827431] __tun_chr_ioctl+0x2cb5/0x3d20 [ 38.827703] ? unwind_get_return_address+0x94/0xa0 [ 38.828029] ? tun_chr_read_iter+0x1e0/0x1e0 [ 38.828312] ? lock_acquire+0x1d5/0x580 [ 38.828567] ? handle_mm_fault+0x23e/0x940 [ 38.828862] ? lock_downgrade+0x990/0x990 [ 38.829131] ? __do_page_fault+0x51b/0xb60 [ 38.829398] ? lock_downgrade+0x990/0x990 [ 38.829669] ? check_same_owner+0x320/0x320 [ 38.829948] ? __handle_mm_fault+0x3980/0x3980 [ 38.830243] ? vmacache_find+0x61/0x270 [ 38.830505] ? tun_chr_compat_ioctl+0x30/0x30 [ 38.830885] tun_chr_ioctl+0x2a/0x40 [ 38.831124] ? tun_chr_ioctl+0x2a/0x40 [ 38.831372] do_vfs_ioctl+0x1b1/0x1520 [ 38.831623] ? _cond_resched+0x14/0x30 [ 38.831873] ? ioctl_preallocate+0x2b0/0x2b0 [ 38.832158] ? selinux_capable+0x40/0x40 [ 38.832419] ? putname+0xf3/0x130 [ 38.832644] ? do_sys_open+0x320/0x6d0 [ 38.832904] ? security_file_ioctl+0x7d/0xb0 [ 38.833184] ? security_file_ioctl+0x89/0xb0 [ 38.833465] SyS_ioctl+0x8f/0xc0 [ 38.833686] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.833989] RIP: 0033:0x439729 [ 38.834191] RSP: 002b:00007ffcb9311968 EFLAGS: 00000217 ORIG_RAX: 0000000000000010 [ 38.834675] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000439729 [ 38.835128] RDX: 0000000020533000 RSI: 00000000400454ca RDI: 0000000000000005 [ 38.835589] RBP: 0000000000009778 R08: 0000000000000000 R09: 0000000000000000 [ 38.836045] R10: 00000000000000fd R11: 0000000000000217 R12: 0000000000000000 [ 38.836498] R13: 0000000000402040 R14: 00000000004020d0 R15: 0000000000000000 [ 38.836967] [ 38.837075] Allocated by task 7669: [ 38.837306] save_stack_trace+0x16/0x20 [ 38.837562] save_stack+0x43/0xd0 [ 38.837783] kasan_kmalloc+0xad/0xe0 [ 38.838020] kmem_cache_alloc_trace+0x136/0x750 [ 38.838321] selinux_tun_dev_alloc_security+0x49/0x170 [ 38.838659] security_tun_dev_alloc_security+0x6d/0xa0 [ 38.838991] __tun_chr_ioctl+0x1730/0x3d20 [ 38.839263] tun_chr_ioctl+0x2a/0x40 [ 38.839498] do_vfs_ioctl+0x1b1/0x1520 [ 38.839742] SyS_ioctl+0x8f/0xc0 [ 38.839958] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.840257] [ 38.840362] Freed by task 7669: [ 38.840574] save_stack_trace+0x16/0x20 [ 38.840838] save_stack+0x43/0xd0 [ 38.841060] kasan_slab_free+0x71/0xc0 [ 38.841313] kfree+0xca/0x250 [ 38.841514] selinux_tun_dev_free_security+0x15/0x20 [ 38.842208] security_tun_dev_free_security+0x48/0x80 [ 38.842626] tun_free_netdev+0x13b/0x1b0 [ 38.842885] register_netdevice+0x92b/0xf40 [ 38.843163] __tun_chr_ioctl+0x1caf/0x3d20 [ 38.843432] tun_chr_ioctl+0x2a/0x40 [ 38.843669] do_vfs_ioctl+0x1b1/0x1520 [ 38.843917] SyS_ioctl+0x8f/0xc0 [ 38.844134] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.844435] [ 38.844544] The buggy address belongs to the object at ffff88006a8e9000 [ 38.844544] which belongs to the cache kmalloc-32 of size 32 [ 38.845340] The buggy address is located 0 bytes inside of [ 38.845340] 32-byte region [ffff88006a8e9000, ffff88006a8e9020) [ 38.846068] The buggy address belongs to the page: [ 38.846382] page:ffffea0001aa3a40 count:1 mapcount:0 mapping:ffff88006a8e9000 index:0xffff88006a8e9fc1 [ 38.846973] flags: 0x500000000000100(slab) [ 38.847224] raw: 0500000000000100 ffff88006a8e9000 ffff88006a8e9fc1 0000000100000028 [ 38.847828] raw: ffffea0001b21160 ffffea0001b3dd20 ffff88003e8001c0 0000000000000000 [ 38.848501] page dumped because: kasan: bad access detected [ 38.849002] [ 38.849144] Memory state around the buggy address: [ 38.849567] ffff88006a8e8f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 38.850197] ffff88006a8e8f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 38.850827] >ffff88006a8e9000: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc [ 38.851455] ^ [ 38.851748] ffff88006a8e9080: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc [ 38.852376] ffff88006a8e9100: 05 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc [ 38.853008] ================================================================== [ 38.853635] Kernel panic - not syncing: panic_on_warn set ... [ 38.853635] [ 38.854265] CPU: 2 PID: 7669 Comm: syzkaller550482 Tainted: G B 4.13.0-rc5-next-20170817+ #5 [ 38.855077] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 38.855765] Call Trace: [ 38.855991] dump_stack+0x194/0x257 [ 38.856300] ? arch_local_irq_restore+0x53/0x53 [ 38.856692] ? kasan_end_report+0x32/0x50 [ 38.857053] ? lock_downgrade+0x990/0x990 [ 38.857405] panic+0x1e4/0x417 [ 38.857677] ? __warn+0x1d9/0x1d9 [ 38.857967] ? show_regs_print_info+0x65/0x65 [ 38.858353] ? selinux_tun_dev_free_security+0x15/0x20 [ 38.858795] ? selinux_tun_dev_free_security+0x15/0x20 [ 38.859242] kasan_end_report+0x50/0x50 [ 38.859577] kasan_report_double_free+0x72/0x80 [ 38.859970] kasan_slab_free+0xa3/0xc0 [ 38.860299] kfree+0xca/0x250 [ 38.860559] selinux_tun_dev_free_security+0x15/0x20 [ 38.860988] security_tun_dev_free_security+0x48/0x80 [ 38.861417] __tun_chr_ioctl+0x2cb5/0x3d20 [ 38.861768] ? unwind_get_return_address+0x94/0xa0 [ 38.862180] ? tun_chr_read_iter+0x1e0/0x1e0 [ 38.862548] ? lock_acquire+0x1d5/0x580 [ 38.862879] ? handle_mm_fault+0x23e/0x940 [ 38.863229] ? lock_downgrade+0x990/0x990 [ 38.863583] ? __do_page_fault+0x51b/0xb60 [ 38.864222] ? lock_downgrade+0x990/0x990 [ 38.864569] ? check_same_owner+0x320/0x320 [ 38.864940] ? __handle_mm_fault+0x3980/0x3980 [ 38.865318] ? vmacache_find+0x61/0x270 [ 38.865649] ? tun_chr_compat_ioctl+0x30/0x30 [ 38.866021] tun_chr_ioctl+0x2a/0x40 [ 38.866331] ? tun_chr_ioctl+0x2a/0x40 [ 38.866654] do_vfs_ioctl+0x1b1/0x1520 [ 38.866977] ? _cond_resched+0x14/0x30 [ 38.867298] ? ioctl_preallocate+0x2b0/0x2b0 [ 38.867666] ? selinux_capable+0x40/0x40 [ 38.868006] ? putname+0xf3/0x130 [ 38.868296] ? do_sys_open+0x320/0x6d0 [ 38.868623] ? security_file_ioctl+0x7d/0xb0 [ 38.868991] ? security_file_ioctl+0x89/0xb0 [ 38.869362] SyS_ioctl+0x8f/0xc0 [ 38.869645] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 38.870038] RIP: 0033:0x439729 [ 38.870301] RSP: 002b:00007ffcb9311968 EFLAGS: 00000217 ORIG_RAX: 0000000000000010 [ 38.870936] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000439729 [ 38.871532] RDX: 0000000020533000 RSI: 00000000400454ca RDI: 0000000000000005 [ 38.872132] RBP: 0000000000009778 R08: 0000000000000000 R09: 0000000000000000 [ 38.872731] R10: 00000000000000fd R11: 0000000000000217 R12: 0000000000000000 [ 38.873329] R13: 0000000000402040 R14: 00000000004020d0 R15: 0000000000000000 [ 38.874016] Dumping ftrace buffer: [ 38.874271] (ftrace buffer empty) [ 38.874521] Kernel Offset: disabled [ 38.874766] Rebooting in 86400 seconds..