xfrm0 speed is unknown, defaulting to 1000 ================================================================== BUG: KASAN: slab-use-after-free in siw_query_port+0x90/0x252 drivers/infiniband/sw/siw/siw_verbs.c:177 Read of size 4 at addr ff60000012a120e8 by task kworker/0:1/15381 CPU: 0 PID: 15381 Comm: kworker/0:1 Not tainted 6.4.0-rc1-syzkaller-00011-g99a670b2069c #0 Hardware name: riscv-virtio,qemu (DT) Workqueue: infiniband ib_cache_event_task Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:121 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:127 [] __dump_stack lib/dump_stack.c:88 [inline] [] dump_stack_lvl+0xe0/0x14c lib/dump_stack.c:106 [] print_address_description mm/kasan/report.c:351 [inline] [] print_report+0x1fe/0x502 mm/kasan/report.c:462 [] kasan_report+0xbc/0x182 mm/kasan/report.c:572 [] check_region_inline mm/kasan/generic.c:181 [inline] [] __asan_load4+0x7e/0xa6 mm/kasan/generic.c:258 [] siw_query_port+0x90/0x252 drivers/infiniband/sw/siw/siw_verbs.c:177 [] iw_query_port drivers/infiniband/core/device.c:2049 [inline] [] ib_query_port drivers/infiniband/core/device.c:2090 [inline] [] ib_query_port+0x276/0x69c drivers/infiniband/core/device.c:2082 [] ib_cache_update.part.0+0xe6/0x62a drivers/infiniband/core/cache.c:1487 [] ib_cache_update drivers/infiniband/core/cache.c:1561 [inline] [] ib_cache_event_task+0x11c/0x190 drivers/infiniband/core/cache.c:1561 [] process_one_work+0x634/0xdb2 kernel/workqueue.c:2405 [] worker_thread+0x362/0x880 kernel/workqueue.c:2552 [] kthread+0x1be/0x22e kernel/kthread.c:379 [] ret_from_fork+0xa/0x1c arch/riscv/kernel/entry.S:264 Allocated by task 13252: stack_trace_save+0xa6/0xd8 kernel/stacktrace.c:122 kasan_save_stack+0x2c/0x58 mm/kasan/common.c:45 kasan_set_track+0x1a/0x26 mm/kasan/common.c:52 kasan_save_alloc_info+0x1a/0x24 mm/kasan/generic.c:510 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa0/0xa6 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc_node+0x44/0xe6 mm/slab_common.c:973 kmalloc_node include/linux/slab.h:579 [inline] kvmalloc_node+0xae/0x1ce mm/util.c:604 kvmalloc include/linux/slab.h:697 [inline] kvzalloc include/linux/slab.h:705 [inline] alloc_netdev_mqs+0xa6/0x846 net/core/dev.c:10626 rtnl_create_link+0x640/0x688 net/core/rtnetlink.c:3315 rtnl_newlink_create net/core/rtnetlink.c:3433 [inline] __rtnl_newlink+0xb5a/0xfb4 net/core/rtnetlink.c:3660 rtnl_newlink+0x60/0x8c net/core/rtnetlink.c:3673 rtnetlink_rcv_msg+0x360/0xb3a net/core/rtnetlink.c:6395 netlink_rcv_skb+0x100/0x2ce net/netlink/af_netlink.c:2546 rtnetlink_rcv+0x26/0x30 net/core/rtnetlink.c:6413 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x410/0x600 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x524/0x9f6 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xa0/0xf2 net/socket.c:747 __sys_sendto+0x210/0x30e net/socket.c:2144 __do_sys_sendto net/socket.c:2156 [inline] sys_sendto+0x3e/0x52 net/socket.c:2152 syscall_handler+0xfa/0x148 arch/riscv/include/asm/syscall.h:90 do_trap_ecall_u+0xea/0xec arch/riscv/kernel/traps.c:279 ret_from_exception+0x0/0x64 arch/riscv/kernel/entry.S:102 Freed by task 14887: stack_trace_save+0xa6/0xd8 kernel/stacktrace.c:122 kasan_save_stack+0x2c/0x58 mm/kasan/common.c:45 kasan_set_track+0x1a/0x26 mm/kasan/common.c:52 kasan_save_free_info+0x2c/0x4a mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x1c4/0x214 mm/kasan/common.c:200 __kasan_slab_free+0x10/0x18 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8e/0x1cc mm/slub.c:1807 slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0xbe/0x33c mm/slub.c:3799 kfree+0x9c/0x16c mm/slab_common.c:1015 kvfree+0x5e/0x72 mm/util.c:650 netdev_freemem+0x30/0x3a net/core/dev.c:10580 netdev_release+0x64/0x7c net/core/net-sysfs.c:1938 device_release+0x66/0x148 drivers/base/core.c:2484 kobject_cleanup lib/kobject.c:683 [inline] kobject_release lib/kobject.c:714 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1b0/0x394 lib/kobject.c:731 netdev_run_todo+0x540/0xad2 net/core/dev.c:10400 rtnl_unlock+0x14/0x1c net/core/rtnetlink.c:151 xfrmi_exit_batch_net+0x2ac/0x37e net/xfrm/xfrm_interface_core.c:984 ops_exit_list+0xcc/0xe8 net/core/net_namespace.c:175 cleanup_net+0x430/0x732 net/core/net_namespace.c:614 process_one_work+0x634/0xdb2 kernel/workqueue.c:2405 worker_thread+0x362/0x880 kernel/workqueue.c:2552 kthread+0x1be/0x22e kernel/kthread.c:379 ret_from_fork+0xa/0x1c arch/riscv/kernel/entry.S:264 The buggy address belongs to the object at ff60000012a12000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 232 bytes inside of freed 4096-byte region [ff60000012a12000, ff60000012a13000) The buggy address belongs to the physical page: page:ff1c0000024a8400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x92a10 head:ff1c0000024a8400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ff6000001380b081 flags: 0xffe000000010200(slab|head|node=0|zone=0|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 0ffe000000010200 ff6000000840c3c0 ff1c000002766e00 0000000000000002 raw: 0000000000000000 0000000000040004 00000001ffffffff ff6000001380b081 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3527, tgid 3527 (modprobe), ts 892396385700, free_ts 881381327500 __set_page_owner+0x32/0x18a mm/page_owner.c:192 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x8a/0xe0 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0x9c4/0x1230 mm/page_alloc.c:3502 __alloc_pages+0x1b0/0x13ec mm/page_alloc.c:4768 alloc_pages+0x132/0x25e mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab mm/slub.c:1998 [inline] new_slab+0x278/0x38a mm/slub.c:2051 ___slab_alloc+0x57c/0xaaa mm/slub.c:3192 __slab_alloc.constprop.0+0x5a/0x98 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0xf8/0x2ea mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc_node+0x38/0xe6 mm/slab_common.c:973 kmalloc_node include/linux/slab.h:579 [inline] kvmalloc_node+0xae/0x1ce mm/util.c:604 kvmalloc include/linux/slab.h:697 [inline] seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x67c/0x934 fs/seq_file.c:210 proc_reg_read_iter+0x11c/0x16e fs/proc/inode.c:305 call_read_iter include/linux/fs.h:1862 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x45e/0x558 fs/read_write.c:470 ksys_read+0x10a/0x224 fs/read_write.c:613 __do_sys_read fs/read_write.c:623 [inline] sys_read+0x28/0x36 fs/read_write.c:621 page last free stack trace: __reset_page_owner+0x4a/0xf8 mm/page_owner.c:149 reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x22a/0x5f4 mm/page_alloc.c:2564 free_unref_page+0x6a/0x230 mm/page_alloc.c:2659 free_the_page mm/page_alloc.c:661 [inline] __free_pages+0x10e/0x130 mm/page_alloc.c:4857 __free_slab+0xb8/0x10e mm/slub.c:2068 free_slab+0x3c/0x19c mm/slub.c:2091 discard_slab+0x3c/0x54 mm/slub.c:2097 __slab_free+0x206/0x298 mm/slub.c:3688 do_slab_free mm/slub.c:3730 [inline] ___cache_free+0x156/0x164 mm/slub.c:3793 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x82/0x17a mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x15e/0x1ec mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x60/0x84 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] __kmem_cache_alloc_node+0x12a/0x2ea mm/slub.c:3490 kmalloc_trace+0x24/0x56 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:643 [inline] netdevice_event+0x1b0/0x740 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain+0x134/0x3aa kernel/notifier.c:93 Memory state around the buggy address: ff60000012a11f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ff60000012a12000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ff60000012a12080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ff60000012a12100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ff60000012a12180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================