================================================================== BUG: KASAN: slab-use-after-free in __ethtool_get_link_ksettings+0x6e/0x140 net/ethtool/ioctl.c:441 Read of size 8 at addr ffff88805e5d8308 by task kworker/1:11/8933 CPU: 1 PID: 8933 Comm: kworker/1:11 Not tainted 6.9.0-rc2-next-20240405-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: events smc_ib_port_event_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 __ethtool_get_link_ksettings+0x6e/0x140 net/ethtool/ioctl.c:441 ib_get_eth_speed+0x160/0x800 drivers/infiniband/core/verbs.c:1984 rxe_query_port+0x76/0x260 drivers/infiniband/sw/rxe/rxe_verbs.c:55 __ib_query_port drivers/infiniband/core/device.c:2067 [inline] ib_query_port+0x166/0x7d0 drivers/infiniband/core/device.c:2099 smc_ib_remember_port_attr net/smc/smc_ib.c:359 [inline] smc_ib_port_event_work+0x161/0xa70 net/smc/smc_ib.c:383 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Allocated by task 5092: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4078 [inline] __kmalloc_node_noprof+0x22f/0x440 mm/slub.c:4085 kmalloc_node_noprof include/linux/slab.h:681 [inline] kvmalloc_node_noprof+0x72/0x190 mm/util.c:634 alloc_netdev_mqs+0x9d/0xf80 net/core/dev.c:10913 rtnl_create_link+0x2f9/0xc20 net/core/rtnetlink.c:3358 rtnl_newlink_create net/core/rtnetlink.c:3484 [inline] __rtnl_newlink net/core/rtnetlink.c:3714 [inline] rtnl_newlink+0x1421/0x20a0 net/core/rtnetlink.c:3727 rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6594 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 __sys_sendto+0x3a4/0x4f0 net/socket.c:2191 __do_sys_sendto net/socket.c:2203 [inline] __se_sys_sendto net/socket.c:2199 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2199 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a Freed by task 60: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2190 [inline] slab_free mm/slub.c:4393 [inline] kfree+0x149/0x350 mm/slub.c:4514 device_release+0x99/0x1c0 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22f/0x480 lib/kobject.c:737 netdev_run_todo+0xe79/0x1000 net/core/dev.c:10664 default_device_exit_batch+0xa14/0xa90 net/core/dev.c:11707 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x89d/0xcc0 net/core/net_namespace.c:637 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 The buggy address belongs to the object at ffff88805e5d8000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 776 bytes inside of freed 4096-byte region [ffff88805e5d8000, ffff88805e5d9000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5e5d8 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff80000000040(head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffefff(slab) raw: 00fff80000000040 ffff88801504f500 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000001ffffefff 0000000000000000 head: 00fff80000000040 ffff88801504f500 dead000000000122 0000000000000000 head: 0000000000000000 0000000000040004 00000001ffffefff 0000000000000000 head: 00fff80000000003 ffffea0001797601 dead000000000122 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 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 5092, tgid -1153702217 (syz-executor.1), ts 5092, free_ts 16665918763 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1490 prep_new_page mm/page_alloc.c:1498 [inline] get_page_from_freelist+0x2e7e/0x2f40 mm/page_alloc.c:3454 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4712 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2259 allocate_slab+0x5a/0x2e0 mm/slub.c:2422 new_slab mm/slub.c:2475 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3624 __slab_alloc+0x58/0xa0 mm/slub.c:3714 __slab_alloc_node mm/slub.c:3767 [inline] slab_alloc_node mm/slub.c:3945 [inline] __do_kmalloc_node mm/slub.c:4077 [inline] __kmalloc_node_noprof+0x28b/0x440 mm/slub.c:4085 kmalloc_node_noprof include/linux/slab.h:681 [inline] kvmalloc_node_noprof+0x72/0x190 mm/util.c:634 alloc_netdev_mqs+0x9d/0xf80 net/core/dev.c:10913 rtnl_create_link+0x2f9/0xc20 net/core/rtnetlink.c:3358 rtnl_newlink_create net/core/rtnetlink.c:3484 [inline] __rtnl_newlink net/core/rtnetlink.c:3714 [inline] rtnl_newlink+0x1421/0x20a0 net/core/rtnetlink.c:3727 rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6594 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1110 [inline] free_unref_page+0xd3c/0xec0 mm/page_alloc.c:2617 free_contig_range+0x9e/0x160 mm/page_alloc.c:6667 destroy_args+0x8a/0x890 mm/debug_vm_pgtable.c:1037 debug_vm_pgtable+0x4be/0x550 mm/debug_vm_pgtable.c:1417 do_one_initcall+0x248/0x880 init/main.c:1258 do_initcall_level+0x157/0x210 init/main.c:1320 do_initcalls+0x3f/0x80 init/main.c:1336 kernel_init_freeable+0x435/0x5d0 init/main.c:1569 kernel_init+0x1d/0x2b0 init/main.c:1458 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Memory state around the buggy address: ffff88805e5d8200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805e5d8280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805e5d8300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805e5d8380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805e5d8400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================