================================================================== BUG: KASAN: slab-use-after-free in __ethtool_get_link_ksettings+0x182/0x198 net/ethtool/ioctl.c:443 Read of size 8 at addr ffffaf802f72e2e8 by task kworker/1:2/18255 CPU: 1 UID: 0 PID: 18255 Comm: kworker/1:2 Not tainted 6.16.0-rc1-syzkaller-gfda589c28604 #0 PREEMPT Hardware name: riscv-virtio,qemu (DT) Workqueue: events smc_ib_port_event_work Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:132 [] show_stack+0x30/0x3c arch/riscv/kernel/stacktrace.c:138 [] __dump_stack lib/dump_stack.c:94 [inline] [] dump_stack_lvl+0x12e/0x1a6 lib/dump_stack.c:120 [] print_address_description mm/kasan/report.c:408 [inline] [] print_report+0x28e/0x5fe mm/kasan/report.c:521 [] kasan_report+0xf0/0x214 mm/kasan/report.c:634 [] __asan_report_load8_noabort+0x12/0x1a mm/kasan/report_generic.c:381 [] __ethtool_get_link_ksettings+0x182/0x198 net/ethtool/ioctl.c:443 [] ipvlan_ethtool_get_link_ksettings+0x46/0x5c drivers/net/ipvlan/ipvlan_main.c:411 [] __ethtool_get_link_ksettings+0xf8/0x198 net/ethtool/ioctl.c:450 [] ib_get_eth_speed+0x13a/0xb9c drivers/infiniband/core/verbs.c:1996 [] rxe_query_port+0x124/0x2e6 drivers/infiniband/sw/rxe/rxe_verbs.c:62 [] __ib_query_port drivers/infiniband/core/device.c:2111 [inline] [] ib_query_port drivers/infiniband/core/device.c:2143 [inline] [] ib_query_port+0x3f2/0x862 drivers/infiniband/core/device.c:2133 [] smc_ib_remember_port_attr net/smc/smc_ib.c:364 [inline] [] smc_ib_port_event_work+0x140/0xb88 net/smc/smc_ib.c:388 [] process_one_work+0x96a/0x1f32 kernel/workqueue.c:3238 [] process_scheduled_works kernel/workqueue.c:3321 [inline] [] worker_thread+0x5ce/0xde8 kernel/workqueue.c:3402 [] kthread+0x39c/0x7d4 kernel/kthread.c:464 [] ret_from_fork_kernel+0x2a/0xbb2 arch/riscv/kernel/process.c:214 [] ret_from_fork_kernel_asm+0x16/0x18 arch/riscv/kernel/entry.S:327 Allocated by task 3255: stack_trace_save+0xa0/0xd2 kernel/stacktrace.c:122 kasan_save_stack+0x3e/0x6a mm/kasan/common.c:47 kasan_save_track+0x16/0x28 mm/kasan/common.c:68 kasan_save_alloc_info+0x30/0x3e mm/kasan/generic.c:562 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xa0/0xa6 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4328 [inline] __kvmalloc_node_noprof+0x27a/0x6ac mm/slub.c:5015 alloc_netdev_mqs+0xcc/0x11da net/core/dev.c:11711 rtnl_create_link+0xb2a/0xe54 net/core/rtnetlink.c:3631 rtnl_newlink_create net/core/rtnetlink.c:3813 [inline] __rtnl_newlink net/core/rtnetlink.c:3940 [inline] rtnl_newlink+0xb54/0x1d78 net/core/rtnetlink.c:4055 rtnetlink_rcv_msg+0x9e2/0xdbe net/core/rtnetlink.c:6944 netlink_rcv_skb+0x206/0x3be net/netlink/af_netlink.c:2534 rtnetlink_rcv+0x26/0x30 net/core/rtnetlink.c:6971 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline] netlink_unicast+0x4f0/0x82c net/netlink/af_netlink.c:1339 netlink_sendmsg+0x85e/0xdd6 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0xcc/0x160 net/socket.c:727 __sys_sendto+0x27a/0x34e net/socket.c:2180 __do_sys_sendto net/socket.c:2187 [inline] __se_sys_sendto net/socket.c:2183 [inline] __riscv_sys_sendto+0xc0/0x158 net/socket.c:2183 syscall_handler+0x94/0x118 arch/riscv/include/asm/syscall.h:112 do_trap_ecall_u+0x396/0x530 arch/riscv/kernel/traps.c:341 handle_exception+0x146/0x152 arch/riscv/kernel/entry.S:197 Freed by task 18067: stack_trace_save+0xa0/0xd2 kernel/stacktrace.c:122 kasan_save_stack+0x3e/0x6a mm/kasan/common.c:47 kasan_save_track+0x16/0x28 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x5a mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x4e/0x68 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2381 [inline] slab_free mm/slub.c:4643 [inline] kfree+0x252/0x4da mm/slub.c:4842 kvfree+0x28/0x32 mm/slub.c:5058 netdev_release+0x84/0xb0 net/core/net-sysfs.c:2231 device_release+0x90/0x21c drivers/base/core.c:2568 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x238/0x4f0 lib/kobject.c:737 netdev_run_todo+0x6a6/0x10b4 net/core/dev.c:11412 rtnl_unlock+0x14/0x1c net/core/rtnetlink.c:157 default_device_exit_batch+0x67c/0x8b0 net/core/dev.c:12645 ops_exit_list net/core/net_namespace.c:206 [inline] ops_undo_list+0x3e8/0x9dc net/core/net_namespace.c:253 cleanup_net+0x3e0/0x7ce net/core/net_namespace.c:686 process_one_work+0x96a/0x1f32 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x5ce/0xde8 kernel/workqueue.c:3402 kthread+0x39c/0x7d4 kernel/kthread.c:464 ret_from_fork_kernel+0x2a/0xbb2 arch/riscv/kernel/process.c:214 ret_from_fork_kernel_asm+0x16/0x18 arch/riscv/kernel/entry.S:327 The buggy address belongs to the object at ffffaf802f72e000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 744 bytes inside of freed 4096-byte region [ffffaf802f72e000, ffffaf802f72f000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xaf728 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xffe000000000040(head|node=0|zone=0|lastcpupid=0x7ff) page_type: f5(slab) raw: 0ffe000000000040 ffffaf80114093c0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 0ffe000000000040 ffffaf80114093c0 dead000000000122 0000000000000000 head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 0ffe000000000003 ffff8d8000bdca01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3255, tgid 3255 (syz-executor), ts 560799178100, free_ts 0 __set_page_owner+0x94/0x4a8 mm/page_owner.c:329 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xdc/0x1ba mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x880/0x3660 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x22e/0x2124 mm/page_alloc.c:4959 alloc_pages_mpol+0x1fa/0x5ba mm/mempolicy.c:2419 alloc_frozen_pages_noprof+0x174/0x2f0 mm/mempolicy.c:2490 alloc_slab_page mm/slub.c:2451 [inline] allocate_slab mm/slub.c:2619 [inline] new_slab+0x26e/0x34c mm/slub.c:2673 ___slab_alloc+0xb64/0x1214 mm/slub.c:3859 __slab_alloc.constprop.0+0x60/0xb0 mm/slub.c:3949 __slab_alloc_node mm/slub.c:4024 [inline] slab_alloc_node mm/slub.c:4185 [inline] __kmalloc_cache_noprof+0xd2/0x3e8 mm/slub.c:4354 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] snmp6_alloc_dev net/ipv6/addrconf.c:360 [inline] ipv6_add_dev+0x630/0x15c0 net/ipv6/addrconf.c:411 addrconf_notify+0x4b6/0x1878 net/ipv6/addrconf.c:3654 notifier_call_chain+0xa8/0x5f2 kernel/notifier.c:85 raw_notifier_call_chain+0x2a/0x38 kernel/notifier.c:453 call_netdevice_notifiers_info+0xbe/0x146 net/core/dev.c:2230 call_netdevice_notifiers_extack net/core/dev.c:2268 [inline] call_netdevice_notifiers net/core/dev.c:2282 [inline] register_netdevice+0x160c/0x222c net/core/dev.c:11143 page_owner free stack trace missing Memory state around the buggy address: ffffaf802f72e180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffffaf802f72e200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffffaf802f72e280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffffaf802f72e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffffaf802f72e380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================