================================================================== BUG: KASAN: slab-use-after-free in ucma_create_uevent+0x106/0xa60 drivers/infiniband/core/ucma.c:275 Read of size 8 at addr ffff888011f78d10 by task kworker/u8:4/78 CPU: 1 UID: 0 PID: 78 Comm: kworker/u8:4 Not tainted 6.16.0-rc5-next-20250711-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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/0x230 mm/kasan/report.c:480 kasan_report+0x118/0x150 mm/kasan/report.c:593 ucma_create_uevent+0x106/0xa60 drivers/infiniband/core/ucma.c:275 ucma_event_handler+0x131/0x980 drivers/infiniband/core/ucma.c:351 cma_cm_event_handler+0xa9/0x2d0 drivers/infiniband/core/cma.c:2173 cma_iboe_join_work_handler+0xcb/0x1c0 drivers/infiniband/core/cma.c:3008 process_one_work kernel/workqueue.c:3239 [inline] process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3322 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3403 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 12029: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4396 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] ucma_process_join+0x234/0x9e0 drivers/infiniband/core/ucma.c:1465 ucma_join_multicast+0xf9/0x160 drivers/infiniband/core/ucma.c:1557 ucma_write+0x246/0x2e0 drivers/infiniband/core/ucma.c:1738 vfs_write+0x27b/0xa90 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/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 12029: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kfree+0x18e/0x440 mm/slub.c:4879 ucma_process_join+0x7e5/0x9e0 drivers/infiniband/core/ucma.c:1516 ucma_join_multicast+0xf9/0x160 drivers/infiniband/core/ucma.c:1557 ucma_write+0x246/0x2e0 drivers/infiniband/core/ucma.c:1738 vfs_write+0x27b/0xa90 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/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888011f78d00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 16 bytes inside of freed 192-byte region [ffff888011f78d00, ffff888011f78dc0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11f78 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801a8413c0 ffffea0001dafa00 dead000000000004 raw: 0000000000000000 0000000000100010 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5981, tgid 5981 (syz-executor), ts 140967621104, free_ts 140908218073 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2419 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_node_track_caller_noprof+0x2f8/0x4e0 mm/slub.c:4384 kmemdup_noprof+0x2b/0x70 mm/util.c:137 kmemdup_noprof include/linux/fortify-string.h:765 [inline] neigh_parms_alloc+0x87/0x510 net/core/neighbour.c:1692 inetdev_init+0x128/0x500 net/ipv4/devinet.c:280 inetdev_event+0x301/0x15b0 net/ipv4/devinet.c:1591 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2266 [inline] call_netdevice_notifiers net/core/dev.c:2280 [inline] register_netdevice+0x1608/0x1ae0 net/core/dev.c:11183 veth_newlink+0x42f/0xa50 drivers/net/veth.c:1855 rtnl_newlink_create+0x310/0xb00 net/core/rtnetlink.c:3825 __rtnl_newlink net/core/rtnetlink.c:3942 [inline] rtnl_newlink+0x16d6/0x1c70 net/core/rtnetlink.c:4057 page last free pid 15 tgid 15 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 rcu_do_batch kernel/rcu/tree.c:2584 [inline] rcu_core+0xca8/0x1710 kernel/rcu/tree.c:2840 handle_softirqs+0x283/0x870 kernel/softirq.c:579 run_ksoftirqd+0x9b/0x100 kernel/softirq.c:968 smpboot_thread_fn+0x542/0xa60 kernel/smpboot.c:160 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888011f78c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888011f78c80: 00 00 00 00 00 00 00 05 fc fc fc fc fc fc fc fc >ffff888011f78d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888011f78d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888011f78e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================