================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x77/0x1fd0 kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff888020114578 by task syz-executor.1/5079 CPU: 1 PID: 5079 Comm: syz-executor.1 Not tainted 6.8.0-rc1-syzkaller-00286-g168174d78157 #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+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0x163/0x540 mm/kasan/report.c:488 kasan_report+0x142/0x170 mm/kasan/report.c:601 __lock_acquire+0x77/0x1fd0 kernel/locking/lockdep.c:5005 lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754 __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:553 [inline] try_to_wake_up+0xaf/0x1460 kernel/sched/core.c:4253 call_timer_fn+0x17a/0x5f0 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x621/0x830 kernel/time/timer.c:2038 run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2051 __do_softirq+0x2b8/0x939 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+0x97/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:lock_acquire+0x25a/0x530 kernel/locking/lockdep.c:5758 Code: 2b 00 74 08 4c 89 f7 e8 04 52 7e 00 f6 44 24 61 02 0f 85 8a 01 00 00 41 f7 c7 00 02 00 00 74 01 fb 48 c7 44 24 40 0e 36 e0 45 <4b> c7 44 25 00 00 00 00 00 43 c7 44 25 09 00 00 00 00 43 c7 44 25 RSP: 0018:ffffc9000443f180 EFLAGS: 00000206 RAX: 0000000000000001 RBX: 1ffff92000887e3c RCX: 0000000000000001 RDX: dffffc0000000000 RSI: ffffffff8b6ab760 RDI: ffffffff8bbe91e0 RBP: ffffc9000443f2d8 R08: ffffffff90df93e7 R09: 1ffffffff21bf27c R10: dffffc0000000000 R11: fffffbfff21bf27d R12: 1ffff92000887e38 R13: dffffc0000000000 R14: ffffc9000443f1e0 R15: 0000000000000246 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:373 pte_offset_map_lock include/linux/mm.h:2958 [inline] copy_pte_range mm/memory.c:1048 [inline] copy_pmd_range mm/memory.c:1187 [inline] copy_pud_range mm/memory.c:1224 [inline] copy_p4d_range mm/memory.c:1248 [inline] copy_page_range+0x1020/0x4240 mm/memory.c:1346 dup_mmap kernel/fork.c:745 [inline] dup_mm kernel/fork.c:1685 [inline] copy_mm+0x12f0/0x21b0 kernel/fork.c:1734 copy_process+0x1d6f/0x3fb0 kernel/fork.c:2497 kernel_clone+0x222/0x840 kernel/fork.c:2902 __do_sys_clone kernel/fork.c:3045 [inline] __se_sys_clone kernel/fork.c:3029 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:3029 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f17b2079dd3 Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 89 c2 85 c0 75 2c 64 48 8b 04 25 10 00 00 RSP: 002b:00007ffeeeb56e28 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f17b2079dd3 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 0000555557537750 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001 Allocated by task 2: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x70 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:314 [inline] __kasan_slab_alloc+0x66/0x70 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmem_cache_alloc_node+0x18f/0x380 mm/slub.c:3903 alloc_task_struct_node kernel/fork.c:174 [inline] dup_task_struct+0x57/0x7d0 kernel/fork.c:1104 copy_process+0x5d1/0x3fb0 kernel/fork.c:2327 kernel_clone+0x222/0x840 kernel/fork.c:2902 kernel_thread+0x1bc/0x230 kernel/fork.c:2964 create_kthread kernel/kthread.c:411 [inline] kthreadd+0x60c/0x810 kernel/kthread.c:764 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Freed by task 7600: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x70 mm/kasan/common.c:68 kasan_save_free_info+0x4e/0x60 mm/kasan/generic.c:640 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:241 __kasan_slab_free+0x34/0x60 mm/kasan/common.c:257 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kmem_cache_free+0x102/0x2a0 mm/slub.c:4363 put_task_struct include/linux/sched/task.h:138 [inline] delayed_put_task_struct+0x115/0x2c0 kernel/exit.c:229 rcu_do_batch kernel/rcu/tree.c:2190 [inline] rcu_core+0xad8/0x17c0 kernel/rcu/tree.c:2465 __do_softirq+0x2b8/0x939 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xae/0x100 mm/kasan/generic.c:586 __call_rcu_common kernel/rcu/tree.c:2715 [inline] call_rcu+0x167/0xa80 kernel/rcu/tree.c:2829 context_switch kernel/sched/core.c:5403 [inline] __schedule+0x1787/0x4960 kernel/sched/core.c:6727 __schedule_loop kernel/sched/core.c:6802 [inline] schedule+0x149/0x260 kernel/sched/core.c:6817 io_schedule+0x8c/0x100 kernel/sched/core.c:9023 bit_wait_io+0x12/0xc0 kernel/sched/wait_bit.c:209 __wait_on_bit+0xac/0x2e0 kernel/sched/wait_bit.c:49 out_of_line_wait_on_bit+0x1d4/0x250 kernel/sched/wait_bit.c:64 wait_on_buffer include/linux/buffer_head.h:389 [inline] nilfs_mdt_read_block+0x2c5/0x430 fs/nilfs2/mdt.c:198 nilfs_mdt_get_block+0x130/0xc70 fs/nilfs2/mdt.c:251 nilfs_cpfile_get_header_block fs/nilfs2/cpfile.c:131 [inline] nilfs_cpfile_get_checkpoint+0x1f7/0xcc0 fs/nilfs2/cpfile.c:232 nilfs_attach_checkpoint+0x1e4/0x4d0 fs/nilfs2/super.c:560 nilfs_fill_super+0x321/0x600 fs/nilfs2/super.c:1096 nilfs_mount+0x6f8/0x950 fs/nilfs2/super.c:1319 legacy_get_tree+0xef/0x190 fs/fs_context.c:662 vfs_get_tree+0x8c/0x2a0 fs/super.c:1784 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff888020113b80 which belongs to the cache task_struct of size 7360 The buggy address is located 2552 bytes inside of freed 7360-byte region [ffff888020113b80, ffff888020115840) The buggy address belongs to the physical page: page:ffffea0000804400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20110 head:ffffea0000804400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88807b2bea01 anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff8880146a1500 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff88807b2bea01 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 2, tgid 2 (kthreadd), ts 7330904802, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3311 __alloc_pages+0x255/0x680 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2190 allocate_slab mm/slub.c:2354 [inline] new_slab+0x84/0x2f0 mm/slub.c:2407 ___slab_alloc+0xd17/0x13d0 mm/slub.c:3540 __slab_alloc mm/slub.c:3625 [inline] __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] kmem_cache_alloc_node+0x241/0x380 mm/slub.c:3903 alloc_task_struct_node kernel/fork.c:174 [inline] dup_task_struct+0x57/0x7d0 kernel/fork.c:1104 copy_process+0x5d1/0x3fb0 kernel/fork.c:2327 kernel_clone+0x222/0x840 kernel/fork.c:2902 kernel_thread+0x1bc/0x230 kernel/fork.c:2964 create_kthread kernel/kthread.c:411 [inline] kthreadd+0x60c/0x810 kernel/kthread.c:764 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 page_owner free stack trace missing Memory state around the buggy address: ffff888020114400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020114480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020114500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020114580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020114600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 2b 00 sub (%rax),%eax 2: 74 08 je 0xc 4: 4c 89 f7 mov %r14,%rdi 7: e8 04 52 7e 00 call 0x7e5210 c: f6 44 24 61 02 testb $0x2,0x61(%rsp) 11: 0f 85 8a 01 00 00 jne 0x1a1 17: 41 f7 c7 00 02 00 00 test $0x200,%r15d 1e: 74 01 je 0x21 20: fb sti 21: 48 c7 44 24 40 0e 36 movq $0x45e0360e,0x40(%rsp) 28: e0 45 * 2a: 4b c7 44 25 00 00 00 movq $0x0,0x0(%r13,%r12,1) <-- trapping instruction 31: 00 00 33: 43 c7 44 25 09 00 00 movl $0x0,0x9(%r13,%r12,1) 3a: 00 00 3c: 43 rex.XB 3d: c7 .byte 0xc7 3e: 44 rex.R 3f: 25 .byte 0x25