RBP: 000000000076bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004 R13: 0000000000000cbe R14: 00000000004cea14 R15: 000000000000000b ================================================================== 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+0x1d3/0x1e0 drivers/infiniband/core/iwcm.c:215 Read of size 8 at addr ffff888016c1ed78 by task syz-executor.1/27286 CPU: 0 PID: 27286 Comm: syz-executor.1 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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x32 mm/kasan/report.c:506 kasan_report+0x12/0x20 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+0x1d3/0x1e0 drivers/infiniband/core/iwcm.c:215 destroy_cm_id+0x27c/0x540 drivers/infiniband/core/iwcm.c:442 iw_destroy_cm_id+0x16/0x20 drivers/infiniband/core/iwcm.c:453 cma_iw_listen drivers/infiniband/core/cma.c:2453 [inline] rdma_listen+0x656/0x970 drivers/infiniband/core/cma.c:3614 cma_listen_on_dev+0x530/0x6a0 drivers/infiniband/core/cma.c:2501 cma_listen_on_all drivers/infiniband/core/cma.c:2514 [inline] rdma_listen+0x772/0x970 drivers/infiniband/core/cma.c:3622 ucma_listen+0x14d/0x1c0 drivers/infiniband/core/ucma.c:1092 ucma_write+0x2d7/0x3c0 drivers/infiniband/core/ucma.c:1684 __vfs_write+0x8a/0x110 fs/read_write.c:494 vfs_write+0x268/0x5d0 fs/read_write.c:558 ksys_write+0x220/0x290 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+0x73/0xb0 fs/read_write.c:620 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c449 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:00007f2a6c780c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f2a6c7816d4 RCX: 000000000045c449 RDX: 0000000000000010 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 000000000076bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004 R13: 0000000000000cbe R14: 00000000004cea14 R15: 000000000000000b Allocated by task 27286: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:488 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] alloc_work_entries+0xaf/0x240 drivers/infiniband/core/iwcm.c:172 iw_cm_listen+0x47/0x1f0 drivers/infiniband/core/iwcm.c:571 cma_iw_listen drivers/infiniband/core/cma.c:2450 [inline] rdma_listen+0x613/0x970 drivers/infiniband/core/cma.c:3614 cma_listen_on_dev+0x530/0x6a0 drivers/infiniband/core/cma.c:2501 cma_listen_on_all drivers/infiniband/core/cma.c:2514 [inline] rdma_listen+0x772/0x970 drivers/infiniband/core/cma.c:3622 ucma_listen+0x14d/0x1c0 drivers/infiniband/core/ucma.c:1092 ucma_write+0x2d7/0x3c0 drivers/infiniband/core/ucma.c:1684 __vfs_write+0x8a/0x110 fs/read_write.c:494 vfs_write+0x268/0x5d0 fs/read_write.c:558 ksys_write+0x220/0x290 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+0x73/0xb0 fs/read_write.c:620 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 27286: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:476 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 dealloc_work_entries drivers/infiniband/core/iwcm.c:163 [inline] alloc_work_entries+0x1e6/0x240 drivers/infiniband/core/iwcm.c:174 iw_cm_listen+0x47/0x1f0 drivers/infiniband/core/iwcm.c:571 cma_iw_listen drivers/infiniband/core/cma.c:2450 [inline] rdma_listen+0x613/0x970 drivers/infiniband/core/cma.c:3614 cma_listen_on_dev+0x530/0x6a0 drivers/infiniband/core/cma.c:2501 cma_listen_on_all drivers/infiniband/core/cma.c:2514 [inline] rdma_listen+0x772/0x970 drivers/infiniband/core/cma.c:3622 ucma_listen+0x14d/0x1c0 drivers/infiniband/core/ucma.c:1092 ucma_write+0x2d7/0x3c0 drivers/infiniband/core/ucma.c:1684 __vfs_write+0x8a/0x110 fs/read_write.c:494 vfs_write+0x268/0x5d0 fs/read_write.c:558 ksys_write+0x220/0x290 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+0x73/0xb0 fs/read_write.c:620 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888016c1ec00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 376 bytes inside of 512-byte region [ffff888016c1ec00, ffff888016c1ee00) The buggy address belongs to the page: page:ffffea00005b0780 refcount:1 mapcount:0 mapping:ffff8880aa400a80 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea000246b548 ffffea0000503048 ffff8880aa400a80 raw: 0000000000000000 ffff888016c1e000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888016c1ec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888016c1ec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888016c1ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888016c1ed80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888016c1ee00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================