==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x77/0x2070 kernel/locking/lockdep.c:4956
Read of size 8 at addr ffff888027bd0a00 by task syz-executor886/7382
CPU: 0 PID: 7382 Comm: syz-executor886 Not tainted 6.4.0-rc5-syzkaller-00245-g64569520920a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/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:351 [inline]
print_report+0x163/0x540 mm/kasan/report.c:462
kasan_report+0x176/0x1b0 mm/kasan/report.c:572
__lock_acquire+0x77/0x2070 kernel/locking/lockdep.c:4956
lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
try_to_wake_up+0xb2/0x1230 kernel/sched/core.c:4191
call_timer_fn+0x178/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:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x159/0x240 kernel/softirq.c:650
irq_exit_rcu+0x9/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:console_flush_all+0x8a7/0xd70
Code: cd f9 ff ff e8 7a b3 1c 00 0f 0b e9 87 fa ff ff e8 6e b3 1c 00 e8 d9 d2 40 09 4d 85 f6 74 c6 e8 5f b3 1c 00 fb 4c 8b 74 24 68 <48> 8b 44 24 70 42 0f b6 04 20 84 c0 0f 85 16 02 00 00 48 8b 44 24
RSP: 0018:ffffc9000c47f3a0 EFLAGS: 00000293
RAX: ffffffff816ecc41 RBX: 0000000000000000 RCX: ffff88802d4d3b80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000c47f550 R08: ffffffff816ecbee R09: fffffbfff206544d
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 0000000000000001 R14: ffffffff8d655618 R15: ffffffff8d6555c0
console_unlock+0xff/0x270 kernel/printk/printk.c:3007
vprintk_emit+0xd5/0x1f0 kernel/printk/printk.c:2307
_printk+0xd5/0x120 kernel/printk/printk.c:2328
__nilfs_msg+0x34d/0x410 fs/nilfs2/super.c:78
load_nilfs+0x893/0x1050
nilfs_fill_super+0x2b5/0x600 fs/nilfs2/super.c:1069
nilfs_mount+0x67d/0x9a0 fs/nilfs2/super.c:1326
legacy_get_tree+0xef/0x190 fs/fs_context.c:610
vfs_get_tree+0x8c/0x270 fs/super.c:1510
do_new_mount+0x28f/0xae0 fs/namespace.c:3039
do_mount fs/namespace.c:3382 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f46c23e9eda
Code: 48 c7 c2 c0 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 a8 00 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdd889e678 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f46c23e9eda
RDX: 0000000020000dc0 RSI: 0000000020000100 RDI: 00007ffdd889e690
RBP: 00007ffdd889e690 R08: 00007ffdd889e6d0 R09: 0000000000000da0
R10: 0000000000010018 R11: 0000000000000286 R12: 0000000000000004
R13: 0000555556cac2c0 R14: 0000000000010018 R15: 00007ffdd889e6d0
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+0x66/0x70 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:186 [inline]
slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:711
slab_alloc_node mm/slub.c:3451 [inline]
kmem_cache_alloc_node+0x157/0x350 mm/slub.c:3496
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct+0x57/0x7d0 kernel/fork.c:1108
copy_process+0x5c8/0x4290 kernel/fork.c:2333
kernel_clone+0x222/0x800 kernel/fork.c:2915
kernel_thread+0x1bc/0x230 kernel/fork.c:2977
create_kthread kernel/kthread.c:402 [inline]
kthreadd+0x600/0x820 kernel/kthread.c:737
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
Last potentially related work creation:
kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491
__call_rcu_common kernel/rcu/tree.c:2627 [inline]
call_rcu+0x167/0xa70 kernel/rcu/tree.c:2741
context_switch kernel/sched/core.c:5346 [inline]
__schedule+0x1883/0x4900 kernel/sched/core.c:6669
schedule+0xc3/0x180 kernel/sched/core.c:6745
nilfs_segctor_kill_thread fs/nilfs2/segment.c:2667 [inline]
nilfs_segctor_destroy fs/nilfs2/segment.c:2749 [inline]
nilfs_detach_log_writer+0x2ea/0xbb0 fs/nilfs2/segment.c:2838
nilfs_put_super+0x4d/0x160 fs/nilfs2/super.c:477
generic_shutdown_super+0x134/0x340 fs/super.c:500
kill_block_super+0x84/0xf0 fs/super.c:1407
deactivate_locked_super+0xa4/0x110 fs/super.c:331
cleanup_mnt+0x426/0x4c0 fs/namespace.c:1177
task_work_run+0x24a/0x300 kernel/task_work.c:179
ptrace_notify+0x2cd/0x380 kernel/signal.c:2371
ptrace_report_syscall include/linux/ptrace.h:411 [inline]
ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline]
syscall_exit_work kernel/entry/common.c:252 [inline]
syscall_exit_to_user_mode_prepare kernel/entry/common.c:279 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:284 [inline]
syscall_exit_to_user_mode+0x157/0x280 kernel/entry/common.c:297
do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Second to last potentially related work creation:
kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491
__call_rcu_common kernel/rcu/tree.c:2627 [inline]
call_rcu+0x167/0xa70 kernel/rcu/tree.c:2741
put_task_struct_rcu_user kernel/exit.c:232 [inline]
release_task+0x15ad/0x16f0 kernel/exit.c:282
wait_task_zombie kernel/exit.c:1210 [inline]
wait_consider_task+0x1a43/0x2e20 kernel/exit.c:1437
do_wait_thread kernel/exit.c:1500 [inline]
do_wait+0x312/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/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
The buggy address belongs to the object at ffff888027bd0000
which belongs to the cache task_struct of size 7360
The buggy address is located 2560 bytes inside of
freed 7360-byte region [ffff888027bd0000, ffff888027bd1cc0)
The buggy address belongs to the physical page:
page:ffffea00009ef400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888027bd0000 pfn:0x27bd0
head:ffffea00009ef400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000010200 ffff888140007500 0000000000000000 dead000000000001
raw: ffff888027bd0000 0000000080040003 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 47, tgid 47 (kworker/u4:3), ts 9536795505, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1731
prep_new_page mm/page_alloc.c:1738 [inline]
get_page_from_freelist+0x321c/0x33a0 mm/page_alloc.c:3502
__alloc_pages+0x255/0x670 mm/page_alloc.c:4768
alloc_slab_page+0x6a/0x160 mm/slub.c:1851
allocate_slab mm/slub.c:1998 [inline]
new_slab+0x84/0x2f0 mm/slub.c:2051
___slab_alloc+0xa85/0x10a0 mm/slub.c:3192
__slab_alloc mm/slub.c:3291 [inline]
__slab_alloc_node mm/slub.c:3344 [inline]
slab_alloc_node mm/slub.c:3441 [inline]
kmem_cache_alloc_node+0x1f3/0x350 mm/slub.c:3496
alloc_task_struct_node kernel/fork.c:173 [inline]
dup_task_struct+0x57/0x7d0 kernel/fork.c:1108
copy_process+0x5c8/0x4290 kernel/fork.c:2333
kernel_clone+0x222/0x800 kernel/fork.c:2915
user_mode_thread+0x132/0x190 kernel/fork.c:2993
call_usermodehelper_exec_work+0x5c/0x220 kernel/umh.c:172
process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2405
worker_thread+0xa63/0x1210 kernel/workqueue.c:2552
kthread+0x2b8/0x350 kernel/kthread.c:379
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
page_owner free stack trace missing
Memory state around the buggy address:
ffff888027bd0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888027bd0980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888027bd0a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888027bd0a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888027bd0b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 4 bytes skipped:
0: e8 7a b3 1c 00 callq 0x1cb37f
5: 0f 0b ud2
7: e9 87 fa ff ff jmpq 0xfffffa93
c: e8 6e b3 1c 00 callq 0x1cb37f
11: e8 d9 d2 40 09 callq 0x940d2ef
16: 4d 85 f6 test %r14,%r14
19: 74 c6 je 0xffffffe1
1b: e8 5f b3 1c 00 callq 0x1cb37f
20: fb sti
21: 4c 8b 74 24 68 mov 0x68(%rsp),%r14
* 26: 48 8b 44 24 70 mov 0x70(%rsp),%rax <-- trapping instruction
2b: 42 0f b6 04 20 movzbl (%rax,%r12,1),%eax
30: 84 c0 test %al,%al
32: 0f 85 16 02 00 00 jne 0x24e
38: 48 rex.W
39: 8b .byte 0x8b
3a: 44 rex.R
3b: 24 .byte 0x24