BUG: spinlock recursion on CPU#1, syz.4.24/5401 ================================================================== BUG: KASAN: stack-out-of-bounds in vsnprintf+0x10ec/0x1da0 lib/vsprintf.c:2824 Read of size 8 at addr ffffc90004a3e4f8 by task syz.4.24/5401 CPU: 1 UID: 0 PID: 5401 Comm: syz.4.24 Not tainted 6.11.0-rc4-next-20240822-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 vsnprintf+0x10ec/0x1da0 lib/vsprintf.c:2824 vprintk_store+0x480/0x1160 kernel/printk/printk.c:2255 vprintk_emit+0x39b/0xa10 kernel/printk/printk.c:2378 _printk+0xd5/0x120 kernel/printk/printk.c:2424 panic+0x2e0/0x880 kernel/panic.c:348 __stack_chk_fail+0x15/0x20 kernel/panic.c:836 search_extable+0xf6/0x100 search_kernel_exception_table kernel/extable.c:49 [inline] search_exception_tables+0x3a/0x60 kernel/extable.c:58 The buggy address belongs to stack of task syz.4.24/5401 and is located at offset 248 in frame: vprintk_emit+0x0/0xa10 This frame has 3 objects: [32, 40) 'flags.i.i.i148.i' [64, 72) 'flags.i.i.i147.i' [96, 104) 'flags.i.i.i.i' The buggy address belongs to the virtual mapping at [ffffc90004a38000, ffffc90004a41000) created by: copy_process+0x5d1/0x3d50 kernel/fork.c:2203 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807b0d51b0 pfn:0x7b0d5 memcg:ffff88802dd2e182 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: ffff88807b0d51b0 0000000000000000 00000001ffffffff ffff88802dd2e182 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 5372, tgid 5372 (syz.3.16), ts 88886915827, free_ts 88885434496 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1517 prep_new_page mm/page_alloc.c:1525 [inline] get_page_from_freelist+0x3131/0x3280 mm/page_alloc.c:3476 __alloc_pages_noprof+0x29e/0x780 mm/page_alloc.c:4743 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 vm_area_alloc_pages mm/vmalloc.c:3600 [inline] __vmalloc_area_node mm/vmalloc.c:3669 [inline] __vmalloc_node_range_noprof+0xa40/0x1400 mm/vmalloc.c:3850 alloc_thread_stack_node kernel/fork.c:314 [inline] dup_task_struct+0x444/0x8c0 kernel/fork.c:1115 copy_process+0x5d1/0x3d50 kernel/fork.c:2203 kernel_clone+0x226/0x8f0 kernel/fork.c:2784 __do_sys_clone3 kernel/fork.c:3088 [inline] __se_sys_clone3+0x2cb/0x350 kernel/fork.c:3067 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 4683 tgid 4683 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1098 [inline] free_unref_page+0xc07/0xd90 mm/page_alloc.c:2651 discard_slab mm/slub.c:2630 [inline] __put_partials+0xeb/0x130 mm/slub.c:3098 put_cpu_partial+0x17c/0x250 mm/slub.c:3173 __slab_free+0x2ea/0x3d0 mm/slub.c:4391 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4036 [inline] slab_alloc_node mm/slub.c:4085 [inline] __do_kmalloc_node mm/slub.c:4205 [inline] __kmalloc_noprof+0x1a6/0x400 mm/slub.c:4218 kmalloc_noprof include/linux/slab.h:685 [inline] tomoyo_realpath_from_path+0xcf/0x5e0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x2b7/0x740 security/tomoyo/file.c:822 security_inode_getattr+0x130/0x330 security/security.c:2400 vfs_getattr+0x45/0x430 fs/stat.c:242 vfs_fstat fs/stat.c:267 [inline] vfs_fstatat+0xe4/0x190 fs/stat.c:376 __do_sys_newfstatat fs/stat.c:543 [inline] __se_sys_newfstatat fs/stat.c:537 [inline] __x64_sys_newfstatat+0x11d/0x1a0 fs/stat.c:537 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffffc90004a3e380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90004a3e400: f1 f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 00 f3 f3 f3 >ffffc90004a3e480: 00 f2 f2 f2 00 00 00 f2 f2 f2 f2 f2 04 f3 f3 f3 ^ ffffc90004a3e500: 00 00 00 00 f1 f1 f1 f1 00 00 00 f3 f3 f3 f3 f3 ffffc90004a3e580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================