macsec0 speed is unknown, defaulting to 1000 ================================================================== BUG: KASAN: slab-use-after-free in siw_query_port+0x346/0x430 drivers/infiniband/sw/siw/siw_verbs.c:177 Read of size 4 at addr ffff888051f380e8 by task kworker/1:9/20680 CPU: 1 PID: 20680 Comm: kworker/1:9 Not tainted 6.5.0-rc6-syzkaller-00036-g4853c74bd7ab #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Workqueue: infiniband ib_cache_event_task Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 siw_query_port+0x346/0x430 drivers/infiniband/sw/siw/siw_verbs.c:177 ib_cache_update+0x1ac/0xb00 drivers/infiniband/core/cache.c:1487 ib_cache_event_task+0xf3/0x1e0 drivers/infiniband/core/cache.c:1561 process_one_work+0x92c/0x12c0 kernel/workqueue.c:2600 worker_thread+0xa63/0x1210 kernel/workqueue.c:2751 kthread+0x2b8/0x350 kernel/kthread.c:389 ret_from_fork+0x2e/0x60 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 5044: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:985 [inline] __kmalloc_node+0xb8/0x230 mm/slab_common.c:992 kmalloc_node include/linux/slab.h:602 [inline] kvmalloc_node+0x72/0x180 mm/util.c:604 kvmalloc include/linux/slab.h:720 [inline] kvzalloc include/linux/slab.h:728 [inline] alloc_netdev_mqs+0x8d/0xf40 net/core/dev.c:10594 rtnl_create_link+0x2ea/0xc10 net/core/rtnetlink.c:3336 rtnl_newlink_create net/core/rtnetlink.c:3462 [inline] __rtnl_newlink net/core/rtnetlink.c:3689 [inline] rtnl_newlink+0x139a/0x2000 net/core/rtnetlink.c:3702 rtnetlink_rcv_msg+0x82b/0xf50 net/core/rtnetlink.c:6428 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2549 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1914 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg net/socket.c:748 [inline] __sys_sendto+0x484/0x640 net/socket.c:2134 __do_sys_sendto net/socket.c:2146 [inline] __se_sys_sendto net/socket.c:2142 [inline] __x64_sys_sendto+0xde/0xf0 net/socket.c:2142 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 27447: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook mm/slub.c:1818 [inline] slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0x25f/0x3b0 mm/slub.c:3814 device_release+0x95/0x1c0 kobject_cleanup lib/kobject.c:682 [inline] kobject_release lib/kobject.c:713 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x228/0x470 lib/kobject.c:730 netdev_run_todo+0xe5a/0xf50 net/core/dev.c:10366 default_device_exit_batch+0x5c9/0x630 net/core/dev.c:11360 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x767/0xb80 net/core/net_namespace.c:614 process_one_work+0x92c/0x12c0 kernel/workqueue.c:2600 worker_thread+0xa63/0x1210 kernel/workqueue.c:2751 kthread+0x2b8/0x350 kernel/kthread.c:389 ret_from_fork+0x2e/0x60 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff888051f38000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 232 bytes inside of freed 4096-byte region [ffff888051f38000, ffff888051f39000) The buggy address belongs to the physical page: page:ffffea000147ce00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x51f38 head:ffffea000147ce00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff88801284f500 dead000000000122 0000000000000000 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 5044, tgid 5044 (syz-executor.2), ts 185534840236, free_ts 13366165789 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x31e8/0x3370 mm/page_alloc.c:3221 __alloc_pages+0x255/0x670 mm/page_alloc.c:4477 alloc_slab_page+0x6a/0x160 mm/slub.c:1862 allocate_slab mm/slub.c:2009 [inline] new_slab+0x84/0x2f0 mm/slub.c:2062 ___slab_alloc+0xade/0x1100 mm/slub.c:3215 __slab_alloc mm/slub.c:3314 [inline] __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x1af/0x270 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc_node+0xa7/0x230 mm/slab_common.c:992 kmalloc_node include/linux/slab.h:602 [inline] kvmalloc_node+0x72/0x180 mm/util.c:604 kvmalloc include/linux/slab.h:720 [inline] kvzalloc include/linux/slab.h:728 [inline] alloc_netdev_mqs+0x8d/0xf40 net/core/dev.c:10594 rtnl_create_link+0x2ea/0xc10 net/core/rtnetlink.c:3336 rtnl_newlink_create net/core/rtnetlink.c:3462 [inline] __rtnl_newlink net/core/rtnetlink.c:3689 [inline] rtnl_newlink+0x139a/0x2000 net/core/rtnetlink.c:3702 rtnetlink_rcv_msg+0x82b/0xf50 net/core/rtnetlink.c:6428 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2549 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1914 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2348 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2443 free_contig_range+0x9e/0x150 mm/page_alloc.c:6395 destroy_args+0x102/0x9a0 mm/debug_vm_pgtable.c:1029 debug_vm_pgtable+0x42a/0x4b0 mm/debug_vm_pgtable.c:1410 do_one_initcall+0x23d/0x7d0 init/main.c:1232 do_initcall_level+0x157/0x210 init/main.c:1294 do_initcalls+0x3f/0x80 init/main.c:1310 kernel_init_freeable+0x43b/0x5d0 init/main.c:1546 kernel_init+0x1d/0x2a0 init/main.c:1437 ret_from_fork+0x2e/0x60 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff888051f37f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888051f38000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888051f38080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888051f38100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888051f38180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================