================================================================== BUG: KASAN: slab-use-after-free in __ethtool_get_link_ksettings+0x1bf/0x200 net/ethtool/ioctl.c:443 Read of size 8 at addr ffff88805ee9e2e8 by task kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: events smc_ib_port_event_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 __ethtool_get_link_ksettings+0x1bf/0x200 net/ethtool/ioctl.c:443 __ethtool_get_link_ksettings+0x148/0x200 net/ethtool/ioctl.c:450 ib_get_eth_speed+0x122/0xb50 drivers/infiniband/core/verbs.c:1996 rxe_query_port+0x108/0x330 drivers/infiniband/sw/rxe/rxe_verbs.c:62 __ib_query_port drivers/infiniband/core/device.c:2148 [inline] ib_query_port drivers/infiniband/core/device.c:2180 [inline] ib_query_port+0x441/0x8a0 drivers/infiniband/core/device.c:2170 smc_ib_remember_port_attr net/smc/smc_ib.c:364 [inline] smc_ib_port_event_work+0x12f/0xbf0 net/smc/smc_ib.c:388 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x675/0x7d0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5941: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5642 [inline] __kvmalloc_node_noprof+0x3a3/0x9c0 mm/slub.c:7100 alloc_netdev_mqs+0xd7/0x1550 net/core/dev.c:11900 rtnl_create_link+0xc08/0xf90 net/core/rtnetlink.c:3641 rtnl_newlink_create net/core/rtnetlink.c:3823 [inline] __rtnl_newlink net/core/rtnetlink.c:3950 [inline] rtnl_newlink+0xb69/0x2000 net/core/rtnetlink.c:4065 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6951 netlink_rcv_skb+0x158/0x420 net/netlink/af_netlink.c:2552 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x5aa/0x870 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x8c8/0xdd0 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] __sys_sendto+0x4a3/0x520 net/socket.c:2244 __do_compat_sys_socketcall net/compat.c:475 [inline] __se_compat_sys_socketcall net/compat.c:423 [inline] __ia32_compat_sys_socketcall+0x625/0x770 net/compat.c:423 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x300 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 12850: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 __kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2539 [inline] slab_free mm/slub.c:6630 [inline] kfree+0x2b8/0x6d0 mm/slub.c:6837 device_release+0xa4/0x240 drivers/base/core.c:2565 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1e7/0x5a0 lib/kobject.c:737 netdev_run_todo+0x7e9/0x1320 net/core/dev.c:11601 rtnl_unlock net/core/rtnetlink.c:157 [inline] rtnl_net_unlock include/linux/rtnetlink.h:135 [inline] rtnl_dellink+0x3e4/0xa90 net/core/rtnetlink.c:3571 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6951 netlink_rcv_skb+0x158/0x420 net/netlink/af_netlink.c:2552 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x5aa/0x870 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x8c8/0xdd0 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] ____sys_sendmsg+0xa98/0xc70 net/socket.c:2630 ___sys_sendmsg+0x134/0x1d0 net/socket.c:2684 __sys_sendmsg+0x16d/0x220 net/socket.c:2716 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x300 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88805ee9e000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 744 bytes inside of freed 4096-byte region [ffff88805ee9e000, ffff88805ee9f000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5ee98 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801b44c280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801b44c280 dead000000000122 0000000000000000 head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 04fff00000000003 ffffea00017ba601 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 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 5949, tgid 5949 (syz-executor), ts 47676841478, free_ts 44417973935 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5183 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3055 [inline] allocate_slab mm/slub.c:3228 [inline] new_slab+0x24a/0x360 mm/slub.c:3282 ___slab_alloc+0xdae/0x1a60 mm/slub.c:4651 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4770 __slab_alloc_node mm/slub.c:4846 [inline] slab_alloc_node mm/slub.c:5268 [inline] __do_kmalloc_node mm/slub.c:5641 [inline] __kvmalloc_node_noprof+0x5aa/0x9c0 mm/slub.c:7100 netif_alloc_netdev_queues net/core/dev.c:11091 [inline] alloc_netdev_mqs+0xaef/0x1550 net/core/dev.c:11965 rtnl_create_link+0xc08/0xf90 net/core/rtnetlink.c:3641 rtnl_newlink_create net/core/rtnetlink.c:3823 [inline] __rtnl_newlink net/core/rtnetlink.c:3950 [inline] rtnl_newlink+0xb69/0x2000 net/core/rtnetlink.c:4065 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6951 netlink_rcv_skb+0x158/0x420 net/netlink/af_netlink.c:2552 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x5aa/0x870 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x8c8/0xdd0 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] __sys_sendto+0x4a3/0x520 net/socket.c:2244 page last free pid 23 tgid 23 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2906 __folio_put+0x329/0x450 mm/swap.c:112 folio_put include/linux/mm.h:1425 [inline] put_page include/linux/mm.h:1494 [inline] put_netmem+0x28b/0x300 net/core/skbuff.c:7376 skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_frag_unref include/linux/skbuff_ref.h:71 [inline] __pskb_trim_head+0x5c7/0x7b0 net/ipv4/tcp_output.c:1864 tcp_trim_head+0x85/0x5f0 net/ipv4/tcp_output.c:1891 tcp_tso_acked net/ipv4/tcp_input.c:3348 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3414 [inline] tcp_ack+0x1da1/0x5fc0 net/ipv4/tcp_input.c:4103 tcp_rcv_established+0x10ea/0x3700 net/ipv4/tcp_input.c:6348 tcp_v4_do_rcv+0xc65/0x10a0 net/ipv4/tcp_ipv4.c:1931 tcp_v4_rcv+0x3077/0x4db0 net/ipv4/tcp_ipv4.c:2374 ip_protocol_deliver_rcu+0xba/0x4c0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x3f2/0x720 net/ipv4/ip_input.c:239 NF_HOOK include/linux/netfilter.h:318 [inline] NF_HOOK include/linux/netfilter.h:312 [inline] ip_local_deliver+0x18e/0x1f0 net/ipv4/ip_input.c:260 dst_input include/net/dst.h:474 [inline] ip_sublist_rcv_finish+0x2ce/0x660 net/ipv4/ip_input.c:584 ip_list_rcv_finish+0x590/0x780 net/ipv4/ip_input.c:636 ip_sublist_rcv net/ipv4/ip_input.c:644 [inline] ip_list_rcv+0x335/0x450 net/ipv4/ip_input.c:678 __netif_receive_skb_list_ptype net/core/dev.c:6122 [inline] __netif_receive_skb_list_core+0x752/0x950 net/core/dev.c:6169 Memory state around the buggy address: ffff88805ee9e180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805ee9e200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805ee9e280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805ee9e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805ee9e380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================