Hay
Date
July 4, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.379017] ==================================================================
[   29.379113] BUG: KASAN: use-after-free in page_alloc_uaf+0x328/0x350
[   29.379165] Read of size 1 at addr fff00000c9b60000 by task kunit_try_catch/187
[   29.379214] 
[   29.379244] CPU: 0 UID: 0 PID: 187 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT 
[   29.379324] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.379350] Hardware name: linux,dummy-virt (DT)
[   29.379427] Call trace:
[   29.379450]  show_stack+0x20/0x38 (C)
[   29.379498]  dump_stack_lvl+0x8c/0xd0
[   29.379544]  print_report+0x118/0x608
[   29.379590]  kasan_report+0xdc/0x128
[   29.379634]  __asan_report_load1_noabort+0x20/0x30
[   29.379682]  page_alloc_uaf+0x328/0x350
[   29.379763]  kunit_try_run_case+0x170/0x3f0
[   29.379818]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.379872]  kthread+0x328/0x630
[   29.379971]  ret_from_fork+0x10/0x20
[   29.380032] 
[   29.380071] The buggy address belongs to the physical page:
[   29.380177] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b60
[   29.380245] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.380291] page_type: f0(buddy)
[   29.380328] raw: 0bfffe0000000000 fff00000ff616148 fff00000ff616148 0000000000000000
[   29.380457] raw: 0000000000000000 0000000000000005 00000000f0000000 0000000000000000
[   29.380586] page dumped because: kasan: bad access detected
[   29.380617] 
[   29.380688] Memory state around the buggy address:
[   29.380769]  fff00000c9b5ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.380821]  fff00000c9b5ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.380914] >fff00000c9b60000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.380969]                    ^
[   29.380998]  fff00000c9b60080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.381076]  fff00000c9b60100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.381115] ==================================================================

[   24.431502] ==================================================================
[   24.432159] BUG: KASAN: use-after-free in page_alloc_uaf+0x356/0x3d0
[   24.432501] Read of size 1 at addr ffff8881060e0000 by task kunit_try_catch/203
[   24.432792] 
[   24.432926] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) 
[   24.432985] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.432999] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.433025] Call Trace:
[   24.433041]  <TASK>
[   24.433064]  dump_stack_lvl+0x73/0xb0
[   24.433096]  print_report+0xd1/0x650
[   24.433121]  ? __virt_addr_valid+0x1db/0x2d0
[   24.433149]  ? page_alloc_uaf+0x356/0x3d0
[   24.433173]  ? kasan_addr_to_slab+0x11/0xa0
[   24.433200]  ? page_alloc_uaf+0x356/0x3d0
[   24.433224]  kasan_report+0x141/0x180
[   24.433248]  ? page_alloc_uaf+0x356/0x3d0
[   24.433277]  __asan_report_load1_noabort+0x18/0x20
[   24.433305]  page_alloc_uaf+0x356/0x3d0
[   24.433328]  ? __pfx_page_alloc_uaf+0x10/0x10
[   24.433354]  ? __schedule+0x10cc/0x2b60
[   24.433382]  ? __pfx_read_tsc+0x10/0x10
[   24.433448]  ? ktime_get_ts64+0x86/0x230
[   24.433479]  kunit_try_run_case+0x1a5/0x480
[   24.433511]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.433538]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   24.433564]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.433592]  ? __kthread_parkme+0x82/0x180
[   24.433616]  ? preempt_count_sub+0x50/0x80
[   24.433643]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.433672]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.433700]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.433728]  kthread+0x337/0x6f0
[   24.433750]  ? trace_preempt_on+0x20/0xc0
[   24.433777]  ? __pfx_kthread+0x10/0x10
[   24.433801]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.433825]  ? calculate_sigpending+0x7b/0xa0
[   24.433853]  ? __pfx_kthread+0x10/0x10
[   24.433897]  ret_from_fork+0x116/0x1d0
[   24.433919]  ? __pfx_kthread+0x10/0x10
[   24.433942]  ret_from_fork_asm+0x1a/0x30
[   24.433978]  </TASK>
[   24.433992] 
[   24.443890] The buggy address belongs to the physical page:
[   24.444569] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1060e0
[   24.445222] flags: 0x200000000000000(node=0|zone=2)
[   24.445850] page_type: f0(buddy)
[   24.446056] raw: 0200000000000000 ffff88817fffc4a8 ffff88817fffc4a8 0000000000000000
[   24.446717] raw: 0000000000000000 0000000000000005 00000000f0000000 0000000000000000
[   24.447547] page dumped because: kasan: bad access detected
[   24.447914] 
[   24.448013] Memory state around the buggy address:
[   24.448442]  ffff8881060dff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.449040]  ffff8881060dff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.449883] >ffff8881060e0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.450477]                    ^
[   24.450784]  ffff8881060e0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.451445]  ffff8881060e0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.451774] ==================================================================