================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x114/0x7680 kernel/locking/lockdep.c:4919 Read of size 8 at addr ffff0000cebe2570 by task swapper/0/0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.1.90-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x174/0x4c0 mm/kasan/report.c:395 kasan_report+0xd4/0x130 mm/kasan/report.c:495 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351 __lock_acquire+0x114/0x7680 kernel/locking/lockdep.c:4919 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x6c/0xb4 kernel/locking/spinlock.c:162 try_to_wake_up+0xb4/0xe60 kernel/sched/core.c:4112 wake_up_process+0x18/0x24 kernel/sched/core.c:4362 nilfs_construction_timeout+0x40/0x50 fs/nilfs2/segment.c:2444 call_timer_fn+0x1c0/0xa1c kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x554/0x718 kernel/time/timer.c:1820 run_timer_softirq+0x7c/0x114 kernel/time/timer.c:1833 __do_softirq+0x314/0xe38 kernel/softirq.c:571 ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:893 do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:85 invoke_softirq kernel/softirq.c:452 [inline] __irq_exit_rcu+0x264/0x4d4 kernel/softirq.c:650 irq_exit_rcu+0x14/0x84 kernel/softirq.c:662 __el1_irq arch/arm64/kernel/entry-common.c:472 [inline] el1_interrupt+0x38/0x68 arch/arm64/kernel/entry-common.c:486 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:491 el1h_64_irq+0x64/0x68 arch/arm64/kernel/entry.S:581 arch_local_irq_enable+0xc/0x18 arch/arm64/include/asm/irqflags.h:35 default_idle_call+0x68/0xdc kernel/sched/idle.c:109 cpuidle_idle_call kernel/sched/idle.c:191 [inline] do_idle+0x1e0/0x514 kernel/sched/idle.c:303 cpu_startup_entry+0x5c/0x74 kernel/sched/idle.c:401 rest_init+0x2d8/0x2f0 init/main.c:734 start_kernel+0x0/0x608 init/main.c:894 start_kernel+0x448/0x608 init/main.c:1141 __primary_switched+0xb8/0xc0 arch/arm64/kernel/head.S:468 Allocated by task 2: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x74/0x458 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] kmem_cache_alloc_node+0x258/0x3b4 mm/slub.c:3443 alloc_task_struct_node kernel/fork.c:171 [inline] dup_task_struct+0x74/0x7dc kernel/fork.c:980 copy_process+0x530/0x38d0 kernel/fork.c:2098 kernel_clone+0x1d8/0x98c kernel/fork.c:2682 kernel_thread+0x128/0x1a8 kernel/fork.c:2742 create_kthread kernel/kthread.c:399 [inline] kthreadd+0x49c/0x674 kernel/kthread.c:746 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 Freed by task 7: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] kmem_cache_free+0x2f0/0x588 mm/slub.c:3683 free_task_struct kernel/fork.c:176 [inline] free_task+0xe8/0x14c kernel/fork.c:563 __put_task_struct+0x178/0x210 kernel/fork.c:851 put_task_struct include/linux/sched/task.h:145 [inline] delayed_put_task_struct+0x140/0x404 kernel/exit.c:225 rcu_do_batch kernel/rcu/tree.c:2296 [inline] rcu_core+0x878/0x1c24 kernel/rcu/tree.c:2556 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2573 __do_softirq+0x314/0xe38 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496 call_rcu+0xfc/0xa40 kernel/rcu/tree.c:2844 put_task_struct_rcu_user+0x68/0xcc kernel/exit.c:231 finish_task_switch+0x5c4/0x624 kernel/sched/core.c:5158 context_switch kernel/sched/core.c:5248 [inline] __schedule+0xee8/0x1c98 kernel/sched/core.c:6558 preempt_schedule_irq+0x8c/0x1b8 kernel/sched/core.c:6870 arm64_preempt_schedule_irq arch/arm64/kernel/entry-common.c:265 [inline] __el1_irq arch/arm64/kernel/entry-common.c:474 [inline] el1_interrupt+0x4c/0x68 arch/arm64/kernel/entry-common.c:486 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:491 el1h_64_irq+0x64/0x68 arch/arm64/kernel/entry.S:581 debug_print_object lib/debugobjects.c:519 [inline] debug_object_active_state+0x2b8/0x378 lib/debugobjects.c:943 debug_rcu_head_queue kernel/rcu/rcu.h:190 [inline] call_rcu+0x68/0xa40 kernel/rcu/tree.c:2829 ma_free_rcu lib/maple_tree.c:182 [inline] mas_free lib/maple_tree.c:1341 [inline] mas_mat_free lib/maple_tree.c:1021 [inline] mas_wmb_replace+0xac4/0xfb0 lib/maple_tree.c:2819 mas_split lib/maple_tree.c:3606 [inline] mas_commit_b_node lib/maple_tree.c:3657 [inline] mas_wr_bnode lib/maple_tree.c:4382 [inline] mas_wr_modify+0x2978/0x3e64 lib/maple_tree.c:4425 mas_wr_store_entry+0x6d0/0xa8c lib/maple_tree.c:4462 mas_store_prealloc+0x280/0x3ac lib/maple_tree.c:5787 vma_mas_store+0x19c/0x490 mm/mmap.c:434 __vma_adjust+0x1108/0x1774 mm/mmap.c:824 __split_vma+0x330/0x4b4 split_vma+0xa0/0xf8 mm/mmap.c:2414 mprotect_fixup+0x400/0x624 mm/mprotect.c:623 do_mprotect_pkey mm/mprotect.c:792 [inline] __do_sys_mprotect mm/mprotect.c:819 [inline] __se_sys_mprotect mm/mprotect.c:816 [inline] __arm64_sys_mprotect+0x764/0xc24 mm/mprotect.c:816 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 Second to last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496 call_rcu+0xfc/0xa40 kernel/rcu/tree.c:2844 put_task_struct_rcu_user+0x68/0xcc kernel/exit.c:231 finish_task_switch+0x5c4/0x624 kernel/sched/core.c:5158 context_switch kernel/sched/core.c:5248 [inline] __schedule+0xee8/0x1c98 kernel/sched/core.c:6558 preempt_schedule_common+0xf4/0x1e8 kernel/sched/core.c:6727 preempt_schedule+0x64/0x84 kernel/sched/core.c:6751 try_to_wake_up+0x62c/0xe60 kernel/sched/core.c:4234 wake_up_process+0x18/0x24 kernel/sched/core.c:4362 kthread_stop+0x1d0/0x8c0 kernel/kthread.c:708 destroy_workqueue+0xec/0xa34 kernel/workqueue.c:4435 xfs_destroy_mount_workqueues+0x74/0xdc fs/xfs/xfs_super.c:585 xfs_fs_put_super+0x1e4/0x260 fs/xfs/xfs_super.c:1125 generic_shutdown_super+0x130/0x328 fs/super.c:501 kill_block_super+0x70/0xdc fs/super.c:1459 deactivate_locked_super+0xac/0x124 fs/super.c:332 deactivate_super+0xf0/0x110 fs/super.c:363 cleanup_mnt+0x394/0x41c fs/namespace.c:1186 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193 task_work_run+0x240/0x2f0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2148/0x3474 arch/arm64/kernel/signal.c:1132 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 The buggy address belongs to the object at ffff0000cebe1bc0 which belongs to the cache task_struct of size 6848 The buggy address is located 2480 bytes inside of 6848-byte region [ffff0000cebe1bc0, ffff0000cebe3680) The buggy address belongs to the physical page: page:000000005ba7c1e5 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000cebe0000 pfn:0x10ebe0 head:000000005ba7c1e5 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000d9442801 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 fffffc00031bb608 fffffc0003358808 ffff0000c03dcf00 raw: ffff0000cebe0000 0000000000040001 00000001ffffffff ffff0000d9442801 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000cebe2400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cebe2480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000cebe2500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000cebe2580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cebe2600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================