================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:511 [inline] BUG: KASAN: use-after-free in queued_spin_lock include/asm-generic/qspinlock.h:82 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock include/linux/spinlock.h:187 [inline] BUG: KASAN: use-after-free in __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline] BUG: KASAN: use-after-free in _raw_spin_lock_bh+0x97/0x1b0 kernel/locking/spinlock.c:178 Write of size 4 at addr ffff88810119d708 by task kworker/1:1/30 CPU: 1 PID: 30 Comm: kworker/1:1 Not tainted 5.15.148-syzkaller #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+0x87/0x3a0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x177/0x1c0 mm/kasan/report.c:451 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:511 [inline] queued_spin_lock include/asm-generic/qspinlock.h:82 [inline] do_raw_spin_lock include/linux/spinlock.h:187 [inline] __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline] _raw_spin_lock_bh+0x97/0x1b0 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:368 [inline] virtio_transport_space_update net/vmw_vsock/virtio_transport_common.c:1170 [inline] virtio_transport_recv_pkt+0x6d0/0x4160 net/vmw_vsock/virtio_transport_common.c:1306 vsock_loopback_work+0x37d/0x3f0 net/vmw_vsock/vsock_loopback.c:137 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2310 worker_thread+0xad2/0x12a0 kernel/workqueue.c:2457 kthread+0x421/0x510 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 457: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:513 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x115/0x210 mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] virtio_transport_do_socket_init+0x56/0x2d0 net/vmw_vsock/virtio_transport_common.c:600 vsock_assign_transport+0x473/0x5b0 net/vmw_vsock/af_vsock.c:501 vsock_connect+0x5cf/0xd30 net/vmw_vsock/af_vsock.c:1345 __sys_connect_file net/socket.c:1918 [inline] __sys_connect+0x38b/0x410 net/socket.c:1935 __do_sys_connect net/socket.c:1945 [inline] __se_sys_connect net/socket.c:1942 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:1942 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 457: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:366 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xc8/0x220 mm/slub.c:4559 virtio_transport_destruct+0x3b/0x40 net/vmw_vsock/virtio_transport_common.c:814 vsock_deassign_transport net/vmw_vsock/af_vsock.c:416 [inline] vsock_assign_transport+0x32b/0x5b0 net/vmw_vsock/af_vsock.c:484 vsock_connect+0x5cf/0xd30 net/vmw_vsock/af_vsock.c:1345 __sys_connect_file net/socket.c:1918 [inline] __sys_connect+0x38b/0x410 net/socket.c:1935 __do_sys_connect net/socket.c:1945 [inline] __se_sys_connect net/socket.c:1942 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:1942 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88810119d700 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 8 bytes inside of 96-byte region [ffff88810119d700, ffff88810119d760) The buggy address belongs to the page: page:ffffea0004046740 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10119d flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 dead000000000100 dead000000000122 ffff888100041780 raw: 0000000000000000 0000000080200020 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 2391607296, free_ts 2390979194 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x15d/0x170 mm/page_alloc.c:2420 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x33e6/0x34c0 mm/page_alloc.c:4159 __alloc_pages+0x38a/0x7b0 mm/page_alloc.c:5421 allocate_slab mm/slub.c:1912 [inline] new_slab+0x92/0x490 mm/slub.c:1975 ___slab_alloc+0x39e/0x830 mm/slub.c:3008 __slab_alloc+0x4a/0x90 mm/slub.c:3095 slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc_trace+0x142/0x210 mm/slub.c:3245 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] call_usermodehelper_setup+0x8f/0x220 kernel/umh.c:365 kobject_uevent_env+0x637/0x700 lib/kobject_uevent.c:614 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642 device_add+0xa5f/0xef0 drivers/base/core.c:3375 device_create_groups_vargs drivers/base/core.c:4053 [inline] device_create+0x253/0x2e0 drivers/base/core.c:4095 bdi_register_va+0x93/0x610 mm/backing-dev.c:884 bdi_register+0xd1/0x120 mm/backing-dev.c:916 device_add_disk+0x6a0/0xd00 block/genhd.c:502 add_disk include/linux/genhd.h:203 [inline] brd_alloc+0x4ca/0x740 drivers/block/brd.c:425 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1413 [inline] free_unref_page_prepare+0x7a9/0x7e0 mm/page_alloc.c:3317 free_unref_page+0x85/0x220 mm/page_alloc.c:3396 free_the_page mm/page_alloc.c:705 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5497 __vunmap+0x7bc/0x8f0 mm/vmalloc.c:2621 __vfree mm/vmalloc.c:2669 [inline] vfree+0x7f/0xb0 mm/vmalloc.c:2700 free_partitions block/partitions/core.c:120 [inline] check_partition block/partitions/core.c:179 [inline] blk_add_partitions block/partitions/core.c:609 [inline] bdev_disk_changed+0x911/0x1620 block/partitions/core.c:695 blkdev_get_whole+0x364/0x400 block/bdev.c:682 blkdev_get_by_dev+0x284/0x920 block/bdev.c:824 disk_scan_partitions+0x188/0x240 block/genhd.c:379 device_add_disk+0xa32/0xd00 block/genhd.c:513 add_disk include/linux/genhd.h:203 [inline] brd_alloc+0x4ca/0x740 drivers/block/brd.c:425 brd_init+0x150/0x244 drivers/block/brd.c:504 do_one_initcall+0x182/0x610 init/main.c:1299 do_initcall_level+0x186/0x304 init/main.c:1372 do_initcalls+0x4e/0x8e init/main.c:1388 do_basic_setup+0x81/0x8a init/main.c:1407 Memory state around the buggy address: ffff88810119d600: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88810119d680: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc >ffff88810119d700: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88810119d780: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff88810119d800: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ==================================================================