macsec0 speed is unknown, defaulting to 1000 ================================================================== BUG: KASAN: use-after-free in siw_query_port+0x342/0x430 drivers/infiniband/sw/siw/siw_verbs.c:175 Read of size 4 at addr ffff8880a7b340d8 by task kworker/0:2/8029 CPU: 0 PID: 8029 Comm: kworker/0:2 Not tainted 5.15.118-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Workqueue: infiniband ib_cache_event_task Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 siw_query_port+0x342/0x430 drivers/infiniband/sw/siw/siw_verbs.c:175 ib_cache_update+0x1a8/0xaf0 drivers/infiniband/core/cache.c:1481 ib_cache_event_task+0xef/0x1e0 drivers/infiniband/core/cache.c:1555 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307 worker_thread+0xaca/0x1280 kernel/workqueue.c:2454 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 3566: 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+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc_node+0x199/0x390 mm/slub.c:4455 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x80/0x140 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] kvzalloc include/linux/mm.h:813 [inline] alloc_netdev_mqs+0x85/0xc10 net/core/dev.c:10817 rtnl_create_link+0x2e9/0x9c0 net/core/rtnetlink.c:3186 __rtnl_newlink net/core/rtnetlink.c:3458 [inline] rtnl_newlink+0x13a4/0x2060 net/core/rtnetlink.c:3516 rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5593 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356 netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1923 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] __sys_sendto+0x564/0x720 net/socket.c:2039 __do_sys_sendto net/socket.c:2051 [inline] __se_sys_sendto net/socket.c:2047 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2047 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 9594: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 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+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xf1/0x270 mm/slub.c:4559 device_release+0x91/0x1c0 kobject_cleanup lib/kobject.c:713 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x224/0x460 lib/kobject.c:761 netdev_run_todo+0xaaf/0xc40 net/core/dev.c:10635 default_device_exit_batch+0x395/0x3f0 net/core/dev.c:11597 ops_exit_list net/core/net_namespace.c:174 [inline] cleanup_net+0x763/0xb60 net/core/net_namespace.c:596 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307 worker_thread+0xaca/0x1280 kernel/workqueue.c:2454 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff8880a7b34000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 216 bytes inside of 4096-byte region [ffff8880a7b34000, ffff8880a7b35000) The buggy address belongs to the page: page:ffffea00029ecc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xa7b30 head:ffffea00029ecc00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888011c4c280 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3558, ts 495565169258, free_ts 0 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5421 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node+0x1fa/0x390 mm/slub.c:4451 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x80/0x140 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] kvzalloc include/linux/mm.h:813 [inline] alloc_netdev_mqs+0x85/0xc10 net/core/dev.c:10817 rtnl_create_link+0x2e9/0x9c0 net/core/rtnetlink.c:3186 __rtnl_newlink net/core/rtnetlink.c:3458 [inline] rtnl_newlink+0x13a4/0x2060 net/core/rtnetlink.c:3516 rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5593 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356 netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1923 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] __sys_sendto+0x564/0x720 net/socket.c:2039 __do_sys_sendto net/socket.c:2051 [inline] __se_sys_sendto net/socket.c:2047 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2047 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 page_owner free stack trace missing Memory state around the buggy address: ffff8880a7b33f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a7b34000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a7b34080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a7b34100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a7b34180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================