==================================================================
BUG: KASAN: use-after-free in rxe_query_port+0x185/0x1e0 drivers/infiniband/sw/rxe/rxe_verbs.c:71
Read of size 4 at addr ffff8880a8cbc820 by task kworker/1:12/2697

CPU: 1 PID: 2697 Comm: kworker/1:12 Not tainted 5.6.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events smc_ib_port_event_work
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_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:134
 rxe_query_port+0x185/0x1e0 drivers/infiniband/sw/rxe/rxe_verbs.c:71
 __ib_query_port drivers/infiniband/core/device.c:2022 [inline]
 ib_query_port+0x1b2/0x830 drivers/infiniband/core/device.c:2057
 smc_ib_remember_port_attr net/smc/smc_ib.c:219 [inline]
 smc_ib_port_event_work+0xc7/0x340 net/smc/smc_ib.c:244
 process_one_work+0x7f5/0x10f0 kernel/workqueue.c:2264
 worker_thread+0xbbc/0x1630 kernel/workqueue.c:2410
 kthread+0x332/0x350 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Allocated by task 12645:
 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]
 kzalloc include/linux/slab.h:669 [inline]
 smc_ib_add_dev+0x8a/0x4f0 net/smc/smc_ib.c:541
 add_client_context+0x482/0x660 drivers/infiniband/core/device.c:681
 enable_device_and_get+0x15b/0x370 drivers/infiniband/core/device.c:1316
 ib_register_device+0x124d/0x15b0 drivers/infiniband/core/device.c:1382
 rxe_register_device+0x3f6/0x530 drivers/infiniband/sw/rxe/rxe_verbs.c:1231
 rxe_add+0x1373/0x14f0 drivers/infiniband/sw/rxe/rxe.c:302
 rxe_net_add+0x79/0xe0 drivers/infiniband/sw/rxe/rxe_net.c:539
 rxe_newlink+0x31/0x90 drivers/infiniband/sw/rxe/rxe.c:318
 nldev_newlink+0x403/0x4a0 drivers/infiniband/core/nldev.c:1538
 rdma_nl_rcv_msg drivers/infiniband/core/netlink.c:195 [inline]
 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline]
 rdma_nl_rcv+0x701/0xa20 drivers/infiniband/core/netlink.c:259
 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
 netlink_unicast+0x766/0x920 net/netlink/af_netlink.c:1329
 netlink_sendmsg+0xa2b/0xd40 net/netlink/af_netlink.c:1918
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg net/socket.c:672 [inline]
 ____sys_sendmsg+0x4f7/0x7f0 net/socket.c:2343
 ___sys_sendmsg net/socket.c:2397 [inline]
 __sys_sendmsg+0x1ed/0x290 net/socket.c:2430
 __do_sys_sendmsg net/socket.c:2439 [inline]
 __se_sys_sendmsg net/socket.c:2437 [inline]
 __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2437
 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 25:
 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
 smc_ib_remove_dev+0x1e6/0x230 net/smc/smc_ib.c:583
 remove_client_context+0xb9/0x1e0 drivers/infiniband/core/device.c:724
 disable_device+0xfc/0x300 drivers/infiniband/core/device.c:1268
 __ib_unregister_device+0x70/0x160 drivers/infiniband/core/device.c:1435
 ib_unregister_work+0x19/0x30 drivers/infiniband/core/device.c:1545
 process_one_work+0x7f5/0x10f0 kernel/workqueue.c:2264
 worker_thread+0xbbc/0x1630 kernel/workqueue.c:2410
 kthread+0x332/0x350 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff8880a8cbc800
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 32 bytes inside of
 512-byte region [ffff8880a8cbc800, ffff8880a8cbca00)
The buggy address belongs to the page:
page:ffffea0002a32f00 refcount:1 mapcount:0 mapping:ffff8880aa400a80 index:0x0
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea000290c9c8 ffffea0001152188 ffff8880aa400a80
raw: 0000000000000000 ffff8880a8cbc000 0000000100000004 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a8cbc700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880a8cbc780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880a8cbc800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
 ffff8880a8cbc880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880a8cbc900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================