RBP: 000000000076bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004 R13: 0000000000000cbe R14: 00000000004cea34 R15: 0000000000000007 ================================================================== BUG: KASAN: use-after-free in dealloc_work_entries drivers/infiniband/core/iwcm.c:162 [inline] BUG: KASAN: use-after-free in free_cm_id drivers/infiniband/core/iwcm.c:202 [inline] BUG: KASAN: use-after-free in iwcm_deref_id+0xf6/0x170 drivers/infiniband/core/iwcm.c:215 Read of size 8 at addr ffff8880a1c6d578 by task syz-executor.5/22417 CPU: 0 PID: 22417 Comm: syz-executor.5 Not tainted 5.6.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fb/0x318 lib/dump_stack.c:118 print_address_description+0x74/0x5c0 mm/kasan/report.c:374 __kasan_report+0x149/0x1c0 mm/kasan/report.c:506 kasan_report+0x26/0x50 mm/kasan/common.c:641 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 dealloc_work_entries drivers/infiniband/core/iwcm.c:162 [inline] free_cm_id drivers/infiniband/core/iwcm.c:202 [inline] iwcm_deref_id+0xf6/0x170 drivers/infiniband/core/iwcm.c:215 destroy_cm_id+0x4b2/0x5b0 drivers/infiniband/core/iwcm.c:442 iw_destroy_cm_id+0x15/0x20 drivers/infiniband/core/iwcm.c:453 cma_iw_listen drivers/infiniband/core/cma.c:2453 [inline] rdma_listen+0x6dc/0x9a0 drivers/infiniband/core/cma.c:3614 cma_listen_on_dev+0x678/0x8e0 drivers/infiniband/core/cma.c:2501 cma_listen_on_all drivers/infiniband/core/cma.c:2514 [inline] rdma_listen+0x43b/0x9a0 drivers/infiniband/core/cma.c:3622 ucma_listen+0x245/0x300 drivers/infiniband/core/ucma.c:1092 ucma_write+0x2da/0x360 drivers/infiniband/core/ucma.c:1684 __vfs_write+0xb8/0x740 fs/read_write.c:494 vfs_write+0x270/0x580 fs/read_write.c:558 ksys_write+0x117/0x220 fs/read_write.c:611 __do_sys_write fs/read_write.c:623 [inline] __se_sys_write fs/read_write.c:620 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:620 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c479 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f12ee633c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f12ee6346d4 RCX: 000000000045c479 RDX: 0000000000000010 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 000000000076bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004 R13: 0000000000000cbe R14: 00000000004cea34 R15: 0000000000000007 Allocated by task 22417: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc+0x118/0x1c0 mm/kasan/common.c:515 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529 kmem_cache_alloc_trace+0x221/0x2f0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] alloc_work_entries drivers/infiniband/core/iwcm.c:172 [inline] iw_cm_listen+0xdd/0x4a0 drivers/infiniband/core/iwcm.c:571 cma_iw_listen drivers/infiniband/core/cma.c:2450 [inline] rdma_listen+0x698/0x9a0 drivers/infiniband/core/cma.c:3614 cma_listen_on_dev+0x678/0x8e0 drivers/infiniband/core/cma.c:2501 cma_listen_on_all drivers/infiniband/core/cma.c:2514 [inline] rdma_listen+0x43b/0x9a0 drivers/infiniband/core/cma.c:3622 ucma_listen+0x245/0x300 drivers/infiniband/core/ucma.c:1092 ucma_write+0x2da/0x360 drivers/infiniband/core/ucma.c:1684 __vfs_write+0xb8/0x740 fs/read_write.c:494 vfs_write+0x270/0x580 fs/read_write.c:558 ksys_write+0x117/0x220 fs/read_write.c:611 __do_sys_write fs/read_write.c:623 [inline] __se_sys_write fs/read_write.c:620 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:620 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 22417: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0x12e/0x1e0 mm/kasan/common.c:476 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485 __cache_free mm/slab.c:3426 [inline] kfree+0x10d/0x220 mm/slab.c:3757 dealloc_work_entries drivers/infiniband/core/iwcm.c:163 [inline] alloc_work_entries drivers/infiniband/core/iwcm.c:174 [inline] iw_cm_listen+0x288/0x4a0 drivers/infiniband/core/iwcm.c:571 cma_iw_listen drivers/infiniband/core/cma.c:2450 [inline] rdma_listen+0x698/0x9a0 drivers/infiniband/core/cma.c:3614 cma_listen_on_dev+0x678/0x8e0 drivers/infiniband/core/cma.c:2501 cma_listen_on_all drivers/infiniband/core/cma.c:2514 [inline] rdma_listen+0x43b/0x9a0 drivers/infiniband/core/cma.c:3622 ucma_listen+0x245/0x300 drivers/infiniband/core/ucma.c:1092 ucma_write+0x2da/0x360 drivers/infiniband/core/ucma.c:1684 __vfs_write+0xb8/0x740 fs/read_write.c:494 vfs_write+0x270/0x580 fs/read_write.c:558 ksys_write+0x117/0x220 fs/read_write.c:611 __do_sys_write fs/read_write.c:623 [inline] __se_sys_write fs/read_write.c:620 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:620 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a1c6d400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 376 bytes inside of 512-byte region [ffff8880a1c6d400, ffff8880a1c6d600) The buggy address belongs to the page: page:ffffea0002871b40 refcount:1 mapcount:0 mapping:ffff8880aa400a80 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00028a5608 ffffea0002756d08 ffff8880aa400a80 raw: 0000000000000000 ffff8880a1c6d000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a1c6d400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a1c6d480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a1c6d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a1c6d580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a1c6d600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================