================================================================== BUG: KASAN: slab-use-after-free in ucma_create_uevent+0xb60/0xbe0 drivers/infiniband/core/ucma.c:275 Read of size 8 at addr ffff88803543e710 by task kworker/u32:7/216 CPU: 1 UID: 0 PID: 216 Comm: kworker/u32:7 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: rdma_cm cma_iboe_join_work_handler Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1d0 mm/kasan/report.c:595 ucma_create_uevent+0xb60/0xbe0 drivers/infiniband/core/ucma.c:275 ucma_event_handler+0x102/0x940 drivers/infiniband/core/ucma.c:356 cma_cm_event_handler+0x9b/0x320 drivers/infiniband/core/cma.c:2181 cma_iboe_join_work_handler+0xca/0x180 drivers/infiniband/core/cma.c:3017 process_one_work+0xa0e/0x1980 kernel/workqueue.c:3302 process_scheduled_works kernel/workqueue.c:3385 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3466 kthread+0x370/0x450 kernel/kthread.c:436 ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 6237: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kmalloc_noprof include/linux/slab.h:950 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] ucma_process_join+0x232/0xa20 drivers/infiniband/core/ucma.c:1532 ucma_join_multicast+0xe9/0x160 drivers/infiniband/core/ucma.c:1624 ucma_write+0x1fb/0x330 drivers/infiniband/core/ucma.c:1856 vfs_write+0x2aa/0x1070 fs/read_write.c:686 ksys_write+0x1f8/0x250 fs/read_write.c:740 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6237: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2689 [inline] slab_free mm/slub.c:6250 [inline] kfree+0x223/0x6c0 mm/slub.c:6565 ucma_process_join+0x39a/0xa20 drivers/infiniband/core/ucma.c:1583 ucma_join_multicast+0xe9/0x160 drivers/infiniband/core/ucma.c:1624 ucma_write+0x1fb/0x330 drivers/infiniband/core/ucma.c:1856 vfs_write+0x2aa/0x1070 fs/read_write.c:686 ksys_write+0x1f8/0x250 fs/read_write.c:740 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803543e700 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 16 bytes inside of freed 192-byte region [ffff88803543e700, ffff88803543e7c0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3543e flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b8423c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 21540936186, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x153/0x170 mm/page_alloc.c:1858 prep_new_page mm/page_alloc.c:1866 [inline] get_page_from_freelist+0x11a6/0x33b0 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x27c/0x2bc0 mm/page_alloc.c:5226 alloc_slab_page mm/slub.c:3278 [inline] allocate_slab mm/slub.c:3467 [inline] new_slab+0xa6/0x6c0 mm/slub.c:3525 refill_objects+0x277/0x420 mm/slub.c:7255 refill_sheaf mm/slub.c:2816 [inline] __pcs_replace_empty_main+0x375/0x650 mm/slub.c:4651 alloc_from_pcs mm/slub.c:4749 [inline] slab_alloc_node mm/slub.c:4883 [inline] __kmalloc_cache_noprof+0x493/0x6f0 mm/slub.c:5414 kmalloc_noprof include/linux/slab.h:950 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] call_usermodehelper_setup+0xaf/0x360 kernel/umh.c:362 kobject_uevent_env+0x17c1/0x18b0 lib/kobject_uevent.c:631 driver_register+0x29c/0x360 drivers/base/driver.c:257 do_one_initcall+0x121/0x750 init/main.c:1392 do_initcall_level init/main.c:1454 [inline] do_initcalls init/main.c:1470 [inline] do_basic_setup init/main.c:1490 [inline] kernel_init_freeable+0x6ea/0x7b0 init/main.c:1703 kernel_init+0x1f/0x1e0 init/main.c:1593 ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page_owner free stack trace missing Memory state around the buggy address: ffff88803543e600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88803543e680: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803543e700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803543e780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88803543e800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================