================================================================== BUG: KASAN: slab-use-after-free in __ethtool_get_link_ksettings+0x186/0x190 net/ethtool/ioctl.c:442 Read of size 8 at addr ffff88807ba98308 by task kworker/1:4/5288 CPU: 1 UID: 0 PID: 5288 Comm: kworker/1:4 Not tainted 6.11.0-rc3-syzkaller-00066-g1fb918967b56 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: events smc_ib_port_event_work Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 __ethtool_get_link_ksettings+0x186/0x190 net/ethtool/ioctl.c:442 __ethtool_get_link_ksettings+0xf5/0x190 net/ethtool/ioctl.c:446 ib_get_eth_speed+0x123/0xb50 drivers/infiniband/core/verbs.c:1996 rxe_query_port+0x72/0x200 drivers/infiniband/sw/rxe/rxe_verbs.c:55 __ib_query_port drivers/infiniband/core/device.c:2085 [inline] ib_query_port drivers/infiniband/core/device.c:2117 [inline] ib_query_port+0x441/0x8a0 drivers/infiniband/core/device.c:2107 smc_ib_remember_port_attr net/smc/smc_ib.c:364 [inline] smc_ib_port_event_work+0x130/0xc00 net/smc/smc_ib.c:388 process_one_work+0x9c8/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 5228: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4158 [inline] __kmalloc_node_noprof+0x211/0x430 mm/slub.c:4164 __kvmalloc_node_noprof+0x9d/0x1a0 mm/util.c:650 alloc_netdev_mqs+0xd1/0x13d0 net/core/dev.c:11042 rtnl_create_link+0xc10/0xfa0 net/core/rtnetlink.c:3374 rtnl_newlink_create net/core/rtnetlink.c:3500 [inline] __rtnl_newlink+0x10ae/0x1960 net/core/rtnetlink.c:3730 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3743 rtnetlink_rcv_msg+0x3ca/0xea0 net/core/rtnetlink.c:6647 netlink_rcv_skb+0x16e/0x440 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x547/0x830 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] __sys_sendto+0x482/0x4e0 net/socket.c:2204 __do_sys_sendto net/socket.c:2216 [inline] __se_sys_sendto net/socket.c:2212 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2212 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 62: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x12a/0x3b0 mm/slub.c:4594 kvfree+0x47/0x50 mm/util.c:696 device_release+0xa4/0x240 drivers/base/core.c:2582 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1fd/0x5b0 lib/kobject.c:737 netdev_run_todo+0x7bc/0x12d0 net/core/dev.c:10761 default_device_exit_batch+0x860/0xae0 net/core/dev.c:11890 ops_exit_list+0x12b/0x180 net/core/net_namespace.c:178 cleanup_net+0x5b7/0xbf0 net/core/net_namespace.c:640 process_one_work+0x9c8/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88807ba98000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 776 bytes inside of freed 4096-byte region [ffff88807ba98000, ffff88807ba99000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7ba98 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88807f286a01 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff88801584f500 ffffea0001de8200 dead000000000003 raw: 0000000000000000 0000000000040004 00000001fdffffff ffff88807f286a01 head: 00fff00000000040 ffff88801584f500 ffffea0001de8200 dead000000000003 head: 0000000000000000 0000000000040004 00000001fdffffff ffff88807f286a01 head: 00fff00000000003 ffffea0001eea601 ffffffffffffffff 0000000000000000 head: 0000000000000008 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4681, tgid 4681 (udevd), ts 66604047895, free_ts 66573256870 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3442 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4700 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x4e/0xf0 mm/slub.c:2321 allocate_slab mm/slub.c:2484 [inline] new_slab+0x84/0x260 mm/slub.c:2537 ___slab_alloc+0xdac/0x1870 mm/slub.c:3723 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __do_kmalloc_node mm/slub.c:4157 [inline] __kmalloc_node_noprof+0x357/0x430 mm/slub.c:4164 __kvmalloc_node_noprof+0x9d/0x1a0 mm/util.c:650 seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x830/0x12c0 fs/seq_file.c:210 kernfs_fop_read_iter+0x41a/0x590 fs/kernfs/file.c:279 new_sync_read fs/read_write.c:395 [inline] vfs_read+0x86c/0xbd0 fs/read_write.c:476 ksys_read+0x12f/0x260 fs/read_write.c:619 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 4683 tgid 4683 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2612 __put_partials+0x14c/0x170 mm/slub.c:3051 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4044 getname_flags.part.0+0x4c/0x550 fs/namei.c:139 getname_flags+0x93/0xf0 include/linux/audit.h:322 getname fs/namei.c:225 [inline] __do_sys_rename fs/namei.c:5170 [inline] __se_sys_rename fs/namei.c:5168 [inline] __x64_sys_rename+0x58/0xa0 fs/namei.c:5168 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807ba98200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ba98280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807ba98300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807ba98380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ba98400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in __ethtool_get_link_ksettings+0x165/0x190 net/ethtool/ioctl.c:446 Read of size 8 at addr ffff88807ba98308 by task kworker/1:4/5288 CPU: 1 UID: 0 PID: 5288 Comm: kworker/1:4 Tainted: G B 6.11.0-rc3-syzkaller-00066-g1fb918967b56 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: events smc_ib_port_event_work Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 __ethtool_get_link_ksettings+0x165/0x190 net/ethtool/ioctl.c:446 __ethtool_get_link_ksettings+0xf5/0x190 net/ethtool/ioctl.c:446 ib_get_eth_speed+0x123/0xb50 drivers/infiniband/core/verbs.c:1996 rxe_query_port+0x72/0x200 drivers/infiniband/sw/rxe/rxe_verbs.c:55 __ib_query_port drivers/infiniband/core/device.c:2085 [inline] ib_query_port drivers/infiniband/core/device.c:2117 [inline] ib_query_port+0x441/0x8a0 drivers/infiniband/core/device.c:2107 smc_ib_remember_port_attr net/smc/smc_ib.c:364 [inline] smc_ib_port_event_work+0x130/0xc00 net/smc/smc_ib.c:388 process_one_work+0x9c8/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 5228: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4158 [inline] __kmalloc_node_noprof+0x211/0x430 mm/slub.c:4164 __kvmalloc_node_noprof+0x9d/0x1a0 mm/util.c:650 alloc_netdev_mqs+0xd1/0x13d0 net/core/dev.c:11042 rtnl_create_link+0xc10/0xfa0 net/core/rtnetlink.c:3374 rtnl_newlink_create net/core/rtnetlink.c:3500 [inline] __rtnl_newlink+0x10ae/0x1960 net/core/rtnetlink.c:3730 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3743 rtnetlink_rcv_msg+0x3ca/0xea0 net/core/rtnetlink.c:6647 netlink_rcv_skb+0x16e/0x440 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x547/0x830 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] __sys_sendto+0x482/0x4e0 net/socket.c:2204 __do_sys_sendto net/socket.c:2216 [inline] __se_sys_sendto net/socket.c:2212 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2212 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 62: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x12a/0x3b0 mm/slub.c:4594 kvfree+0x47/0x50 mm/util.c:696 device_release+0xa4/0x240 drivers/base/core.c:2582 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1fd/0x5b0 lib/kobject.c:737 netdev_run_todo+0x7bc/0x12d0 net/core/dev.c:10761 default_device_exit_batch+0x860/0xae0 net/core/dev.c:11890 ops_exit_list+0x12b/0x180 net/core/net_namespace.c:178 cleanup_net+0x5b7/0xbf0 net/core/net_namespace.c:640 process_one_work+0x9c8/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88807ba98000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 776 bytes inside of freed 4096-byte region [ffff88807ba98000, ffff88807ba99000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7ba98 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88807f286a01 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff88801584f500 ffffea0001de8200 dead000000000003 raw: 0000000000000000 0000000000040004 00000001fdffffff ffff88807f286a01 head: 00fff00000000040 ffff88801584f500 ffffea0001de8200 dead000000000003 head: 0000000000000000 0000000000040004 00000001fdffffff ffff88807f286a01 head: 00fff00000000003 ffffea0001eea601 ffffffffffffffff 0000000000000000 head: 0000000000000008 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4681, tgid 4681 (udevd), ts 66604047895, free_ts 66573256870 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3442 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4700 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x4e/0xf0 mm/slub.c:2321 allocate_slab mm/slub.c:2484 [inline] new_slab+0x84/0x260 mm/slub.c:2537 ___slab_alloc+0xdac/0x1870 mm/slub.c:3723 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __do_kmalloc_node mm/slub.c:4157 [inline] __kmalloc_node_noprof+0x357/0x430 mm/slub.c:4164 __kvmalloc_node_noprof+0x9d/0x1a0 mm/util.c:650 seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x830/0x12c0 fs/seq_file.c:210 kernfs_fop_read_iter+0x41a/0x590 fs/kernfs/file.c:279 new_sync_read fs/read_write.c:395 [inline] vfs_read+0x86c/0xbd0 fs/read_write.c:476 ksys_read+0x12f/0x260 fs/read_write.c:619 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 4683 tgid 4683 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2612 __put_partials+0x14c/0x170 mm/slub.c:3051 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4044 getname_flags.part.0+0x4c/0x550 fs/namei.c:139 getname_flags+0x93/0xf0 include/linux/audit.h:322 getname fs/namei.c:225 [inline] __do_sys_rename fs/namei.c:5170 [inline] __se_sys_rename fs/namei.c:5168 [inline] __x64_sys_rename+0x58/0xa0 fs/namei.c:5168 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807ba98200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ba98280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807ba98300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807ba98380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ba98400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================