================================================================== BUG: KASAN: use-after-free in rxe_query_port+0x27d/0x2d0 drivers/infiniband/sw/rxe/rxe_verbs.c:71 Read of size 4 at addr ffff88809b467820 by task kworker/1:12/3339 CPU: 1 PID: 3339 Comm: kworker/1:12 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+0x188/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:374 __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:506 kasan_report+0xe/0x20 mm/kasan/common.c:641 rxe_query_port+0x27d/0x2d0 drivers/infiniband/sw/rxe/rxe_verbs.c:71 __ib_query_port drivers/infiniband/core/device.c:2022 [inline] ib_query_port drivers/infiniband/core/device.c:2057 [inline] ib_query_port+0x523/0xac0 drivers/infiniband/core/device.c:2047 smc_ib_remember_port_attr net/smc/smc_ib.c:219 [inline] smc_ib_port_event_work+0x127/0x360 net/smc/smc_ib.c:244 process_one_work+0x94b/0x1690 kernel/workqueue.c:2266 worker_thread+0x96/0xe20 kernel/workqueue.c:2412 kthread+0x357/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 25035: save_stack+0x1b/0x80 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+0xbf/0xd0 mm/kasan/common.c:488 kmem_cache_alloc_trace+0x153/0x7d0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] smc_ib_add_dev net/smc/smc_ib.c:541 [inline] smc_ib_add_dev+0xa4/0x590 net/smc/smc_ib.c:532 add_client_context+0x3b4/0x520 drivers/infiniband/core/device.c:681 enable_device_and_get+0x1cd/0x3b0 drivers/infiniband/core/device.c:1316 ib_register_device drivers/infiniband/core/device.c:1382 [inline] ib_register_device+0xa12/0xda0 drivers/infiniband/core/device.c:1343 rxe_register_device+0x4fa/0x621 drivers/infiniband/sw/rxe/rxe_verbs.c:1231 rxe_add+0x1227/0x1664 drivers/infiniband/sw/rxe/rxe.c:302 rxe_net_add+0x8c/0xe0 drivers/infiniband/sw/rxe/rxe_net.c:539 rxe_newlink+0x34/0x90 drivers/infiniband/sw/rxe/rxe.c:318 nldev_newlink+0x27f/0x400 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+0x586/0x900 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329 netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 ____sys_sendmsg+0x6b9/0x7d0 net/socket.c:2343 ___sys_sendmsg+0x100/0x170 net/socket.c:2397 __sys_sendmsg+0xec/0x1b0 net/socket.c:2430 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 435: save_stack+0x1b/0x80 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+0xf7/0x140 mm/kasan/common.c:476 __cache_free mm/slab.c:3426 [inline] kfree+0x109/0x2b0 mm/slab.c:3757 smc_ib_remove_dev+0x1e3/0x310 net/smc/smc_ib.c:585 remove_client_context+0xbe/0x110 drivers/infiniband/core/device.c:724 disable_device+0x13b/0x230 drivers/infiniband/core/device.c:1268 __ib_unregister_device+0x91/0x180 drivers/infiniband/core/device.c:1435 ib_unregister_work+0x15/0x30 drivers/infiniband/core/device.c:1545 process_one_work+0x94b/0x1690 kernel/workqueue.c:2266 worker_thread+0x96/0xe20 kernel/workqueue.c:2412 kthread+0x357/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff88809b467800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 32 bytes inside of 512-byte region [ffff88809b467800, ffff88809b467a00) The buggy address belongs to the page: page:ffffea00026d19c0 refcount:1 mapcount:0 mapping:ffff8880aa000a80 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00027d7388 ffffea00028a4408 ffff8880aa000a80 raw: 0000000000000000 ffff88809b467000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809b467700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809b467780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809b467800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809b467880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809b467900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================