audit: type=1400 audit(1520718523.436:4061): avc: denied { net_admin } for pid=4296 comm="syz-executor5" capability=12 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1 ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3d4d/0x3e00 kernel/locking/lockdep.c:3310 Read of size 8 at addr ffff8801ccf57858 by task syz-executor1/10973 CPU: 0 PID: 10973 Comm: syz-executor1 Not tainted 4.16.0-rc4+ #259 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x24d lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23c/0x360 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __lock_acquire+0x3d4d/0x3e00 kernel/locking/lockdep.c:3310 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152 remove_wait_queue+0x81/0x350 kernel/sched/wait.c:50 vhost_poll_stop+0x46/0x90 drivers/vhost/vhost.c:229 vhost_net_disable_vq drivers/vhost/net.c:405 [inline] vhost_net_stop_vq+0x90/0xf0 drivers/vhost/net.c:972 vhost_net_stop drivers/vhost/net.c:982 [inline] vhost_net_release+0x49/0x190 drivers/vhost/net.c:1015 __fput+0x327/0x7e0 fs/file_table.c:209 ____fput+0x15/0x20 fs/file_table.c:243 task_work_run+0x199/0x270 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9bb/0x1ad0 kernel/exit.c:865 do_group_exit+0x149/0x400 kernel/exit.c:968 get_signal+0x73a/0x16d0 kernel/signal.c:2469 do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath+0x487/0x550 arch/x86/entry/common.c:265 ret_from_fork+0x15/0x50 arch/x86/entry/entry_64.S:399 RIP: 0023:0x807f044 RSP: 002b:00000000f7712224 EFLAGS: 00000296 ORIG_RAX: 0000000000000078 RAX: 0000000000000000 RBX: 00000000003d0f00 RCX: 00000000f7712224 RDX: 00000000f7712ba8 RSI: 000000000844e8e0 RDI: 00000000f7712ba8 RBP: 000000000844e988 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 10960: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552 __do_kmalloc mm/slab.c:3705 [inline] __kmalloc+0x162/0x760 mm/slab.c:3714 kmalloc include/linux/slab.h:517 [inline] sk_prot_alloc+0x101/0x2a0 net/core/sock.c:1471 sk_alloc+0x105/0x1440 net/core/sock.c:1525 tun_chr_open+0xec/0x4b0 drivers/net/tun.c:3134 misc_open+0x382/0x500 drivers/char/misc.c:154 chrdev_open+0x257/0x730 fs/char_dev.c:417 do_dentry_open+0x667/0xd40 fs/open.c:752 vfs_open+0x107/0x220 fs/open.c:866 do_last fs/namei.c:3378 [inline] path_openat+0x1151/0x3530 fs/namei.c:3518 do_filp_open+0x25b/0x3b0 fs/namei.c:3553 do_sys_open+0x502/0x6d0 fs/open.c:1059 C_SYSC_open fs/open.c:1096 [inline] compat_SyS_open+0x2a/0x40 fs/open.c:1094 do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 10973: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3485 [inline] kfree+0xd9/0x260 mm/slab.c:3800 sk_prot_free net/core/sock.c:1508 [inline] __sk_destruct+0x750/0x920 net/core/sock.c:1590 sk_destruct+0x47/0x80 net/core/sock.c:1598 __sk_free+0xf1/0x2b0 net/core/sock.c:1609 sk_free+0x2a/0x40 net/core/sock.c:1620 sock_put include/net/sock.h:1658 [inline] __tun_detach+0x60d/0x10b0 drivers/net/tun.c:738 tun_detach drivers/net/tun.c:745 [inline] tun_chr_close+0x44/0x60 drivers/net/tun.c:3167 __fput+0x327/0x7e0 fs/file_table.c:209 ____fput+0x15/0x20 fs/file_table.c:243 task_work_run+0x199/0x270 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9bb/0x1ad0 kernel/exit.c:865 do_group_exit+0x149/0x400 kernel/exit.c:968 get_signal+0x73a/0x16d0 kernel/signal.c:2469 do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath+0x487/0x550 arch/x86/entry/common.c:265 ret_from_fork+0x15/0x50 arch/x86/entry/entry_64.S:399 The buggy address belongs to the object at ffff8801ccf573c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1176 bytes inside of 2048-byte region [ffff8801ccf573c0, ffff8801ccf57bc0) The buggy address belongs to the page: page:ffffea000733d580 count:1 mapcount:0 mapping:ffff8801ccf562c0 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801ccf562c0 0000000000000000 0000000100000003 raw: ffffea00072fffa0 ffffea0006aa5ba0 ffff8801dac00c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ccf57700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ccf57780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801ccf57800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801ccf57880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ccf57900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================