BUG: KASAN: use-after-free in __list_add include/linux/list.h:64 [inline] BUG: KASAN: use-after-free in list_add include/linux/list.h:79 [inline] BUG: KASAN: use-after-free in irq_bypass_register_consumer+0x4b4/0x500 virt/lib/irqbypass.c:217 Write of size 8 at addr ffff8801ca0a4e00 by task syz-executor4/3147 CPU: 1 PID: 3147 Comm: syz-executor4 Not tainted 4.14.0-rc8-mm1+ #21 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/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:435 __list_add include/linux/list.h:64 [inline] list_add include/linux/list.h:79 [inline] irq_bypass_register_consumer+0x4b4/0x500 virt/lib/irqbypass.c:217 kvm_irqfd_assign arch/x86/kvm/../../../virt/kvm/eventfd.c:417 [inline] kvm_irqfd+0x137a/0x1d50 arch/x86/kvm/../../../virt/kvm/eventfd.c:572 kvm_vm_ioctl+0x1079/0x1c40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2988 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x452879 RSP: 002b:00007f0bb71f1be8 EFLAGS: 00000212 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000758020 RCX: 0000000000452879 RDX: 0000000020227000 RSI: 000000004020ae76 RDI: 000000000000000f RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f1460 R13: 00000000ffffffff R14: 00007f0bb71f26d4 R15: 0000000000000000 Allocated by task 3147: 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:551 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3614 kmalloc include/linux/slab.h:514 [inline] kzalloc include/linux/slab.h:703 [inline] kvm_irqfd_assign arch/x86/kvm/../../../virt/kvm/eventfd.c:296 [inline] kvm_irqfd+0x16c/0x1d50 arch/x86/kvm/../../../virt/kvm/eventfd.c:572 kvm_vm_ioctl+0x1079/0x1c40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2988 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 entry_SYSCALL_64_fastpath+0x1f/0x96 Freed by task 24: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3492 [inline] kfree+0xca/0x250 mm/slab.c:3807 irqfd_shutdown+0x13c/0x1a0 arch/x86/kvm/../../../virt/kvm/eventfd.c:148 process_one_work+0xbfa/0x1bc0 kernel/workqueue.c:2112 worker_thread+0x223/0x1990 kernel/workqueue.c:2246 kthread+0x37a/0x440 kernel/kthread.c:238 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:437 The buggy address belongs to the object at ffff8801ca0a4c80 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 384 bytes inside of 512-byte region [ffff8801ca0a4c80, ffff8801ca0a4e80) The buggy address belongs to the page: page:ffffea0007282900 count:1 mapcount:0 mapping:ffff8801ca0a4000 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801ca0a4000 0000000000000000 0000000100000006 raw: ffffea0007273760 ffffea0007273660 ffff8801db000940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ca0a4d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ca0a4d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801ca0a4e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801ca0a4e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801ca0a4f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================