================================================================== BUG: KASAN: slab-use-after-free in __ethtool_get_link_ksettings+0x182/0x198 net/ethtool/ioctl.c:443 Read of size 8 at addr ffffaf80303fc2e8 by task kworker/0:1/6284 CPU: 0 UID: 0 PID: 6284 Comm: kworker/0:1 Not tainted syzkaller #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:149 [] show_stack+0x30/0x3c arch/riscv/kernel/stacktrace.c:155 [] __dump_stack lib/dump_stack.c:94 [inline] [] dump_stack_lvl+0x12a/0x1a2 lib/dump_stack.c:120 [] print_address_description mm/kasan/report.c:378 [inline] [] print_report+0x28c/0x59e mm/kasan/report.c:482 [] kasan_report+0xf0/0x218 mm/kasan/report.c:595 [] __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:1999 [] rxe_query_port+0xfe/0x310 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+0x3f2/0x862 drivers/infiniband/core/device.c:2170 [] 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/0x1f3a kernel/workqueue.c:3257 [] process_scheduled_works kernel/workqueue.c:3340 [inline] [] worker_thread+0x5ce/0xde8 kernel/workqueue.c:3421 [] kthread+0x39e/0x7d8 kernel/kthread.c:463 [] ret_from_fork_kernel+0x2a/0xc78 arch/riscv/kernel/process.c:214 [] ret_from_fork_kernel_asm+0x16/0x18 arch/riscv/kernel/entry.S:328 Allocated by task 3204: stack_trace_save+0xa0/0xd2 kernel/stacktrace.c:122 kasan_save_stack+0x3e/0x6a mm/kasan/common.c:56 kasan_save_track+0x16/0x28 mm/kasan/common.c:77 kasan_save_alloc_info+0x30/0x3e mm/kasan/generic.c:570 poison_kmalloc_redzone mm/kasan/common.c:397 [inline] __kasan_kmalloc+0xa0/0xa6 mm/kasan/common.c:414 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5657 [inline] __kvmalloc_node_noprof+0x2e6/0xb52 mm/slub.c:7134 alloc_netdev_mqs+0xce/0x124a net/core/dev.c:11997 rtnl_create_link+0xb2a/0xe54 net/core/rtnetlink.c:3648 rtnl_newlink_create net/core/rtnetlink.c:3830 [inline] __rtnl_newlink net/core/rtnetlink.c:3957 [inline] rtnl_newlink+0xb54/0x1dc4 net/core/rtnetlink.c:4072 rtnetlink_rcv_msg+0x9e2/0xdbe net/core/rtnetlink.c:6958 netlink_rcv_skb+0x206/0x3be net/netlink/af_netlink.c:2550 rtnetlink_rcv+0x26/0x30 net/core/rtnetlink.c:6985 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x544/0x88a net/netlink/af_netlink.c:1344 netlink_sendmsg+0x854/0xdcc net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0xcc/0x162 net/socket.c:742 __sys_sendto+0x27a/0x34e net/socket.c:2206 __do_sys_sendto net/socket.c:2213 [inline] __se_sys_sendto net/socket.c:2209 [inline] __riscv_sys_sendto+0xc0/0x158 net/socket.c:2209 syscall_handler+0x94/0x118 arch/riscv/include/asm/syscall.h:112 do_trap_ecall_u+0x3d8/0x56c arch/riscv/kernel/traps.c:343 handle_exception+0x146/0x152 arch/riscv/kernel/entry.S:198 Freed by task 4614: stack_trace_save+0xa0/0xd2 kernel/stacktrace.c:122 kasan_save_stack+0x3e/0x6a mm/kasan/common.c:56 kasan_save_track+0x16/0x28 mm/kasan/common.c:77 kasan_save_free_info+0x40/0x5a mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5e/0x7e mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6668 [inline] kfree+0x24e/0x782 mm/slub.c:6876 kvfree+0x28/0x32 mm/slub.c:7183 netdev_release+0x84/0xb0 net/core/net-sysfs.c:2252 device_release+0x90/0x21c 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+0x242/0x5fe lib/kobject.c:737 netdev_run_todo+0x6aa/0x10b8 net/core/dev.c:11698 rtnl_unlock+0x14/0x1c net/core/rtnetlink.c:157 default_device_exit_batch+0x67c/0x8b0 net/core/dev.c:13037 ops_exit_list net/core/net_namespace.c:205 [inline] ops_undo_list+0x3e8/0x9dc net/core/net_namespace.c:252 cleanup_net+0x3f6/0x82c net/core/net_namespace.c:696 process_one_work+0x96a/0x1f3a kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x5ce/0xde8 kernel/workqueue.c:3421 kthread+0x39e/0x7d8 kernel/kthread.c:463 ret_from_fork_kernel+0x2a/0xc78 arch/riscv/kernel/process.c:214 ret_from_fork_kernel_asm+0x16/0x18 arch/riscv/kernel/entry.S:328 The buggy address belongs to the object at ffffaf80303fc000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 744 bytes inside of freed 4096-byte region [ffffaf80303fc000, ffffaf80303fd000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xb03f8 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 ffffaf8011c093c0 ffff8d800073c800 dead000000000002 raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 0ffe000000000040 ffffaf8011c093c0 ffff8d800073c800 dead000000000002 head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 0ffe000000000003 ffff8d8000c0fe01 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 3206, tgid 3206 (syz-executor), ts 711349445300, free_ts 0 __set_page_owner+0x94/0x4c4 mm/page_owner.c:341 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfc/0x1c4 mm/page_alloc.c:1846 prep_new_page mm/page_alloc.c:1854 [inline] get_page_from_freelist+0x8e0/0x36b0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x22e/0x211a mm/page_alloc.c:5210 alloc_pages_mpol+0x1fa/0x5be mm/mempolicy.c:2486 alloc_frozen_pages_noprof+0x174/0x2f0 mm/mempolicy.c:2557 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x370/0x438 mm/slub.c:3302 ___slab_alloc+0xda6/0x1a3c mm/slub.c:4656 __slab_alloc.constprop.0+0x72/0x118 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_node_track_caller_noprof+0x414/0xa0c mm/slub.c:5764 kmemdup_noprof+0x30/0x64 mm/util.c:138 __addrconf_sysctl_register+0xc8/0x34a net/ipv6/addrconf.c:7305 addrconf_sysctl_register net/ipv6/addrconf.c:7371 [inline] addrconf_sysctl_register+0x15a/0x1d8 net/ipv6/addrconf.c:7360 ipv6_add_dev+0xa36/0x1610 net/ipv6/addrconf.c:460 addrconf_notify+0x4b6/0x18ce net/ipv6/addrconf.c:3650 notifier_call_chain+0xa8/0x5f6 kernel/notifier.c:85 page_owner free stack trace missing Memory state around the buggy address: ffffaf80303fc180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffffaf80303fc200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffffaf80303fc280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffffaf80303fc300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffffaf80303fc380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================