================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x78/0x2100 kernel/locking/lockdep.c:5091 Read of size 8 at addr ffff88802d9ae428 by task kworker/u8:5/1038 CPU: 1 UID: 0 PID: 1038 Comm: kworker/u8:5 Not tainted 6.14.0-rc3-next-20250218-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Workqueue: btrfs-endio-write btrfs_work_helper Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:410 [inline] print_report+0x16b/0x5a0 mm/kasan/report.c:510 kasan_report+0x143/0x180 mm/kasan/report.c:623 __lock_acquire+0x78/0x2100 kernel/locking/lockdep.c:5091 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:557 [inline] try_to_wake_up+0xc2/0x1470 kernel/sched/core.c:4209 btrfs_put_ordered_extent+0x1b3/0x570 fs/btrfs/ordered-data.c:620 btrfs_finish_one_ordered+0x1438/0x1f60 fs/btrfs/inode.c:3303 btrfs_work_helper+0x3b5/0xc50 fs/btrfs/async-thread.c:313 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 2: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4129 [inline] slab_alloc_node mm/slub.c:4178 [inline] kmem_cache_alloc_node_noprof+0x1d9/0x380 mm/slub.c:4230 alloc_task_struct_node kernel/fork.c:180 [inline] dup_task_struct+0x57/0x8c0 kernel/fork.c:1082 copy_process+0x5d1/0x3cf0 kernel/fork.c:2216 kernel_clone+0x226/0x8e0 kernel/fork.c:2798 kernel_thread+0x1c0/0x250 kernel/fork.c:2860 create_kthread kernel/kthread.c:487 [inline] kthreadd+0x60d/0x810 kernel/kthread.c:847 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 22: 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:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2367 [inline] slab_free mm/slub.c:4623 [inline] kmem_cache_free+0x195/0x410 mm/slub.c:4725 put_task_struct include/linux/sched/task.h:145 [inline] delayed_put_task_struct+0x125/0x300 kernel/exit.c:224 rcu_do_batch kernel/rcu/tree.c:2566 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2822 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xaa/0xc0 mm/kasan/generic.c:548 __call_rcu_common kernel/rcu/tree.c:3080 [inline] call_rcu+0x168/0xac0 kernel/rcu/tree.c:3200 context_switch kernel/sched/core.c:5376 [inline] __schedule+0x1916/0x4c90 kernel/sched/core.c:6760 preempt_schedule_common+0x84/0xd0 kernel/sched/core.c:6939 preempt_schedule+0xe1/0xf0 kernel/sched/core.c:6963 preempt_schedule_thunk+0x16/0x30 arch/x86/entry/thunk.S:12 blk_mq_raise_softirq block/blk-mq.c:1283 [inline] blk_mq_complete_request_remote+0x59a/0x740 block/blk-mq.c:1306 blk_mq_complete_request+0x19/0xa0 block/blk-mq.c:1322 loop_handle_cmd drivers/block/loop.c:1946 [inline] loop_process_work+0x1bc8/0x21c0 drivers/block/loop.c:1964 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88802d9ada00 which belongs to the cache task_struct of size 7424 The buggy address is located 2600 bytes inside of freed 7424-byte region [ffff88802d9ada00, ffff88802d9af700) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d9a8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88805f6c4341 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801c283500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000000f5000000 ffff88805f6c4341 head: 00fff00000000040 ffff88801c283500 dead000000000100 dead000000000122 head: 0000000000000000 0000000000040004 00000000f5000000 ffff88805f6c4341 head: 00fff00000000003 ffffea0000b66a01 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 18009390771, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1629 prep_new_page mm/page_alloc.c:1637 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3555 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4817 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2437 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2601 new_slab mm/slub.c:2654 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3840 __slab_alloc+0x58/0xa0 mm/slub.c:3930 __slab_alloc_node mm/slub.c:4005 [inline] slab_alloc_node mm/slub.c:4166 [inline] kmem_cache_alloc_node_noprof+0x269/0x380 mm/slub.c:4230 alloc_task_struct_node kernel/fork.c:180 [inline] dup_task_struct+0x57/0x8c0 kernel/fork.c:1082 copy_process+0x5d1/0x3cf0 kernel/fork.c:2216 kernel_clone+0x226/0x8e0 kernel/fork.c:2798 kernel_thread+0x1c0/0x250 kernel/fork.c:2860 create_kthread kernel/kthread.c:487 [inline] kthreadd+0x60d/0x810 kernel/kthread.c:847 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page_owner free stack trace missing Memory state around the buggy address: ffff88802d9ae300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802d9ae380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802d9ae400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802d9ae480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802d9ae500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================