==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x2d85/0x3b20 kernel/locking/lockdep.c:5005
Read of size 8 at addr ffff88801df327b8 by task syz-executor258/5413
CPU: 0 PID: 5413 Comm: syz-executor258 Not tainted 6.7.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
__lock_acquire+0x2d85/0x3b20 kernel/locking/lockdep.c:5005
lock_acquire kernel/locking/lockdep.c:5754 [inline]
lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162
class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:518 [inline]
try_to_wake_up+0xb0/0x13d0 kernel/sched/core.c:4226
call_timer_fn+0x193/0x590 kernel/time/timer.c:1700
expire_timers kernel/time/timer.c:1751 [inline]
__run_timers+0x764/0xb20 kernel/time/timer.c:2022
run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035
__do_softirq+0x21a/0x8de kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644
sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1076
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:__orc_find+0xea/0x130 arch/x86/kernel/unwind_orc.c:109
Code: 6c 81 4d 00 4d 39 ec 73 95 e8 52 86 4d 00 49 8d 6f fc e8 49 86 4d 00 48 39 dd 73 99 e8 3f 86 4d 00 48 8b 44 24 10 4c 8b 2c 24 <48> 8b 74 24 08 49 29 c5 49 c1 fd 02 4b 8d 44 6d 00 48 8d 1c 46 e8
RSP: 0018:ffffc90004f0ed18 EFLAGS: 00000293
RAX: ffffffff8f422384 RBX: ffffffff8f4223ac RCX: ffffffff8139ebf4
RDX: ffff88801ebb0000 RSI: ffffffff8139ec11 RDI: 0000000000000006
RBP: ffffffff8f4223a8 R08: 0000000000000006 R09: ffffffff833aaeee
R10: ffffffff833aae6b R11: 0000000000000006 R12: ffffffff833aaeee
R13: ffffffff8f4223a8 R14: dffffc0000000000 R15: ffffffff8f4223a8
orc_find arch/x86/kernel/unwind_orc.c:227 [inline]
unwind_next_frame+0x329/0x2390 arch/x86/kernel/unwind_orc.c:494
arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x96/0xd0 kernel/stacktrace.c:122
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
__kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:763 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
slab_alloc mm/slub.c:3486 [inline]
__kmem_cache_alloc_lru mm/slub.c:3493 [inline]
kmem_cache_alloc+0x15d/0x2f0 mm/slub.c:3502
nilfs_btree_alloc_path+0x3b/0x180 fs/nilfs2/btree.c:28
nilfs_btree_lookup_contig+0xeb/0xb60 fs/nilfs2/btree.c:715
nilfs_bmap_lookup_contig+0x87/0x180 fs/nilfs2/bmap.c:100
nilfs_get_block+0x1f0/0xaa0 fs/nilfs2/inode.c:85
__block_write_begin_int+0x3c0/0x1560 fs/buffer.c:2119
__block_write_begin fs/buffer.c:2168 [inline]
block_write_begin+0xb1/0x490 fs/buffer.c:2227
nilfs_write_begin+0x9f/0x1a0 fs/nilfs2/inode.c:261
generic_perform_write+0x278/0x600 mm/filemap.c:3927
__generic_file_write_iter+0x1f9/0x240 mm/filemap.c:4022
generic_file_write_iter+0xe3/0x350 mm/filemap.c:4048
call_write_iter include/linux/fs.h:2020 [inline]
do_iter_readv_writev+0x21e/0x3c0 fs/read_write.c:735
do_iter_write+0x17f/0x7f0 fs/read_write.c:860
vfs_iter_write+0x7a/0xb0 fs/read_write.c:901
iter_file_splice_write+0x698/0xc00 fs/splice.c:736
do_splice_from fs/splice.c:933 [inline]
direct_splice_actor+0x118/0x180 fs/splice.c:1142
splice_direct_to_actor+0x347/0xa30 fs/splice.c:1088
do_splice_direct+0x1af/0x280 fs/splice.c:1194
do_sendfile+0xb3e/0x1310 fs/read_write.c:1254
__do_sys_sendfile64 fs/read_write.c:1322 [inline]
__se_sys_sendfile64 fs/read_write.c:1308 [inline]
__x64_sys_sendfile64+0x1d6/0x220 fs/read_write.c:1308
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f30bcd4cba9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 01 1a 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffd2dd3378 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f30bcd4cba9
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 00007f30bcd970a0 R08: 00007fffd2dd33b0 R09: 00007fffd2dd33b0
R10: 0001000000201005 R11: 0000000000000246 R12: 00007fffd2dd339c
R13: 0000000000000022 R14: 431bde82d7b634db R15: 00007fffd2dd33d0
Allocated by task 2:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
__kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:763 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
kmem_cache_alloc_node+0x180/0x330 mm/slub.c:3523
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct kernel/fork.c:1110 [inline]
copy_process+0x41c/0x73f0 kernel/fork.c:2332
kernel_clone+0xfd/0x930 kernel/fork.c:2907
kernel_thread+0xc0/0x100 kernel/fork.c:2969
create_kthread kernel/kthread.c:411 [inline]
kthreadd+0x4fb/0x7d0 kernel/kthread.c:764
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Freed by task 5071:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
kmem_cache_free+0xf8/0x350 mm/slub.c:3831
put_task_struct include/linux/sched/task.h:136 [inline]
put_task_struct include/linux/sched/task.h:123 [inline]
delayed_put_task_struct+0x21b/0x2c0 kernel/exit.c:227
rcu_do_batch kernel/rcu/tree.c:2158 [inline]
rcu_core+0x819/0x1680 kernel/rcu/tree.c:2431
__do_softirq+0x21a/0x8de kernel/softirq.c:553
Last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492
__call_rcu_common.constprop.0+0x9a/0x7a0 kernel/rcu/tree.c:2681
put_task_struct_rcu_user kernel/exit.c:233 [inline]
put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:230
context_switch kernel/sched/core.c:5379 [inline]
__schedule+0xee3/0x5af0 kernel/sched/core.c:6688
__schedule_loop kernel/sched/core.c:6763 [inline]
schedule+0xe9/0x270 kernel/sched/core.c:6778
nilfs_segctor_kill_thread fs/nilfs2/segment.c:2678 [inline]
nilfs_segctor_destroy fs/nilfs2/segment.c:2760 [inline]
nilfs_detach_log_writer+0x2f8/0xa90 fs/nilfs2/segment.c:2849
nilfs_put_super+0x43/0x1b0 fs/nilfs2/super.c:499
generic_shutdown_super+0x161/0x3d0 fs/super.c:696
kill_block_super+0x3b/0x90 fs/super.c:1667
deactivate_locked_super+0xbc/0x1a0 fs/super.c:484
deactivate_super+0xde/0x100 fs/super.c:517
cleanup_mnt+0x222/0x450 fs/namespace.c:1256
task_work_run+0x14d/0x240 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x217/0x240 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x1e/0x60 kernel/entry/common.c:296
do_syscall_64+0x4d/0x110 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Second to last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492
__call_rcu_common.constprop.0+0x9a/0x7a0 kernel/rcu/tree.c:2681
put_task_struct_rcu_user kernel/exit.c:233 [inline]
put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:230
release_task+0xe7d/0x1b10 kernel/exit.c:283
wait_task_zombie kernel/exit.c:1184 [inline]
wait_consider_task+0x17c4/0x40a0 kernel/exit.c:1411
do_wait_pid kernel/exit.c:1550 [inline]
__do_wait+0x746/0x890 kernel/exit.c:1585
do_wait+0x212/0x530 kernel/exit.c:1626
kernel_wait4+0x16d/0x280 kernel/exit.c:1785
__do_sys_wait4+0x15b/0x170 kernel/exit.c:1813
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
The buggy address belongs to the object at ffff88801df31dc0
which belongs to the cache task_struct of size 7360
The buggy address is located 2552 bytes inside of
freed 7360-byte region [ffff88801df31dc0, ffff88801df33a80)
The buggy address belongs to the physical page:
page:ffffea000077cc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801df30000 pfn:0x1df30
head:ffffea000077cc00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
ksm flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015251500 ffffea0000746c00 dead000000000003
raw: ffff88801df30000 0000000080040002 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 48, tgid 48 (kworker/u4:3), ts 6303268184, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1537
prep_new_page mm/page_alloc.c:1544 [inline]
get_page_from_freelist+0xa25/0x36d0 mm/page_alloc.c:3312
__alloc_pages+0x22e/0x2420 mm/page_alloc.c:4568
alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133
alloc_slab_page mm/slub.c:1870 [inline]
allocate_slab mm/slub.c:2017 [inline]
new_slab+0x283/0x3c0 mm/slub.c:2070
___slab_alloc+0x979/0x1500 mm/slub.c:3223
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
kmem_cache_alloc_node+0x132/0x330 mm/slub.c:3523
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct kernel/fork.c:1110 [inline]
copy_process+0x41c/0x73f0 kernel/fork.c:2332
kernel_clone+0xfd/0x930 kernel/fork.c:2907
user_mode_thread+0xb4/0xf0 kernel/fork.c:2985
call_usermodehelper_exec_work kernel/umh.c:172 [inline]
call_usermodehelper_exec_work+0xcb/0x170 kernel/umh.c:158
process_one_work+0x886/0x15d0 kernel/workqueue.c:2627
process_scheduled_works kernel/workqueue.c:2700 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2781
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
page_owner free stack trace missing
Memory state around the buggy address:
ffff88801df32680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801df32700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801df32780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801df32800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801df32880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 6c insb (%dx),%es:(%rdi)
1: 81 4d 00 4d 39 ec 73 orl $0x73ec394d,0x0(%rbp)
8: 95 xchg %eax,%ebp
9: e8 52 86 4d 00 call 0x4d8660
e: 49 8d 6f fc lea -0x4(%r15),%rbp
12: e8 49 86 4d 00 call 0x4d8660
17: 48 39 dd cmp %rbx,%rbp
1a: 73 99 jae 0xffffffb5
1c: e8 3f 86 4d 00 call 0x4d8660
21: 48 8b 44 24 10 mov 0x10(%rsp),%rax
26: 4c 8b 2c 24 mov (%rsp),%r13
* 2a: 48 8b 74 24 08 mov 0x8(%rsp),%rsi <-- trapping instruction
2f: 49 29 c5 sub %rax,%r13
32: 49 c1 fd 02 sar $0x2,%r13
36: 4b 8d 44 6d 00 lea 0x0(%r13,%r13,2),%rax
3b: 48 8d 1c 46 lea (%rsi,%rax,2),%rbx
3f: e8 .byte 0xe8