================================================================== BUG: KASAN: stack-out-of-bounds in collapse_file+0x4edf/0x5830 mm/khugepaged.c:2038 Read of size 8 at addr ffffc90000ac7b50 by task khugepaged/35 CPU: 0 PID: 35 Comm: khugepaged Not tainted 6.1.0-rc5-next-20221116-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:253 [inline] print_report+0x15e/0x45d mm/kasan/report.c:364 kasan_report+0xbf/0x1f0 mm/kasan/report.c:464 collapse_file+0x4edf/0x5830 mm/khugepaged.c:2038 hpage_collapse_scan_file+0xdba/0x18e0 mm/khugepaged.c:2237 khugepaged_scan_mm_slot mm/khugepaged.c:2343 [inline] khugepaged_do_scan mm/khugepaged.c:2455 [inline] khugepaged+0x9e4/0x15a0 mm/khugepaged.c:2511 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to stack of task khugepaged/35 and is located at offset 120 in frame: collapse_file+0x0/0x5830 arch/x86/include/asm/bitops.h:207 This frame has 4 objects: [32, 40) 'hpage' [64, 72) 'folio' [96, 112) 'pagelist' [128, 184) 'xas' The buggy address belongs to the virtual mapping at [ffffc90000ac0000, ffffc90000ac9000) created by: kernel_clone+0xeb/0xa40 kernel/fork.c:2681 The buggy address belongs to the physical page: page:ffffea00005e1e80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1787a flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 2, tgid 2 (kthreadd), ts 1962461250, free_ts 0 prep_new_page mm/page_alloc.c:2561 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4310 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5569 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 vm_area_alloc_pages mm/vmalloc.c:2989 [inline] __vmalloc_area_node mm/vmalloc.c:3057 [inline] __vmalloc_node_range+0x975/0x13c0 mm/vmalloc.c:3227 alloc_thread_stack_node kernel/fork.c:311 [inline] dup_task_struct kernel/fork.c:987 [inline] copy_process+0x12d2/0x75c0 kernel/fork.c:2097 kernel_clone+0xeb/0xa40 kernel/fork.c:2681 kernel_thread+0xb9/0xf0 kernel/fork.c:2741 create_kthread kernel/kthread.c:399 [inline] kthreadd+0x4f2/0x750 kernel/kthread.c:746 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page_owner free stack trace missing Memory state around the buggy address: ffffc90000ac7a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90000ac7a80: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 >ffffc90000ac7b00: f2 f2 f2 00 f2 f2 f2 00 00 f2 f2 00 00 00 00 00 ^ ffffc90000ac7b80: 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 ffffc90000ac7c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 ==================================================================