================================================================== 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/asm-generic/atomic-instrumented.h:705 [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:183 [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:175 Write of size 4 at addr ffff88810dd9cc88 by task kworker/0:0/5 CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.10.226-syzkaller-1003431-ge5e5644ea27f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: vsock-loopback vsock_loopback_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 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/asm-generic/atomic-instrumented.h:705 [inline] queued_spin_lock include/asm-generic/qspinlock.h:82 [inline] do_raw_spin_lock include/linux/spinlock.h:183 [inline] __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline] _raw_spin_lock_bh+0x97/0x1b0 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:359 [inline] virtio_transport_space_update net/vmw_vsock/virtio_transport_common.c:1040 [inline] virtio_transport_recv_pkt+0x665/0x4130 net/vmw_vsock/virtio_transport_common.c:1164 vsock_loopback_work+0x37d/0x3f0 net/vmw_vsock/vsock_loopback.c:125 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 382: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:509 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x18a/0x2e0 mm/slub.c:2974 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] virtio_transport_do_socket_init+0x56/0x2d0 net/vmw_vsock/virtio_transport_common.c:475 vsock_assign_transport+0x324/0x3f0 net/vmw_vsock/af_vsock.c:470 vsock_stream_connect+0x5cf/0xd30 net/vmw_vsock/af_vsock.c:1297 __sys_connect_file net/socket.c:1866 [inline] __sys_connect+0x388/0x410 net/socket.c:1883 __do_sys_connect net/socket.c:1893 [inline] __se_sys_connect net/socket.c:1890 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:1890 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 382: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc3/0x270 mm/slub.c:4191 virtio_transport_destruct+0x3b/0x40 net/vmw_vsock/virtio_transport_common.c:693 vsock_deassign_transport net/vmw_vsock/af_vsock.c:411 [inline] vsock_assign_transport+0x266/0x3f0 net/vmw_vsock/af_vsock.c:461 vsock_stream_connect+0x5cf/0xd30 net/vmw_vsock/af_vsock.c:1297 __sys_connect_file net/socket.c:1866 [inline] __sys_connect+0x388/0x410 net/socket.c:1883 __do_sys_connect net/socket.c:1893 [inline] __se_sys_connect net/socket.c:1890 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:1890 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88810dd9cc80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 8 bytes inside of 64-byte region [ffff88810dd9cc80, ffff88810dd9ccc0) The buggy address belongs to the page: page:ffffea0004376700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10dd9c flags: 0x4000000000000200(slab) raw: 4000000000000200 ffffea0004375b40 0000000400000004 ffff888100043800 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 96, ts 4574269788, free_ts 4574241922 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc_trace+0x1bd/0x2e0 mm/slub.c:2972 kmalloc include/linux/slab.h:552 [inline] kernfs_get_open_node fs/kernfs/file.c:552 [inline] kernfs_fop_open+0x7fa/0xab0 fs/kernfs/file.c:698 do_dentry_open+0x7c1/0x10d0 fs/open.c:819 vfs_open+0x73/0x80 fs/open.c:942 do_open fs/namei.c:3391 [inline] path_openat+0x2660/0x3000 fs/namei.c:3509 do_filp_open+0x21c/0x460 fs/namei.c:3536 do_sys_openat2+0x13f/0x710 fs/open.c:1217 do_sys_open fs/open.c:1233 [inline] __do_sys_openat fs/open.c:1249 [inline] __se_sys_openat fs/open.c:1244 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1244 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page mm/page_alloc.c:3391 [inline] free_the_page+0x9e/0x370 mm/page_alloc.c:5407 __free_pages+0x67/0xc0 mm/page_alloc.c:5418 free_pages+0x7c/0x90 mm/page_alloc.c:5429 selinux_genfs_get_sid+0x24d/0x2a0 security/selinux/hooks.c:1326 inode_doinit_with_dentry+0x86f/0x1050 security/selinux/hooks.c:1523 selinux_d_instantiate+0x27/0x40 security/selinux/hooks.c:6389 security_d_instantiate+0x9f/0x100 security/security.c:1980 d_splice_alias+0x6d/0x390 fs/dcache.c:3036 kernfs_iop_lookup+0x2a4/0x2f0 fs/kernfs/dir.c:1178 lookup_open fs/namei.c:3226 [inline] open_last_lookups fs/namei.c:3317 [inline] path_openat+0x11ab/0x3000 fs/namei.c:3506 do_filp_open+0x21c/0x460 fs/namei.c:3536 do_sys_openat2+0x13f/0x710 fs/open.c:1217 do_sys_open fs/open.c:1233 [inline] __do_sys_openat fs/open.c:1249 [inline] __se_sys_openat fs/open.c:1244 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1244 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88810dd9cb80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810dd9cc00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88810dd9cc80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88810dd9cd00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88810dd9cd80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================