================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:102 [inline] BUG: KASAN: use-after-free in atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] BUG: KASAN: use-after-free in queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock include/linux/spinlock.h:186 [inline] BUG: KASAN: use-after-free in __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] BUG: KASAN: use-after-free in _raw_spin_lock_bh+0x97/0x1b0 kernel/locking/spinlock.c:178 Write of size 4 at addr ffff88812e854588 by task kworker/0:4/332 CPU: 0 PID: 332 Comm: kworker/0:4 Not tainted 6.1.75-syzkaller-00112-gaf361f9a1066 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: vsock-loopback vsock_loopback_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 kasan_check_range+0x294/0x2a0 mm/kasan/generic.c:189 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:102 [inline] atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] do_raw_spin_lock include/linux/spinlock.h:186 [inline] __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] _raw_spin_lock_bh+0x97/0x1b0 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:355 [inline] virtio_transport_space_update net/vmw_vsock/virtio_transport_common.c:1171 [inline] virtio_transport_recv_pkt+0x6d3/0x4130 net/vmw_vsock/virtio_transport_common.c:1307 vsock_loopback_work+0x37d/0x3f0 net/vmw_vsock/vsock_loopback.c:137 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2299 worker_thread+0xa60/0x1260 kernel/workqueue.c:2446 kthread+0x26d/0x300 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 10244: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x9c/0xb0 mm/kasan/common.c:388 kasan_kmalloc include/linux/kasan.h:212 [inline] kmalloc_trace+0x44/0xa0 mm/slab_common.c:1052 kmalloc include/linux/slab.h:553 [inline] kzalloc include/linux/slab.h:689 [inline] virtio_transport_do_socket_init+0x56/0x2d0 net/vmw_vsock/virtio_transport_common.c:604 vsock_assign_transport+0x473/0x5b0 net/vmw_vsock/af_vsock.c:506 vsock_connect+0x5cf/0xd30 net/vmw_vsock/af_vsock.c:1361 __sys_connect_file net/socket.c:1996 [inline] __sys_connect+0x2c9/0x300 net/socket.c:2013 __do_sys_connect net/socket.c:2023 [inline] __se_sys_connect net/socket.c:2020 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2020 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 10244: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook mm/slub.c:1771 [inline] slab_free mm/slub.c:3684 [inline] __kmem_cache_free+0x218/0x3b0 mm/slub.c:3697 kfree+0x7a/0xf0 mm/slab_common.c:1009 virtio_transport_destruct+0x3b/0x40 net/vmw_vsock/virtio_transport_common.c:815 vsock_deassign_transport net/vmw_vsock/af_vsock.c:421 [inline] vsock_assign_transport+0x32b/0x5b0 net/vmw_vsock/af_vsock.c:489 vsock_connect+0x5cf/0xd30 net/vmw_vsock/af_vsock.c:1361 __sys_connect_file net/socket.c:1996 [inline] __sys_connect+0x2c9/0x300 net/socket.c:2013 __do_sys_connect net/socket.c:2023 [inline] __se_sys_connect net/socket.c:2020 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2020 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88812e854580 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 8 bytes inside of 96-byte region [ffff88812e854580, ffff88812e8545e0) The buggy address belongs to the physical page: page:ffffea0004ba1500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12e854 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea0004510a80 dead000000000007 ffff888100042900 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 9236, tgid 9234 (syz-executor.2), ts 261268344276, free_ts 261210624254 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2566 prep_new_page+0x1b/0x110 mm/page_alloc.c:2573 get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4397 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5684 alloc_slab_page+0x6c/0xf0 allocate_slab mm/slub.c:1962 [inline] new_slab+0x90/0x3e0 mm/slub.c:2015 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203 __slab_alloc+0x5d/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] __kmem_cache_alloc_node+0x1af/0x250 mm/slub.c:3460 __do_kmalloc_node mm/slab_common.c:956 [inline] __kmalloc_node+0xa3/0x1e0 mm/slab_common.c:964 kmalloc_node include/linux/slab.h:579 [inline] __vmalloc_area_node mm/vmalloc.c:3048 [inline] __vmalloc_node_range+0x581/0x1540 mm/vmalloc.c:3234 __vmalloc_node mm/vmalloc.c:3299 [inline] __vmalloc+0x7a/0x90 mm/vmalloc.c:3313 kvm_arch_alloc_vm arch/x86/include/asm/kvm_host.h:1705 [inline] kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1149 [inline] kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:5009 [inline] kvm_dev_ioctl+0x19c/0x10d0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:5051 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0x114/0x190 fs/ioctl.c:856 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1474 [inline] free_pcp_prepare mm/page_alloc.c:1548 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3470 free_unref_page_list+0xf1/0x7b0 mm/page_alloc.c:3618 release_pages+0xf7f/0xfe0 mm/swap.c:1063 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:314 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu mm/mmu_gather.c:261 [inline] tlb_finish_mmu+0x1e0/0x3f0 mm/mmu_gather.c:361 exit_mmap+0x421/0x940 mm/mmap.c:3343 __mmput+0x95/0x310 kernel/fork.c:1298 mmput+0x56/0x170 kernel/fork.c:1321 exit_mm kernel/exit.c:566 [inline] do_exit+0xb29/0x2b80 kernel/exit.c:862 do_group_exit+0x21a/0x2d0 kernel/exit.c:1025 get_signal+0x169d/0x1820 kernel/signal.c:2879 arch_do_signal_or_restart+0xb0/0x16f0 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x74/0xa0 kernel/entry/common.c:168 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x26/0x140 kernel/entry/common.c:297 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:87 Memory state around the buggy address: ffff88812e854480: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88812e854500: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88812e854580: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88812e854600: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88812e854680: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================