==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x3ffd/0x5df0 kernel/locking/lockdep.c:4942
Read of size 8 at addr ffff888024d90970 by task swapper/0/0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.2.0-rc8-next-20230217-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319
print_report mm/kasan/report.c:430 [inline]
kasan_report+0x11c/0x130 mm/kasan/report.c:536
__lock_acquire+0x3ffd/0x5df0 kernel/locking/lockdep.c:4942
lock_acquire.part.0+0x11c/0x370 kernel/locking/lockdep.c:5691
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162
try_to_wake_up+0xae/0x1bf0 kernel/sched/core.c:4159
call_timer_fn+0x1da/0x800 kernel/time/timer.c:1700
expire_timers+0x234/0x330 kernel/time/timer.c:1751
__run_timers kernel/time/timer.c:2022 [inline]
__run_timers kernel/time/timer.c:1995 [inline]
run_timer_softirq+0x326/0x910 kernel/time/timer.c:2035
__do_softirq+0x2e3/0xae3 kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x114/0x190 kernel/softirq.c:650
irq_exit_rcu+0x9/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1107
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:native_irq_disable arch/x86/include/asm/irqflags.h:37 [inline]
RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:72 [inline]
RIP: 0010:acpi_safe_halt+0x40/0x50 drivers/acpi/processor_idle.c:113
Code: eb 03 83 e3 01 89 de 0f 1f 44 00 00 84 db 75 1b 0f 1f 44 00 00 66 90 0f 1f 44 00 00 0f 00 2d 67 03 9c 00 0f 1f 44 00 00 fb f4 5b c3 cc 0f 1f 00 66 0f 1f 84 00 00 00 00 00 55 48 89 fd 53 0f
RSP: 0018:ffffffff8c407d30 EFLAGS: 00000246
RAX: ffffffff8c495840 RBX: 0000000000000000 RCX: ffffffff8a160fe5
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff88801679a864 R08: 0000000000000001 R09: ffff8880b9836c6b
R10: ffffed1017306d8d R11: 0000000000000000 R12: 0000000000000001
R13: ffff88801679a800 R14: ffff88801679a864 R15: 0000000000000000
acpi_idle_do_entry+0x53/0x70 drivers/acpi/processor_idle.c:573
acpi_idle_enter+0x173/0x290 drivers/acpi/processor_idle.c:711
cpuidle_enter_state+0xd3/0x6f0 drivers/cpuidle/cpuidle.c:267
cpuidle_enter+0x4e/0xa0 drivers/cpuidle/cpuidle.c:388
cpuidle_idle_call kernel/sched/idle.c:215 [inline]
do_idle+0x348/0x440 kernel/sched/idle.c:282
cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:379
rest_init+0x16d/0x2b0 init/main.c:732
arch_call_rest_init+0x13/0x30 init/main.c:894
start_kernel+0x35a/0x4d0 init/main.c:1148
secondary_startup_64_no_verify+0xce/0xdb
Allocated by task 2:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
__kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:186 [inline]
slab_post_alloc_hook mm/slab.h:769 [inline]
slab_alloc_node mm/slub.c:3452 [inline]
kmem_cache_alloc_node+0x183/0x350 mm/slub.c:3497
alloc_task_struct_node kernel/fork.c:171 [inline]
dup_task_struct kernel/fork.c:976 [inline]
copy_process+0x3aa/0x76c0 kernel/fork.c:2100
kernel_clone+0xeb/0xa10 kernel/fork.c:2684
kernel_thread+0xb9/0xf0 kernel/fork.c:2744
create_kthread kernel/kthread.c:399 [inline]
kthreadd+0x4f2/0x750 kernel/kthread.c:746
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
Freed by task 0:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:162 [inline]
slab_free_hook mm/slub.c:1781 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807
slab_free mm/slub.c:3787 [inline]
kmem_cache_free+0xec/0x4e0 mm/slub.c:3809
put_task_struct include/linux/sched/task.h:119 [inline]
delayed_put_task_struct+0x26e/0x3f0 kernel/exit.c:225
rcu_do_batch kernel/rcu/tree.c:2115 [inline]
rcu_core+0x874/0x1b30 kernel/rcu/tree.c:2375
__do_softirq+0x2e3/0xae3 kernel/softirq.c:571
Last potentially related work creation:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491
__call_rcu_common.constprop.0+0x99/0x7d0 kernel/rcu/tree.c:2625
put_task_struct_rcu_user+0x83/0xc0 kernel/exit.c:231
context_switch kernel/sched/core.c:5307 [inline]
__schedule+0x24bc/0x5ac0 kernel/sched/core.c:6622
preempt_schedule_irq+0x52/0x90 kernel/sched/core.c:6934
irqentry_exit+0x35/0x80 kernel/entry/common.c:433
asm_sysvec_reschedule_ipi+0x1a/0x20 arch/x86/include/asm/idtentry.h:650
Second to last potentially related work creation:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491
__call_rcu_common.constprop.0+0x99/0x7d0 kernel/rcu/tree.c:2625
put_task_struct_rcu_user+0x83/0xc0 kernel/exit.c:231
release_task+0xcc8/0x1870 kernel/exit.c:281
wait_task_zombie kernel/exit.c:1205 [inline]
wait_consider_task+0x306d/0x3ce0 kernel/exit.c:1432
do_wait_thread kernel/exit.c:1495 [inline]
do_wait+0x7cd/0xd90 kernel/exit.c:1612
kernel_wait4+0x150/0x260 kernel/exit.c:1775
__do_sys_wait4+0x13f/0x150 kernel/exit.c:1803
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
The buggy address belongs to the object at ffff888024d90000
which belongs to the cache task_struct of size 7232
The buggy address is located 2416 bytes inside of
freed 7232-byte region [ffff888024d90000, ffff888024d91c40)
The buggy address belongs to the physical page:
page:ffffea0000936400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24d90
head:ffffea0000936400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffff888140007500 dead000000000100 dead000000000122
raw: 0000000000000000 0000000080040004 00000001ffffffff 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 41, tgid 41 (kworker/u4:2), ts 20817436487, free_ts 0
prep_new_page mm/page_alloc.c:2552 [inline]
get_page_from_freelist+0x11bb/0x2d50 mm/page_alloc.c:4339
__alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5605
alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283
alloc_slab_page mm/slub.c:1851 [inline]
allocate_slab+0x28e/0x380 mm/slub.c:1998
new_slab mm/slub.c:2051 [inline]
___slab_alloc+0xa91/0x1400 mm/slub.c:3193
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292
__slab_alloc_node mm/slub.c:3345 [inline]
slab_alloc_node mm/slub.c:3442 [inline]
kmem_cache_alloc_node+0x136/0x350 mm/slub.c:3497
alloc_task_struct_node kernel/fork.c:171 [inline]
dup_task_struct kernel/fork.c:976 [inline]
copy_process+0x3aa/0x76c0 kernel/fork.c:2100
kernel_clone+0xeb/0xa10 kernel/fork.c:2684
user_mode_thread+0xb1/0xf0 kernel/fork.c:2760
call_usermodehelper_exec_work kernel/umh.c:175 [inline]
call_usermodehelper_exec_work+0xd0/0x180 kernel/umh.c:161
process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390
worker_thread+0x669/0x1090 kernel/workqueue.c:2537
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
page_owner free stack trace missing
Memory state around the buggy address:
ffff888024d90800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888024d90880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888024d90900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888024d90980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888024d90a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: eb 03 jmp 0x5
2: 83 e3 01 and $0x1,%ebx
5: 89 de mov %ebx,%esi
7: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
c: 84 db test %bl,%bl
e: 75 1b jne 0x2b
10: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
15: 66 90 xchg %ax,%ax
17: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
1c: 0f 00 2d 67 03 9c 00 verw 0x9c0367(%rip) # 0x9c038a
23: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
28: fb sti
29: f4 hlt
* 2a: fa cli <-- trapping instruction
2b: 5b pop %rbx
2c: c3 retq
2d: cc int3
2e: 0f 1f 00 nopl (%rax)
31: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
38: 00 00
3a: 55 push %rbp
3b: 48 89 fd mov %rdi,%rbp
3e: 53 push %rbx
3f: 0f .byte 0xf