================================================================== BUG: KASAN: use-after-free in rxe_query_port+0x14a/0x1a0 drivers/infiniband/sw/rxe/rxe_verbs.c:71 Read of size 4 at addr ffff88809a9a7820 by task kworker/0:13/2745 CPU: 0 PID: 2745 Comm: kworker/0:13 Not tainted 5.6.0-rc5-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+0x1e9/0x30e lib/dump_stack.c:118 print_address_description+0x74/0x5c0 mm/kasan/report.c:374 __kasan_report+0x14b/0x1c0 mm/kasan/report.c:506 kasan_report+0x25/0x50 mm/kasan/common.c:641 rxe_query_port+0x14a/0x1a0 drivers/infiniband/sw/rxe/rxe_verbs.c:71 __ib_query_port drivers/infiniband/core/device.c:2022 [inline] ib_query_port+0x18e/0x820 drivers/infiniband/core/device.c:2057 smc_ib_remember_port_attr net/smc/smc_ib.c:219 [inline] smc_ib_port_event_work+0xc4/0x340 net/smc/smc_ib.c:244 process_one_work+0x76e/0xfd0 kernel/workqueue.c:2264 worker_thread+0xa7f/0x1450 kernel/workqueue.c:2410 kthread+0x317/0x340 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 11492: 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 kmem_cache_alloc_trace+0x234/0x300 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] smc_ib_add_dev+0x87/0x4a0 net/smc/smc_ib.c:541 add_client_context+0x469/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+0x3e7/0x510 drivers/infiniband/sw/rxe/rxe_verbs.c:1231 rxe_net_add+0x73/0xd0 drivers/infiniband/sw/rxe/rxe_net.c:539 rxe_newlink+0x2e/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+0x66a/0x990 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] netlink_unicast+0x786/0x940 net/netlink/af_netlink.c:1329 netlink_sendmsg+0xa57/0xd70 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg net/socket.c:672 [inline] ____sys_sendmsg+0x4f9/0x7c0 net/socket.c:2343 ___sys_sendmsg net/socket.c:2397 [inline] __sys_sendmsg+0x1ed/0x290 net/socket.c:2430 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9853: 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 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 remove_client_context+0xb3/0x1e0 drivers/infiniband/core/device.c:724 disable_device+0xec/0x2e0 drivers/infiniband/core/device.c:1268 __ib_unregister_device+0x6c/0x160 drivers/infiniband/core/device.c:1435 ib_unregister_work+0x15/0x30 drivers/infiniband/core/device.c:1545 process_one_work+0x76e/0xfd0 kernel/workqueue.c:2264 worker_thread+0xa7f/0x1450 kernel/workqueue.c:2410 kthread+0x317/0x340 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff88809a9a7800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 32 bytes inside of 512-byte region [ffff88809a9a7800, ffff88809a9a7a00) The buggy address belongs to the page: page:ffffea00026a69c0 refcount:1 mapcount:0 mapping:ffff8880aa400a80 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea000291d408 ffffea00023c8108 ffff8880aa400a80 raw: 0000000000000000 ffff88809a9a7000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809a9a7700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809a9a7780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809a9a7800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809a9a7880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809a9a7900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================