================================================================== 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+0x51e/0x550 virt/lib/irqbypass.c:217 Write of size 8 at addr ffff8801b92ffc28 by task syz-executor2/11889 CPU: 1 PID: 11889 Comm: syz-executor2 Not tainted 4.18.0-rc5+ #54 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:438 __list_add include/linux/list.h:64 [inline] list_add include/linux/list.h:79 [inline] irq_bypass_register_consumer+0x51e/0x550 virt/lib/irqbypass.c:217 kvm_irqfd_assign arch/x86/kvm/../../../virt/kvm/eventfd.c:417 [inline] kvm_irqfd+0x198e/0x1ef0 arch/x86/kvm/../../../virt/kvm/eventfd.c:572 kvm_vm_ioctl+0xf80/0x1d80 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3015 netlink: 28 bytes leftover after parsing attributes in process `syz-executor0'. kvm_vm_compat_ioctl+0x143/0x430 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3160 netlink: 28 bytes leftover after parsing attributes in process `syz-executor0'. __do_compat_sys_ioctl fs/compat_ioctl.c:1459 [inline] __se_compat_sys_ioctl fs/compat_ioctl.c:1405 [inline] __ia32_compat_sys_ioctl+0x221/0x640 fs/compat_ioctl.c:1405 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7fd2cb9 Code: 55 08 8b 88 64 cd ff ff 8b 98 68 cd ff ff 89 c8 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 1c 24 c3 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f5fce0ac EFLAGS: 00000282 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000019 RCX: 000000004020ae76 RDX: 0000000020000040 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 11889: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x780 mm/slab.c:3620 kmalloc include/linux/slab.h:513 [inline] kzalloc include/linux/slab.h:707 [inline] kvm_irqfd_assign arch/x86/kvm/../../../virt/kvm/eventfd.c:296 [inline] kvm_irqfd+0x18f/0x1ef0 arch/x86/kvm/../../../virt/kvm/eventfd.c:572 kvm_vm_ioctl+0xf80/0x1d80 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3015 kvm_vm_compat_ioctl+0x143/0x430 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3160 __do_compat_sys_ioctl fs/compat_ioctl.c:1459 [inline] __se_compat_sys_ioctl fs/compat_ioctl.c:1405 [inline] __ia32_compat_sys_ioctl+0x221/0x640 fs/compat_ioctl.c:1405 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 19: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xd9/0x260 mm/slab.c:3813 irqfd_shutdown+0x144/0x1c0 arch/x86/kvm/../../../virt/kvm/eventfd.c:148 process_one_work+0xc73/0x1ba0 kernel/workqueue.c:2153 worker_thread+0x189/0x13c0 kernel/workqueue.c:2296 kthread+0x345/0x410 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412 The buggy address belongs to the object at ffff8801b92ffac0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 360 bytes inside of 512-byte region [ffff8801b92ffac0, ffff8801b92ffcc0) The buggy address belongs to the page: page:ffffea0006e4bfc0 count:1 mapcount:0 mapping:ffff8801da800940 index:0xffff8801b92ff0c0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea00072b7e48 ffffea0006f8e488 ffff8801da800940 raw: ffff8801b92ff0c0 ffff8801b92ff0c0 0000000100000005 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801b92ffb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801b92ffb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801b92ffc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801b92ffc80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801b92ffd00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================