================================================================== BUG: KASAN: slab-use-after-free in __ethtool_get_link_ksettings+0x190/0x1c0 net/ethtool/ioctl.c:443 Read of size 8 at addr ffff888028a042e8 by task kworker/2:2/28758 CPU: 2 UID: 0 PID: 28758 Comm: kworker/2:2 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP 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+0x190/0x1c0 net/ethtool/ioctl.c:443 __ethtool_get_link_ksettings+0x144/0x1c0 net/ethtool/ioctl.c:450 ib_get_eth_speed+0x122/0xb50 drivers/infiniband/core/verbs.c:1999 rxe_query_port+0x127/0x360 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+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Allocated by task 21108: kasan_save_stack+0x33/0x60 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5657 [inline] __kvmalloc_node_noprof+0x3ac/0xa40 mm/slub.c:7136 alloc_netdev_mqs+0xd7/0x1550 net/core/dev.c:11999 rtnl_create_link+0xc08/0xf60 net/core/rtnetlink.c:3648 rtnl_newlink_create net/core/rtnetlink.c:3830 [inline] __rtnl_newlink net/core/rtnetlink.c:3957 [inline] rtnl_newlink+0xb3b/0x1f50 net/core/rtnetlink.c:4072 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6958 netlink_rcv_skb+0x158/0x420 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x5aa/0x870 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8c8/0xdd0 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] __sys_sendto+0x4a3/0x520 net/socket.c:2206 __do_compat_sys_socketcall net/compat.c:475 [inline] __se_compat_sys_socketcall net/compat.c:423 [inline] __ia32_compat_sys_socketcall+0x62a/0x780 net/compat.c:423 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe8/0x680 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 6207: kasan_save_stack+0x33/0x60 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6670 [inline] kfree+0x2f8/0x6e0 mm/slub.c:6878 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+0x1ef/0x6f0 lib/kobject.c:737 netdev_run_todo+0x7da/0x12a0 net/core/dev.c:11700 default_device_exit_batch+0x99a/0xc80 net/core/dev.c:13039 ops_exit_list net/core/net_namespace.c:205 [inline] ops_undo_list+0x363/0xab0 net/core/net_namespace.c:252 cleanup_net+0x41b/0x830 net/core/net_namespace.c:696 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 The buggy address belongs to the object at ffff888028a04000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 744 bytes inside of freed 4096-byte region [ffff888028a04000, ffff888028a05000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888028a00000 pfn:0x28a00 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888029dfe941 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b44c280 ffffea000089aa10 ffffea00004a4e10 raw: ffff888028a00000 0000000000040003 00000000f5000000 ffff888029dfe941 head: 00fff00000000240 ffff88801b44c280 ffffea000089aa10 ffffea00004a4e10 head: ffff888028a00000 0000000000040003 00000000f5000000 ffff888029dfe941 head: 00fff00000000003 ffffea0000a28001 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 21108, tgid 21108 (syz-executor), ts 1164041744814, free_ts 1148809841155 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1857 prep_new_page mm/page_alloc.c:1865 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c3/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4656 __slab_alloc.constprop.0+0x63/0x110 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+0x4d6/0x930 mm/slub.c:5764 kmemdup_noprof+0x29/0x60 mm/util.c:138 kmemdup_noprof include/linux/fortify-string.h:765 [inline] __addrconf_sysctl_register+0xbb/0x360 net/ipv6/addrconf.c:7305 addrconf_sysctl_register net/ipv6/addrconf.c:7371 [inline] addrconf_sysctl_register+0x15f/0x1f0 net/ipv6/addrconf.c:7360 ipv6_add_dev+0xb31/0x15f0 net/ipv6/addrconf.c:460 addrconf_notify+0x53e/0x19f0 net/ipv6/addrconf.c:3650 notifier_call_chain+0xbc/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 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+0x1792/0x21d0 net/core/dev.c:11431 page last free pid 55 tgid 55 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943 discard_slab mm/slub.c:3346 [inline] __put_partials+0x130/0x170 mm/slub.c:3886 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4c/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] __kmalloc_cache_noprof+0x282/0x800 mm/slub.c:5771 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] nsim_fib4_rt_create drivers/net/netdevsim/fib.c:280 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:426 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:464 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:884 [inline] nsim_fib_event_work+0xea7/0x65f0 drivers/net/netdevsim/fib.c:1493 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Memory state around the buggy address: ffff888028a04180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028a04200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888028a04280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888028a04300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028a04380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================