================================================================== BUG: KASAN: slab-use-after-free in ucma_create_uevent+0x116/0xbe0 drivers/infiniband/core/ucma.c:275 Read of size 8 at addr ffff888032d1f810 by task kworker/u8:4/61 CPU: 0 UID: 0 PID: 61 Comm: kworker/u8:4 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Workqueue: rdma_cm cma_iboe_join_work_handler Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 ucma_create_uevent+0x116/0xbe0 drivers/infiniband/core/ucma.c:275 ucma_event_handler+0x131/0x980 drivers/infiniband/core/ucma.c:356 cma_cm_event_handler+0xac/0x2d0 drivers/infiniband/core/cma.c:2174 cma_iboe_join_work_handler+0xcb/0x1c0 drivers/infiniband/core/cma.c:3009 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 12450: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __kmalloc_cache_noprof+0x3e2/0x700 mm/slub.c:5755 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] ucma_process_join+0x234/0x9e0 drivers/infiniband/core/ucma.c:1532 ucma_join_multicast+0xf9/0x160 drivers/infiniband/core/ucma.c:1624 ucma_write+0x249/0x2e0 drivers/infiniband/core/ucma.c:1856 vfs_write+0x27e/0xb30 fs/read_write.c:684 ksys_write+0x145/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 12450: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 __kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2530 [inline] slab_free mm/slub.c:6619 [inline] kfree+0x19a/0x6d0 mm/slub.c:6826 ucma_process_join+0x7e5/0x9e0 drivers/infiniband/core/ucma.c:1583 ucma_join_multicast+0xf9/0x160 drivers/infiniband/core/ucma.c:1624 ucma_write+0x249/0x2e0 drivers/infiniband/core/ucma.c:1856 vfs_write+0x27e/0xb30 fs/read_write.c:684 ksys_write+0x145/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888032d1f800 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 16 bytes inside of freed 192-byte region [ffff888032d1f800, ffff888032d1f8c0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x32d1f flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88813fe263c0 ffffea00007aa380 dead000000000002 raw: 0000000000000000 0000000080100010 00000000f5000000 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5931, tgid 5931 (syz-executor), ts 87698138144, free_ts 86050155839 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_slab_page mm/slub.c:3048 [inline] allocate_slab+0x71/0x3a0 mm/slub.c:3219 new_slab mm/slub.c:3273 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4643 __slab_alloc+0x65/0x100 mm/slub.c:4762 __slab_alloc_node mm/slub.c:4838 [inline] slab_alloc_node mm/slub.c:5260 [inline] __do_kmalloc_node mm/slub.c:5633 [inline] __kmalloc_node_noprof+0x5d5/0x810 mm/slub.c:5640 kmalloc_array_node_noprof include/linux/slab.h:1075 [inline] alloc_slab_obj_exts mm/slub.c:2123 [inline] account_slab mm/slub.c:3173 [inline] allocate_slab+0x179/0x3a0 mm/slub.c:3238 new_slab mm/slub.c:3273 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4643 __slab_alloc+0x65/0x100 mm/slub.c:4762 __slab_alloc_node mm/slub.c:4838 [inline] slab_alloc_node mm/slub.c:5260 [inline] kmem_cache_alloc_lru_noprof+0x3fe/0x6e0 mm/slub.c:5291 __d_alloc+0x36/0x7a0 fs/dcache.c:1690 d_alloc_pseudo+0x21/0xc0 fs/dcache.c:1821 alloc_path_pseudo fs/file_table.c:363 [inline] alloc_file_pseudo+0xcc/0x210 fs/file_table.c:379 sock_alloc_file+0xb8/0x2e0 net/socket.c:483 sock_map_fd net/socket.c:513 [inline] __sys_socket+0x13d/0x1b0 net/socket.c:1756 page last free pid 5920 tgid 5920 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0xcab/0x1770 kernel/rcu/tree.c:2861 handle_softirqs+0x286/0x870 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 Memory state around the buggy address: ffff888032d1f700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888032d1f780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888032d1f800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888032d1f880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888032d1f900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================