==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x11c/0x7f70 kernel/locking/lockdep.c:5004
Read of size 8 at addr ffff88801c678a00 by task sed/5712
CPU: 0 PID: 5712 Comm: sed Not tainted 6.6.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0x163/0x540 mm/kasan/report.c:475
kasan_report+0x175/0x1b0 mm/kasan/report.c:588
__lock_acquire+0x11c/0x7f70 kernel/locking/lockdep.c:5004
lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753
__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:518 [inline]
try_to_wake_up+0xb1/0x1300 kernel/sched/core.c:4230
call_timer_fn+0x17a/0x580 kernel/time/timer.c:1700
expire_timers kernel/time/timer.c:1751 [inline]
__run_timers+0x64f/0x860 kernel/time/timer.c:2022
run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2035
__do_softirq+0x2ab/0x908 kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu+0xf1/0x1b0 kernel/softirq.c:632
irq_exit_rcu+0x9/0x20 kernel/softirq.c:644
sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1074
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:lock_is_held_type+0x13b/0x190
Code: 75 40 48 c7 04 24 00 00 00 00 9c 8f 04 24 f7 04 24 00 02 00 00 75 46 41 f7 c4 00 02 00 00 74 01 fb 65 48 8b 04 25 28 00 00 00 <48> 3b 44 24 08 75 3c 89 e8 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f
RSP: 0018:ffffc900072b7d78 EFLAGS: 00000206
RAX: e8823e1d5ddbbf00 RBX: 0000000000000000 RCX: ffff888022703b80
RDX: ffff888022703b80 RSI: ffffffff8b0a9000 RDI: ffffffff8b59f0c0
RBP: 0000000000000001 R08: ffffffff81c99ac4 R09: 1ffff1100faaacde
R10: dffffc0000000000 R11: ffffed100faaacdf R12: 0000000000000246
R13: ffff888022703b80 R14: 0000000000000000 R15: ffff88807d556760
mmap_assert_write_locked include/linux/mmap_lock.h:71 [inline]
vma_end_write_all include/linux/mmap_lock.h:86 [inline]
mmap_write_unlock include/linux/mmap_lock.h:132 [inline]
vm_mmap_pgoff+0x22a/0x410 mm/util.c:548
ksys_mmap_pgoff+0x4ff/0x6d0 mm/mmap.c:1400
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f41791f5b74
Code: 63 08 44 89 e8 5b 41 5c 41 5d c3 41 89 ca 41 f7 c1 ff 0f 00 00 74 0c c7 05 f5 46 01 00 16 00 00 00 eb 17 b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 0c f7 d8 89 05 dc 46 01 00 48 83 c8 ff c3 0f
RSP: 002b:00007ffe189a72d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007ffe189a7350 RCX: 00007f41791f5b74
RDX: 0000000000000001 RSI: 0000000000007000 RDI: 00007f4178f48000
RBP: 00007ffe189a76b0 R08: 0000000000000003 R09: 000000000001b000
R10: 0000000000000812 R11: 0000000000000246 R12: 00007f41791d8fc0
R13: 00007ffe189a7738 R14: 000000000001a43e R15: 0000000000000000
Allocated by task 2:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4f/0x70 mm/kasan/common.c:52
__kasan_slab_alloc+0x4b/0x60 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook+0x65/0x3b0 mm/slab.h:762
slab_alloc_node mm/slub.c:3478 [inline]
kmem_cache_alloc_node+0x140/0x2e0 mm/slub.c:3523
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct+0x57/0x7d0 kernel/fork.c:1110
copy_process+0x5d1/0x41a0 kernel/fork.c:2327
kernel_clone+0x222/0x840 kernel/fork.c:2909
kernel_thread+0x1bc/0x230 kernel/fork.c:2971
create_kthread kernel/kthread.c:411 [inline]
kthreadd+0x610/0x810 kernel/kthread.c:746
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
Freed by task 4467:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4f/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
____kasan_slab_free+0xb0/0x100 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook mm/slub.c:1826 [inline]
slab_free mm/slub.c:3809 [inline]
kmem_cache_free+0x217/0x490 mm/slub.c:3831
put_task_struct include/linux/sched/task.h:136 [inline]
delayed_put_task_struct+0x115/0x2c0 kernel/exit.c:226
rcu_do_batch kernel/rcu/tree.c:2139 [inline]
rcu_core+0xacf/0x1790 kernel/rcu/tree.c:2403
__do_softirq+0x2ab/0x908 kernel/softirq.c:553
Last potentially related work creation:
kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack mm/kasan/generic.c:492 [inline]
kasan_record_aux_stack_noalloc+0x84/0x90 mm/kasan/generic.c:502
__call_rcu_common kernel/rcu/tree.c:2653 [inline]
call_rcu+0x167/0xa70 kernel/rcu/tree.c:2767
context_switch kernel/sched/core.c:5385 [inline]
__schedule+0x1974/0x4af0 kernel/sched/core.c:6695
schedule+0xc3/0x180 kernel/sched/core.c:6771
worker_thread+0xc26/0xff0 kernel/workqueue.c:2799
kthread+0x2d3/0x370 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
Second to last potentially related work creation:
kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack mm/kasan/generic.c:492 [inline]
kasan_record_aux_stack_noalloc+0x84/0x90 mm/kasan/generic.c:502
__call_rcu_common kernel/rcu/tree.c:2653 [inline]
call_rcu+0x167/0xa70 kernel/rcu/tree.c:2767
put_task_struct_rcu_user kernel/exit.c:232 [inline]
release_task+0x1608/0x1750 kernel/exit.c:282
wait_task_zombie kernel/exit.c:1210 [inline]
wait_consider_task+0x1a78/0x2ed0 kernel/exit.c:1437
do_wait_thread kernel/exit.c:1500 [inline]
do_wait+0x311/0xb00 kernel/exit.c:1617
kernel_wait4+0x2a2/0x3e0 kernel/exit.c:1780
__do_sys_wait4 kernel/exit.c:1808 [inline]
__se_sys_wait4 kernel/exit.c:1804 [inline]
__x64_sys_wait4+0x134/0x1e0 kernel/exit.c:1804
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
The buggy address belongs to the object at ffff88801c678000
which belongs to the cache task_struct of size 7360
The buggy address is located 2560 bytes inside of
freed 7360-byte region [ffff88801c678000, ffff88801c679cc0)
The buggy address belongs to the physical page:
page:ffffea0000719e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c678
head:ffffea0000719e00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88807b4e5841
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888016a40500 ffffea0000793400 dead000000000002
raw: 0000000000000000 0000000000040004 00000001ffffffff ffff88807b4e5841
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 27, tgid 27 (kworker/u4:1), ts 7440290750, free_ts 0
prep_new_page mm/page_alloc.c:1543 [inline]
get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170
__alloc_pages+0x255/0x670 mm/page_alloc.c:4426
alloc_slab_page+0x6a/0x160 mm/slub.c:1870
allocate_slab mm/slub.c:2017 [inline]
new_slab+0x84/0x2f0 mm/slub.c:2070
___slab_alloc+0xc85/0x1310 mm/slub.c:3223
__slab_alloc mm/slub.c:3322 [inline]
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
kmem_cache_alloc_node+0x1db/0x2e0 mm/slub.c:3523
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct+0x57/0x7d0 kernel/fork.c:1110
copy_process+0x5d1/0x41a0 kernel/fork.c:2327
kernel_clone+0x222/0x840 kernel/fork.c:2909
user_mode_thread+0x132/0x190 kernel/fork.c:2987
call_usermodehelper_exec_work+0x5c/0x220 kernel/umh.c:172
process_one_work kernel/workqueue.c:2630 [inline]
process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703
worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784
kthread+0x2d3/0x370 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
page_owner free stack trace missing
Memory state around the buggy address:
ffff88801c678900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801c678980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801c678a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801c678a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801c678b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 75 40 jne 0x42
2: 48 c7 04 24 00 00 00 movq $0x0,(%rsp)
9: 00
a: 9c pushf
b: 8f 04 24 pop (%rsp)
e: f7 04 24 00 02 00 00 testl $0x200,(%rsp)
15: 75 46 jne 0x5d
17: 41 f7 c4 00 02 00 00 test $0x200,%r12d
1e: 74 01 je 0x21
20: fb sti
21: 65 48 8b 04 25 28 00 mov %gs:0x28,%rax
28: 00 00
* 2a: 48 3b 44 24 08 cmp 0x8(%rsp),%rax <-- trapping instruction
2f: 75 3c jne 0x6d
31: 89 e8 mov %ebp,%eax
33: 48 83 c4 10 add $0x10,%rsp
37: 5b pop %rbx
38: 41 5c pop %r12
3a: 41 5d pop %r13
3c: 41 5e pop %r14
3e: 41 5f pop %r15