================================================================== BUG: KASAN: use-after-free in __rb_map_vma+0x9ab/0xae0 kernel/trace/ring_buffer.c:7058 Read of size 8 at addr ffff888033f146b8 by task syz.2.234/6701 CPU: 1 UID: 0 PID: 6701 Comm: syz.2.234 Not tainted 6.13.0-rc2-syzkaller-00031-gf92f4749861b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 __rb_map_vma+0x9ab/0xae0 kernel/trace/ring_buffer.c:7058 ring_buffer_map+0x56e/0x9b0 kernel/trace/ring_buffer.c:7138 tracing_buffers_mmap+0xa6/0x120 kernel/trace/trace.c:8482 call_mmap include/linux/fs.h:2183 [inline] mmap_file mm/internal.h:124 [inline] __mmap_new_file_vma mm/vma.c:2291 [inline] __mmap_new_vma mm/vma.c:2355 [inline] __mmap_region+0x1786/0x2670 mm/vma.c:2456 mmap_region+0x127/0x320 mm/mmap.c:1348 do_mmap+0xc00/0xfc0 mm/mmap.c:496 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:580 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:542 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8030785d19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f80315d0038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f8030975fa0 RCX: 00007f8030785d19 RDX: 0000000000000009 RSI: 0000000000001000 RDI: 0000000020ffe000 RBP: 00007f8030801a20 R08: 0000000000000003 R09: 0000000000800000 R10: 0000000000000011 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8030975fa0 R15: 00007fffe83c9818 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888033f15b80 pfn:0x33f14 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffffea0000c67a08 ffffea000049f408 0000000000000000 raw: ffff888033f15b80 0000000000000002 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 1, migratetype Unmovable, gfp_mask 0x10cc0(GFP_KERNEL|__GFP_NORETRY), pid 6274, tgid 6273 (syz.1.115), ts 94679481407, free_ts 95539096851 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2269 kimage_alloc_pages+0x75/0x300 kernel/kexec_core.c:273 kimage_alloc_normal_control_pages kernel/kexec_core.c:347 [inline] kimage_alloc_control_pages+0x148/0x8e0 kernel/kexec_core.c:460 kimage_alloc_init kernel/kexec.c:67 [inline] do_kexec_load+0x38a/0x8c0 kernel/kexec.c:130 __do_sys_kexec_load kernel/kexec.c:261 [inline] __se_sys_kexec_load kernel/kexec.c:242 [inline] __x64_sys_kexec_load+0x1bf/0x230 kernel/kexec.c:242 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 6274 tgid 6273 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 kimage_free_page_list+0x130/0x230 kernel/kexec_core.c:314 kimage_alloc_normal_control_pages kernel/kexec_core.c:379 [inline] kimage_alloc_control_pages+0x38f/0x8e0 kernel/kexec_core.c:460 kimage_alloc_init kernel/kexec.c:67 [inline] do_kexec_load+0x38a/0x8c0 kernel/kexec.c:130 __do_sys_kexec_load kernel/kexec.c:261 [inline] __se_sys_kexec_load kernel/kexec.c:242 [inline] __x64_sys_kexec_load+0x1bf/0x230 kernel/kexec.c:242 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888033f14580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888033f14600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888033f14680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888033f14700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888033f14780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================