================================================================== BUG: KASAN: use-after-free in siw_query_port+0x358/0x450 drivers/infiniband/sw/siw/siw_verbs.c:175 Read of size 4 at addr ffff88805bd260d8 by task kworker/1:1/23 CPU: 1 PID: 23 Comm: kworker/1:1 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Workqueue: infiniband ib_cache_event_task Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 siw_query_port+0x358/0x450 drivers/infiniband/sw/siw/siw_verbs.c:175 ib_cache_update+0x1bb/0x980 drivers/infiniband/core/cache.c:1477 ib_cache_event_task+0xd4/0x1c0 drivers/infiniband/core/cache.c:1551 process_one_work+0x863/0x1000 kernel/workqueue.c:2310 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457 kthread+0x436/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 4661: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522 kmalloc_node include/linux/slab.h:627 [inline] kvmalloc_node+0x84/0x130 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] kvzalloc include/linux/mm.h:813 [inline] alloc_netdev_mqs+0x84/0xc40 net/core/dev.c:10884 rtnl_create_link+0x2fb/0xa90 net/core/rtnetlink.c:3232 __rtnl_newlink net/core/rtnetlink.c:3514 [inline] rtnl_newlink+0x105e/0x17d0 net/core/rtnetlink.c:3572 rtnetlink_rcv_msg+0x9b9/0xe60 net/core/rtnetlink.c:5650 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2507 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x774/0x920 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8ab/0xbc0 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x423/0x580 net/socket.c:2063 __do_sys_sendto net/socket.c:2075 [inline] __se_sys_sendto net/socket.c:2071 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2071 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 1212: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xef/0x2a0 mm/slub.c:4559 device_release+0x92/0x1c0 drivers/base/core.c:-1 kobject_cleanup lib/kobject.c:713 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x21d/0x460 lib/kobject.c:761 netdev_run_todo+0x8d0/0xa40 net/core/dev.c:10702 default_device_exit_batch+0x33b/0x390 net/core/dev.c:11668 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x77b/0xb80 net/core/net_namespace.c:635 process_one_work+0x863/0x1000 kernel/workqueue.c:2310 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457 kthread+0x436/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff88805bd26000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 216 bytes inside of 4096-byte region [ffff88805bd26000, ffff88805bd27000) The buggy address belongs to the page: page:ffffea00016f4800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5bd20 head:ffffea00016f4800 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff888029961541 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff88801684c280 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff888029961541 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4186, ts 84891269646, free_ts 84661307011 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5474 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1975 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node+0x200/0x3b0 mm/slub.c:4451 kmalloc_node include/linux/slab.h:627 [inline] kvmalloc_node+0x84/0x130 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x1f6/0xd50 fs/seq_file.c:210 call_read_iter include/linux/fs.h:2166 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0x725/0xcf0 fs/read_write.c:485 ksys_read+0x14d/0x250 fs/read_write.c:623 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x94/0x280 mm/page_alloc.c:3396 put_page include/linux/mm.h:1247 [inline] __skb_frag_unref include/linux/skbuff.h:3231 [inline] skb_release_data+0x3fa/0x850 net/core/skbuff.c:672 skb_release_all net/core/skbuff.c:742 [inline] __kfree_skb+0x4c/0x60 net/core/skbuff.c:756 tcp_clean_rtx_queue net/ipv4/tcp_input.c:3407 [inline] tcp_ack+0x2086/0x6260 net/ipv4/tcp_input.c:3964 tcp_rcv_established+0xea6/0x1cb0 net/ipv4/tcp_input.c:5980 tcp_v4_do_rcv+0x44b/0x9b0 net/ipv4/tcp_ipv4.c:1731 tcp_v4_rcv+0x268f/0x2cb0 net/ipv4/tcp_ipv4.c:2143 ip_protocol_deliver_rcu+0x3ad/0x770 net/ipv4/ip_input.c:204 ip_local_deliver_finish+0x1d5/0x320 net/ipv4/ip_input.c:231 NF_HOOK+0x2d6/0x360 include/linux/netfilter.h:302 dst_input include/net/dst.h:462 [inline] ip_sublist_rcv_finish net/ipv4/ip_input.c:577 [inline] ip_list_rcv_finish net/ipv4/ip_input.c:628 [inline] ip_sublist_rcv+0xa1f/0xce0 net/ipv4/ip_input.c:636 ip_list_rcv+0x3df/0x430 net/ipv4/ip_input.c:671 __netif_receive_skb_list_ptype net/core/dev.c:5568 [inline] __netif_receive_skb_list_core+0x574/0x740 net/core/dev.c:5616 __netif_receive_skb_list net/core/dev.c:5668 [inline] netif_receive_skb_list_internal+0x871/0xb90 net/core/dev.c:5759 gro_normal_list net/core/dev.c:5913 [inline] napi_complete_done+0x37d/0x830 net/core/dev.c:6651 Memory state around the buggy address: ffff88805bd25f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805bd26000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805bd26080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805bd26100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805bd26180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================