================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2dd6/0x3b30 kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff888020d7a818 by task kworker/u8:1/12 CPU: 1 PID: 12 Comm: kworker/u8:1 Not tainted 6.10.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: btrfs-delalloc btrfs_work_helper Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 __lock_acquire+0x2dd6/0x3b30 kernel/locking/lockdep.c:5005 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline] try_to_wake_up+0x9a/0x13e0 kernel/sched/core.c:4262 btrfs_add_delayed_iput+0x30a/0x3d0 fs/btrfs/inode.c:3417 submit_compressed_extents+0xd02/0x13a0 fs/btrfs/inode.c:1624 run_ordered_work fs/btrfs/async-thread.c:288 [inline] btrfs_work_helper+0x68d/0xc90 fs/btrfs/async-thread.c:324 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 2: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 18347: 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:2196 [inline] slab_free mm/slub.c:4437 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4512 put_task_struct include/linux/sched/task.h:138 [inline] put_task_struct include/linux/sched/task.h:125 [inline] delayed_put_task_struct+0x22c/0x300 kernel/exit.c:228 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0x82b/0x16b0 kernel/rcu/tree.c:2809 handle_softirqs+0x219/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:3072 put_task_struct_rcu_user kernel/exit.c:234 [inline] put_task_struct_rcu_user+0x87/0xd0 kernel/exit.c:231 context_switch kernel/sched/core.c:5411 [inline] __schedule+0xf1d/0x5d00 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6837 schedule_timeout+0x136/0x2a0 kernel/time/timer.c:2581 do_wait_for_common kernel/sched/completion.c:95 [inline] __wait_for_common+0x3e1/0x5f0 kernel/sched/completion.c:116 usb_start_wait_urb+0x148/0x4c0 drivers/usb/core/message.c:64 usb_internal_control_msg drivers/usb/core/message.c:103 [inline] usb_control_msg+0x327/0x4b0 drivers/usb/core/message.c:154 hub_set_address drivers/usb/core/hub.c:4724 [inline] hub_port_init+0x1d0a/0x3a50 drivers/usb/core/hub.c:5029 hub_port_connect drivers/usb/core/hub.c:5450 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x2b65/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 ffff888020d79e00 which belongs to the cache task_struct of size 7424 The buggy address is located 2584 bytes inside of freed 7424-byte region [ffff888020d79e00, ffff888020d7bb00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20d78 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88801c6ef781 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 raw: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 head: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000003 ffffea0000835e01 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 2, tgid 2 (kthreadd), ts 16581616576, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2e50 mm/page_alloc.c:3420 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] kmem_cache_alloc_node_noprof+0xed/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page_owner free stack trace missing Memory state around the buggy address: ffff888020d7a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020d7a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020d7a880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2d98/0x3b30 kernel/locking/lockdep.c:5009 Read of size 8 at addr ffff888020d7a820 by task kworker/u8:1/12 CPU: 1 PID: 12 Comm: kworker/u8:1 Tainted: G B 6.10.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: btrfs-delalloc btrfs_work_helper Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 __lock_acquire+0x2d98/0x3b30 kernel/locking/lockdep.c:5009 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline] try_to_wake_up+0x9a/0x13e0 kernel/sched/core.c:4262 btrfs_add_delayed_iput+0x30a/0x3d0 fs/btrfs/inode.c:3417 submit_compressed_extents+0xd02/0x13a0 fs/btrfs/inode.c:1624 run_ordered_work fs/btrfs/async-thread.c:288 [inline] btrfs_work_helper+0x68d/0xc90 fs/btrfs/async-thread.c:324 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 2: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 18347: 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:2196 [inline] slab_free mm/slub.c:4437 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4512 put_task_struct include/linux/sched/task.h:138 [inline] put_task_struct include/linux/sched/task.h:125 [inline] delayed_put_task_struct+0x22c/0x300 kernel/exit.c:228 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0x82b/0x16b0 kernel/rcu/tree.c:2809 handle_softirqs+0x219/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:3072 put_task_struct_rcu_user kernel/exit.c:234 [inline] put_task_struct_rcu_user+0x87/0xd0 kernel/exit.c:231 context_switch kernel/sched/core.c:5411 [inline] __schedule+0xf1d/0x5d00 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6837 schedule_timeout+0x136/0x2a0 kernel/time/timer.c:2581 do_wait_for_common kernel/sched/completion.c:95 [inline] __wait_for_common+0x3e1/0x5f0 kernel/sched/completion.c:116 usb_start_wait_urb+0x148/0x4c0 drivers/usb/core/message.c:64 usb_internal_control_msg drivers/usb/core/message.c:103 [inline] usb_control_msg+0x327/0x4b0 drivers/usb/core/message.c:154 hub_set_address drivers/usb/core/hub.c:4724 [inline] hub_port_init+0x1d0a/0x3a50 drivers/usb/core/hub.c:5029 hub_port_connect drivers/usb/core/hub.c:5450 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x2b65/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 ffff888020d79e00 which belongs to the cache task_struct of size 7424 The buggy address is located 2592 bytes inside of freed 7424-byte region [ffff888020d79e00, ffff888020d7bb00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20d78 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88801c6ef781 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 raw: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 head: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000003 ffffea0000835e01 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 2, tgid 2 (kthreadd), ts 16581616576, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2e50 mm/page_alloc.c:3420 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] kmem_cache_alloc_node_noprof+0xed/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page_owner free stack trace missing Memory state around the buggy address: ffff888020d7a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020d7a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020d7a880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff888020d7a804 by task kworker/u8:1/12 CPU: 1 PID: 12 Comm: kworker/u8:1 Tainted: G B 6.10.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: btrfs-delalloc btrfs_work_helper Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline] try_to_wake_up+0x9a/0x13e0 kernel/sched/core.c:4262 btrfs_add_delayed_iput+0x30a/0x3d0 fs/btrfs/inode.c:3417 submit_compressed_extents+0xd02/0x13a0 fs/btrfs/inode.c:1624 run_ordered_work fs/btrfs/async-thread.c:288 [inline] btrfs_work_helper+0x68d/0xc90 fs/btrfs/async-thread.c:324 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 2: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 18347: 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:2196 [inline] slab_free mm/slub.c:4437 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4512 put_task_struct include/linux/sched/task.h:138 [inline] put_task_struct include/linux/sched/task.h:125 [inline] delayed_put_task_struct+0x22c/0x300 kernel/exit.c:228 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0x82b/0x16b0 kernel/rcu/tree.c:2809 handle_softirqs+0x219/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:3072 put_task_struct_rcu_user kernel/exit.c:234 [inline] put_task_struct_rcu_user+0x87/0xd0 kernel/exit.c:231 context_switch kernel/sched/core.c:5411 [inline] __schedule+0xf1d/0x5d00 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6837 schedule_timeout+0x136/0x2a0 kernel/time/timer.c:2581 do_wait_for_common kernel/sched/completion.c:95 [inline] __wait_for_common+0x3e1/0x5f0 kernel/sched/completion.c:116 usb_start_wait_urb+0x148/0x4c0 drivers/usb/core/message.c:64 usb_internal_control_msg drivers/usb/core/message.c:103 [inline] usb_control_msg+0x327/0x4b0 drivers/usb/core/message.c:154 hub_set_address drivers/usb/core/hub.c:4724 [inline] hub_port_init+0x1d0a/0x3a50 drivers/usb/core/hub.c:5029 hub_port_connect drivers/usb/core/hub.c:5450 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x2b65/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 ffff888020d79e00 which belongs to the cache task_struct of size 7424 The buggy address is located 2564 bytes inside of freed 7424-byte region [ffff888020d79e00, ffff888020d7bb00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20d78 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88801c6ef781 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 raw: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 head: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000003 ffffea0000835e01 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 2, tgid 2 (kthreadd), ts 16581616576, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2e50 mm/page_alloc.c:3420 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] kmem_cache_alloc_node_noprof+0xed/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page_owner free stack trace missing Memory state around the buggy address: ffff888020d7a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020d7a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020d7a880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:87 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x281/0x2c0 kernel/locking/spinlock_debug.c:115 Read of size 8 at addr ffff888020d7a810 by task kworker/u8:1/12 CPU: 1 PID: 12 Comm: kworker/u8:1 Tainted: G B 6.10.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: btrfs-delalloc btrfs_work_helper Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 debug_spin_lock_before kernel/locking/spinlock_debug.c:87 [inline] do_raw_spin_lock+0x281/0x2c0 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline] try_to_wake_up+0x9a/0x13e0 kernel/sched/core.c:4262 btrfs_add_delayed_iput+0x30a/0x3d0 fs/btrfs/inode.c:3417 submit_compressed_extents+0xd02/0x13a0 fs/btrfs/inode.c:1624 run_ordered_work fs/btrfs/async-thread.c:288 [inline] btrfs_work_helper+0x68d/0xc90 fs/btrfs/async-thread.c:324 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 2: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 18347: 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:2196 [inline] slab_free mm/slub.c:4437 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4512 put_task_struct include/linux/sched/task.h:138 [inline] put_task_struct include/linux/sched/task.h:125 [inline] delayed_put_task_struct+0x22c/0x300 kernel/exit.c:228 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0x82b/0x16b0 kernel/rcu/tree.c:2809 handle_softirqs+0x219/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:3072 put_task_struct_rcu_user kernel/exit.c:234 [inline] put_task_struct_rcu_user+0x87/0xd0 kernel/exit.c:231 context_switch kernel/sched/core.c:5411 [inline] __schedule+0xf1d/0x5d00 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6837 schedule_timeout+0x136/0x2a0 kernel/time/timer.c:2581 do_wait_for_common kernel/sched/completion.c:95 [inline] __wait_for_common+0x3e1/0x5f0 kernel/sched/completion.c:116 usb_start_wait_urb+0x148/0x4c0 drivers/usb/core/message.c:64 usb_internal_control_msg drivers/usb/core/message.c:103 [inline] usb_control_msg+0x327/0x4b0 drivers/usb/core/message.c:154 hub_set_address drivers/usb/core/hub.c:4724 [inline] hub_port_init+0x1d0a/0x3a50 drivers/usb/core/hub.c:5029 hub_port_connect drivers/usb/core/hub.c:5450 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x2b65/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 ffff888020d79e00 which belongs to the cache task_struct of size 7424 The buggy address is located 2576 bytes inside of freed 7424-byte region [ffff888020d79e00, ffff888020d7bb00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20d78 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88801c6ef781 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 raw: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 head: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000003 ffffea0000835e01 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 2, tgid 2 (kthreadd), ts 16581616576, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2e50 mm/page_alloc.c:3420 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] kmem_cache_alloc_node_noprof+0xed/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page_owner free stack trace missing Memory state around the buggy address: ffff888020d7a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020d7a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020d7a880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:88 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x267/0x2c0 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff888020d7a808 by task kworker/u8:1/12 CPU: 1 PID: 12 Comm: kworker/u8:1 Tainted: G B 6.10.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: btrfs-delalloc btrfs_work_helper Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 debug_spin_lock_before kernel/locking/spinlock_debug.c:88 [inline] do_raw_spin_lock+0x267/0x2c0 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline] try_to_wake_up+0x9a/0x13e0 kernel/sched/core.c:4262 btrfs_add_delayed_iput+0x30a/0x3d0 fs/btrfs/inode.c:3417 submit_compressed_extents+0xd02/0x13a0 fs/btrfs/inode.c:1624 run_ordered_work fs/btrfs/async-thread.c:288 [inline] btrfs_work_helper+0x68d/0xc90 fs/btrfs/async-thread.c:324 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 2: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 18347: 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:2196 [inline] slab_free mm/slub.c:4437 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4512 put_task_struct include/linux/sched/task.h:138 [inline] put_task_struct include/linux/sched/task.h:125 [inline] delayed_put_task_struct+0x22c/0x300 kernel/exit.c:228 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0x82b/0x16b0 kernel/rcu/tree.c:2809 handle_softirqs+0x219/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:3072 put_task_struct_rcu_user kernel/exit.c:234 [inline] put_task_struct_rcu_user+0x87/0xd0 kernel/exit.c:231 context_switch kernel/sched/core.c:5411 [inline] __schedule+0xf1d/0x5d00 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6837 schedule_timeout+0x136/0x2a0 kernel/time/timer.c:2581 do_wait_for_common kernel/sched/completion.c:95 [inline] __wait_for_common+0x3e1/0x5f0 kernel/sched/completion.c:116 usb_start_wait_urb+0x148/0x4c0 drivers/usb/core/message.c:64 usb_internal_control_msg drivers/usb/core/message.c:103 [inline] usb_control_msg+0x327/0x4b0 drivers/usb/core/message.c:154 hub_set_address drivers/usb/core/hub.c:4724 [inline] hub_port_init+0x1d0a/0x3a50 drivers/usb/core/hub.c:5029 hub_port_connect drivers/usb/core/hub.c:5450 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x2b65/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 ffff888020d79e00 which belongs to the cache task_struct of size 7424 The buggy address is located 2568 bytes inside of freed 7424-byte region [ffff888020d79e00, ffff888020d7bb00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20d78 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88801c6ef781 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 raw: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 head: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000003 ffffea0000835e01 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 2, tgid 2 (kthreadd), ts 16581616576, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2e50 mm/page_alloc.c:3420 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] kmem_cache_alloc_node_noprof+0xed/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page_owner free stack trace missing Memory state around the buggy address: ffff888020d7a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020d7a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020d7a880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1300 [inline] BUG: KASAN: slab-use-after-free in queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x11e/0x2c0 kernel/locking/spinlock_debug.c:116 Write of size 4 at addr ffff888020d7a800 by task kworker/u8:1/12 CPU: 1 PID: 12 Comm: kworker/u8:1 Tainted: G B 6.10.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: btrfs-delalloc btrfs_work_helper Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1300 [inline] queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] do_raw_spin_lock+0x11e/0x2c0 kernel/locking/spinlock_debug.c:116 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline] try_to_wake_up+0x9a/0x13e0 kernel/sched/core.c:4262 btrfs_add_delayed_iput+0x30a/0x3d0 fs/btrfs/inode.c:3417 submit_compressed_extents+0xd02/0x13a0 fs/btrfs/inode.c:1624 run_ordered_work fs/btrfs/async-thread.c:288 [inline] btrfs_work_helper+0x68d/0xc90 fs/btrfs/async-thread.c:324 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 2: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 18347: 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:2196 [inline] slab_free mm/slub.c:4437 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4512 put_task_struct include/linux/sched/task.h:138 [inline] put_task_struct include/linux/sched/task.h:125 [inline] delayed_put_task_struct+0x22c/0x300 kernel/exit.c:228 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0x82b/0x16b0 kernel/rcu/tree.c:2809 handle_softirqs+0x219/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:3072 put_task_struct_rcu_user kernel/exit.c:234 [inline] put_task_struct_rcu_user+0x87/0xd0 kernel/exit.c:231 context_switch kernel/sched/core.c:5411 [inline] __schedule+0xf1d/0x5d00 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6837 schedule_timeout+0x136/0x2a0 kernel/time/timer.c:2581 do_wait_for_common kernel/sched/completion.c:95 [inline] __wait_for_common+0x3e1/0x5f0 kernel/sched/completion.c:116 usb_start_wait_urb+0x148/0x4c0 drivers/usb/core/message.c:64 usb_internal_control_msg drivers/usb/core/message.c:103 [inline] usb_control_msg+0x327/0x4b0 drivers/usb/core/message.c:154 hub_set_address drivers/usb/core/hub.c:4724 [inline] hub_port_init+0x1d0a/0x3a50 drivers/usb/core/hub.c:5029 hub_port_connect drivers/usb/core/hub.c:5450 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x2b65/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x9fe/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 ffff888020d79e00 which belongs to the cache task_struct of size 7424 The buggy address is located 2560 bytes inside of freed 7424-byte region [ffff888020d79e00, ffff888020d7bb00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20d78 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88801c6ef781 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 raw: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000040 ffff8880162f0500 ffffea0001372000 dead000000000003 head: 0000000000000000 0000000000040004 00000001ffffefff ffff88801c6ef781 head: 00fff00000000003 ffffea0000835e01 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 2, tgid 2 (kthreadd), ts 16581616576, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2e50 mm/page_alloc.c:3420 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] kmem_cache_alloc_node_noprof+0xed/0x310 mm/slub.c:4044 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct kernel/fork.c:1107 [inline] copy_process+0x4b7/0x8f10 kernel/fork.c:2220 kernel_clone+0xfd/0x980 kernel/fork.c:2797 kernel_thread+0xc0/0x100 kernel/fork.c:2859 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page_owner free stack trace missing Memory state around the buggy address: ffff888020d7a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020d7a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020d7a880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020d7a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================