================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x4208/0x5de0 kernel/locking/lockdep.c:5012 Read of size 8 at addr ffff888029196bc0 by task syz-executor300/5160 CPU: 1 PID: 5160 Comm: syz-executor300 Not tainted 6.5.0-rc3-syzkaller-00283-g12214540ad87 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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+0x4208/0x5de0 kernel/locking/lockdep.c:5012 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 try_to_wake_up+0xab/0x15a0 kernel/sched/core.c:4229 call_timer_fn+0x1a0/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x764/0xb10 kernel/time/timer.c:2022 run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035 __do_softirq+0x218/0x965 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+0x93/0xc0 arch/x86/kernel/apic/apic.c:1109 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:console_trylock_spinning kernel/printk/printk.c:1972 [inline] RIP: 0010:vprintk_emit+0x3f6/0x640 kernel/printk/printk.c:2306 Code: 00 00 e8 dd 1d 1c 00 9c 8f 45 d0 48 8b 45 d0 31 ff 25 00 02 00 00 49 89 c6 48 89 c6 e8 53 19 1c 00 4d 85 f6 0f 85 fa 01 00 00 0f 1e fa e8 b1 1d 1c 00 45 31 c9 41 b8 01 00 00 00 31 c9 68 b6 RSP: 0018:ffffc9000381f7f8 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000037 RCX: 0000000000000000 RDX: ffff888029364180 RSI: ffffffff81696daa RDI: 0000000000000007 RBP: ffffc9000381f830 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 206b6361626c6c6f R12: 0000000000000200 R13: ffff8880244560c0 R14: 0000000000000001 R15: 0000000000000000 vprintk+0x89/0xa0 kernel/printk/printk_safe.c:50 _printk+0xc8/0x100 kernel/printk/printk.c:2328 __nilfs_msg+0x159/0x2c0 fs/nilfs2/super.c:78 load_nilfs+0xa38/0x12d0 fs/nilfs2/the_nilfs.c:265 nilfs_fill_super fs/nilfs2/super.c:1090 [inline] nilfs_mount+0xa8c/0x1120 fs/nilfs2/super.c:1343 legacy_get_tree+0x109/0x220 fs/fs_context.c:611 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f426494565a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007fffe15d0268 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f426494565a RDX: 0000000020000dc0 RSI: 0000000020000100 RDI: 00007fffe15d02b0 RBP: 0000000000000004 R08: 00007fffe15d02f0 R09: 0000000000000da0 R10: 0000000000010018 R11: 0000000000000286 R12: 00007fffe15d02b0 R13: 00007fffe15d02f0 R14: 0000000000200000 R15: 0000000000000003 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:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] kmem_cache_alloc_node+0x179/0x540 mm/slab.c:3509 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1105 [inline] copy_process+0x41c/0x7400 kernel/fork.c:2330 kernel_clone+0xfd/0x8f0 kernel/fork.c:2912 kernel_thread+0xc0/0x100 kernel/fork.c:2974 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4fc/0x7b0 kernel/kthread.c:747 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:296 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649 put_task_struct_rcu_user kernel/exit.c:232 [inline] put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:229 context_switch kernel/sched/core.c:5384 [inline] __schedule+0xee9/0x59f0 kernel/sched/core.c:6710 schedule+0xe7/0x1b0 kernel/sched/core.c:6786 nilfs_segctor_thread+0xb77/0xe90 fs/nilfs2/segment.c:2629 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:296 Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649 put_task_struct_rcu_user kernel/exit.c:232 [inline] put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:229 release_task+0xf0a/0x1b90 kernel/exit.c:282 wait_task_zombie kernel/exit.c:1210 [inline] wait_consider_task+0x17c9/0x3f70 kernel/exit.c:1437 do_wait_thread kernel/exit.c:1500 [inline] do_wait+0x72b/0xc70 kernel/exit.c:1617 kernel_wait4+0x16d/0x280 kernel/exit.c:1780 __do_sys_wait4+0x15b/0x170 kernel/exit.c:1808 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880291961c0 which belongs to the cache task_struct of size 7360 The buggy address is located 2560 bytes inside of freed 7360-byte region [ffff8880291961c0, ffff888029197e80) The buggy address belongs to the physical page: page:ffffea0000a46580 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x29196 head:ffffea0000a46580 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x1() raw: 00fff00000010200 ffff888140051500 ffffea0000a4d910 ffffea0000a64110 raw: 0000000000000000 ffff8880291961c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 4787, tgid 4787 (dhcpcd-run-hook), ts 37936572759, free_ts 37910020491 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] kmem_cache_alloc_node+0x487/0x540 mm/slab.c:3509 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1105 [inline] copy_process+0x41c/0x7400 kernel/fork.c:2330 kernel_clone+0xfd/0x8f0 kernel/fork.c:2912 __do_sys_clone+0xba/0x100 kernel/fork.c:3055 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 slab_destroy mm/slab.c:1608 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1628 cache_flusharray mm/slab.c:3341 [inline] ___cache_free+0x2b6/0x420 mm/slab.c:3404 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x4c/0x1b0 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc+0x15e/0x400 mm/slab.c:3432 getname_flags.part.0+0x50/0x4d0 fs/namei.c:140 getname_flags+0x9c/0xf0 include/linux/audit.h:319 vfs_fstatat+0x77/0xb0 fs/stat.c:275 __do_sys_newfstatat+0x98/0x110 fs/stat.c:446 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888029196a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888029196b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888029196b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888029196c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888029196c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: e8 dd 1d 1c 00 call 0x1c1de4 7: 9c pushf 8: 8f 45 d0 pop -0x30(%rbp) b: 48 8b 45 d0 mov -0x30(%rbp),%rax f: 31 ff xor %edi,%edi 11: 25 00 02 00 00 and $0x200,%eax 16: 49 89 c6 mov %rax,%r14 19: 48 89 c6 mov %rax,%rsi 1c: e8 53 19 1c 00 call 0x1c1974 21: 4d 85 f6 test %r14,%r14 24: 0f 85 fa 01 00 00 jne 0x224 * 2a: f3 0f 1e fa endbr64 <-- trapping instruction 2e: e8 b1 1d 1c 00 call 0x1c1de4 33: 45 31 c9 xor %r9d,%r9d 36: 41 b8 01 00 00 00 mov $0x1,%r8d 3c: 31 c9 xor %ecx,%ecx 3e: 68 .byte 0x68 3f: b6 .byte 0xb6