================================================================== BUG: KASAN: slab-use-after-free in workqueue_sysfs_unregister kernel/workqueue.c:7364 [inline] BUG: KASAN: slab-use-after-free in destroy_workqueue+0x41/0xc40 kernel/workqueue.c:5773 Read of size 8 at addr ffff88807a153928 by task syz.2.17/5446 CPU: 0 UID: 0 PID: 5446 Comm: syz.2.17 Not tainted 6.11.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 workqueue_sysfs_unregister kernel/workqueue.c:7364 [inline] destroy_workqueue+0x41/0xc40 kernel/workqueue.c:5773 gfs2_fill_super+0x128a/0x2500 fs/gfs2/ops_fstype.c:1310 get_tree_bdev+0x3f7/0x570 fs/super.c:1635 gfs2_get_tree+0x54/0x220 fs/gfs2/ops_fstype.c:1329 vfs_get_tree+0x90/0x2a0 fs/super.c:1800 do_new_mount+0x2be/0xb40 fs/namespace.c:3472 do_mount fs/namespace.c:3812 [inline] __do_sys_mount fs/namespace.c:4020 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4d7fd7b61a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc06a740c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007ffc06a74150 RCX: 00007f4d7fd7b61a RDX: 00000000200124c0 RSI: 0000000020000040 RDI: 00007ffc06a74110 RBP: 00000000200124c0 R08: 00007ffc06a74150 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000040 R13: 00007ffc06a74110 R14: 00000000000124ab R15: 0000000020000240 Allocated by task 5446: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4158 [inline] __kmalloc_noprof+0x1fc/0x400 mm/slub.c:4170 kmalloc_noprof include/linux/slab.h:685 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] alloc_workqueue+0x1b0/0x1fe0 kernel/workqueue.c:5641 gfs2_fill_super+0x1149/0x2500 fs/gfs2/ops_fstype.c:1191 get_tree_bdev+0x3f7/0x570 fs/super.c:1635 gfs2_get_tree+0x54/0x220 fs/gfs2/ops_fstype.c:1329 vfs_get_tree+0x90/0x2a0 fs/super.c:1800 do_new_mount+0x2be/0xb40 fs/namespace.c:3472 do_mount fs/namespace.c:3812 [inline] __do_sys_mount fs/namespace.c:4020 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 24: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 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+0x149/0x360 mm/slub.c:4594 rcu_do_batch kernel/rcu/tree.c:2569 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2843 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 run_ksoftirqd+0xca/0x130 kernel/softirq.c:928 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:3106 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3210 kthread_worker_fn+0x500/0xaf0 kernel/kthread.c:842 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/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 ffff88807a153800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 296 bytes inside of freed 512-byte region [ffff88807a153800, ffff88807a153a00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a150 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff888015441c80 ffffea0000910e00 0000000000000003 raw: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000 head: 00fff00000000040 ffff888015441c80 ffffea0000910e00 0000000000000003 head: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000 head: 00fff00000000002 ffffea0001e85401 ffffffffffffffff 0000000000000000 head: ffff888000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5328, tgid 5328 (syz-executor), ts 91976279308, free_ts 91908445545 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3439 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4695 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 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_noprof+0x25a/0x400 mm/slub.c:4170 kmalloc_noprof include/linux/slab.h:685 [inline] switchdev_deferred_enqueue+0x44/0x260 net/switchdev/switchdev.c:117 switchdev_port_attr_set_defer net/switchdev/switchdev.c:183 [inline] switchdev_port_attr_set+0xf8/0x2e0 net/switchdev/switchdev.c:202 br_set_state+0x2c9/0x7b0 net/bridge/br_stp.c:52 new_nbp+0x310/0x430 net/bridge/br_if.c:443 br_add_if+0x28d/0xef0 net/bridge/br_if.c:599 do_set_master net/core/rtnetlink.c:2701 [inline] do_setlink+0xe73/0x41f0 net/core/rtnetlink.c:2907 __rtnl_newlink net/core/rtnetlink.c:3696 [inline] rtnl_newlink+0x180d/0x20a0 net/core/rtnetlink.c:3743 rtnetlink_rcv_msg+0x73f/0xcf0 net/core/rtnetlink.c:6647 page last free pid 5322 tgid 5322 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd19/0xea0 mm/page_alloc.c:2612 __slab_free+0x31b/0x3d0 mm/slub.c:4384 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 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] __kmalloc_cache_noprof+0x132/0x2c0 mm/slub.c:4184 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] kset_create lib/kobject.c:965 [inline] kset_create_and_add+0x5b/0x170 lib/kobject.c:1008 register_queue_kobjects net/core/net-sysfs.c:1887 [inline] netdev_register_kobject+0x1a8/0x320 net/core/net-sysfs.c:2140 register_netdevice+0x12c5/0x1b00 net/core/dev.c:10444 veth_newlink+0x855/0xce0 drivers/net/veth.c:1860 rtnl_newlink_create net/core/rtnetlink.c:3510 [inline] __rtnl_newlink net/core/rtnetlink.c:3730 [inline] rtnl_newlink+0x1591/0x20a0 net/core/rtnetlink.c:3743 rtnetlink_rcv_msg+0x73f/0xcf0 net/core/rtnetlink.c:6647 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 Memory state around the buggy address: ffff88807a153800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807a153880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807a153900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807a153980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807a153a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================