================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x114/0x763c kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff0000cf88c628 by task syz-executor.1/6606 CPU: 1 PID: 6606 Comm: syz-executor.1 Not tainted 6.9.0-rc7-syzkaller-gfda5695d692c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 __lock_acquire+0x114/0x763c kernel/locking/lockdep.c:5005 lock_acquire+0x248/0x73c kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x5c/0x7c kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline] try_to_wake_up+0xb0/0xf2c kernel/sched/core.c:4262 wake_up_process+0x18/0x24 kernel/sched/core.c:4510 nilfs_construction_timeout+0x40/0x50 fs/nilfs2/segment.c:2409 call_timer_fn+0x1b4/0x93c kernel/time/timer.c:1793 expire_timers kernel/time/timer.c:1844 [inline] __run_timers kernel/time/timer.c:2418 [inline] __run_timer_base+0x56c/0x7b4 kernel/time/timer.c:2429 run_timer_base kernel/time/timer.c:2438 [inline] run_timer_softirq+0xcc/0x194 kernel/time/timer.c:2448 handle_softirqs+0x2ec/0xc34 kernel/softirq.c:554 __do_softirq+0x14/0x20 kernel/softirq.c:588 ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:81 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:889 do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:86 invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0x1d8/0x434 kernel/softirq.c:637 irq_exit_rcu+0x14/0x84 kernel/softirq.c:649 __el1_irq arch/arm64/kernel/entry-common.c:537 [inline] el1_interrupt+0x38/0x68 arch/arm64/kernel/entry-common.c:551 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:556 el1h_64_irq+0x64/0x68 arch/arm64/kernel/entry.S:594 __daif_local_irq_restore arch/arm64/include/asm/irqflags.h:175 [inline] arch_local_irq_restore arch/arm64/include/asm/irqflags.h:195 [inline] queue_work_on+0xd4/0x128 kernel/workqueue.c:2452 queue_work include/linux/workqueue.h:605 [inline] hci_cmd_sync_submit+0x200/0x230 net/bluetooth/hci_sync.c:660 hci_cmd_sync_queue+0x84/0x9c net/bluetooth/hci_sync.c:681 set_connectable+0x524/0x7b0 net/bluetooth/mgmt.c:1800 hci_mgmt_cmd+0x97c/0xe60 net/bluetooth/hci_sock.c:1715 hci_sock_sendmsg+0x58c/0xd08 net/bluetooth/hci_sock.c:1835 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x2d8/0x448 net/socket.c:1160 call_write_iter include/linux/fs.h:2110 [inline] new_sync_write fs/read_write.c:497 [inline] vfs_write+0x968/0xc3c fs/read_write.c:590 ksys_write+0x15c/0x26c fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:652 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Allocated by task 2: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc_node+0x224/0x418 mm/slub.c:3888 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct+0x74/0x908 kernel/fork.c:1107 copy_process+0x490/0x3280 kernel/fork.c:2220 kernel_clone+0x1d8/0x838 kernel/fork.c:2797 kernel_thread+0x184/0x200 kernel/fork.c:2859 create_kthread kernel/kthread.c:411 [inline] kthreadd+0x464/0x670 kernel/kthread.c:764 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Freed by task 6263: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:579 poison_slab_object+0x124/0x18c mm/kasan/common.c:240 __kasan_slab_free+0x3c/0x70 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kmem_cache_free+0x168/0x3f0 mm/slub.c:4344 free_task_struct kernel/fork.c:181 [inline] free_task+0xe8/0x14c kernel/fork.c:609 __put_task_struct+0x178/0x210 kernel/fork.c:982 put_task_struct+0x88/0x10c include/linux/sched/task.h:138 delayed_put_task_struct+0xf4/0x304 kernel/exit.c:229 rcu_do_batch kernel/rcu/tree.c:2196 [inline] rcu_core+0x888/0x1b3c kernel/rcu/tree.c:2471 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2488 handle_softirqs+0x2ec/0xc34 kernel/softirq.c:554 __do_softirq+0x14/0x20 kernel/softirq.c:588 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:47 __kasan_record_aux_stack+0xd0/0xec mm/kasan/generic.c:541 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:551 __call_rcu_common kernel/rcu/tree.c:2734 [inline] call_rcu+0x104/0xb08 kernel/rcu/tree.c:2838 put_task_struct_rcu_user+0x70/0xd8 kernel/exit.c:235 finish_task_switch+0x5b4/0x614 kernel/sched/core.c:5318 context_switch kernel/sched/core.c:5412 [inline] __schedule+0x14bc/0x24e8 kernel/sched/core.c:6746 __schedule_loop kernel/sched/core.c:6823 [inline] schedule+0xbc/0x238 kernel/sched/core.c:6838 nilfs_segctor_kill_thread fs/nilfs2/segment.c:2645 [inline] nilfs_segctor_destroy fs/nilfs2/segment.c:2727 [inline] nilfs_detach_log_writer+0x280/0xa48 fs/nilfs2/segment.c:2816 nilfs_put_super+0x4c/0x130 fs/nilfs2/super.c:499 generic_shutdown_super+0x128/0x2b8 fs/super.c:641 kill_block_super+0x44/0x90 fs/super.c:1675 deactivate_locked_super+0xc4/0x12c fs/super.c:472 deactivate_super+0xe0/0x100 fs/super.c:505 cleanup_mnt+0x34c/0x3dc fs/namespace.c:1267 __cleanup_mnt+0x20/0x30 fs/namespace.c:1274 task_work_run+0x230/0x2e0 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] do_notify_resume+0x178/0x1f4 arch/arm64/kernel/entry-common.c:151 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:169 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:178 [inline] el0_svc+0xac/0x168 arch/arm64/kernel/entry-common.c:713 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The buggy address belongs to the object at ffff0000cf88bc80 which belongs to the cache task_struct of size 7488 The buggy address is located 2472 bytes inside of freed 7488-byte region [ffff0000cf88bc80, ffff0000cf88d9c0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10f888 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff0000d9324381 anon flags: 0x5ffc00000000840(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000840 ffff0000c1883500 0000000000000000 0000000000000001 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff0000d9324381 head: 05ffc00000000840 ffff0000c1883500 0000000000000000 0000000000000001 head: 0000000000000000 0000000000040004 00000001ffffffff ffff0000d9324381 head: 05ffc00000000003 fffffdffc33e2201 dead000000000122 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000cf88c500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cf88c580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000cf88c600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000cf88c680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cf88c700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================