Hay
Date
July 25, 2025, 3:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.169325] ==================================================================
[   32.169390] BUG: KASAN: use-after-free in page_alloc_uaf+0x328/0x350
[   32.169452] Read of size 1 at addr fff00000c9b40000 by task kunit_try_catch/186
[   32.169501] 
[   32.169536] CPU: 1 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250725 #1 PREEMPT 
[   32.169657] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   32.169723] Hardware name: linux,dummy-virt (DT)
[   32.169756] Call trace:
[   32.169788]  show_stack+0x20/0x38 (C)
[   32.170117]  dump_stack_lvl+0x8c/0xd0
[   32.170412]  print_report+0x118/0x5e8
[   32.170705]  kasan_report+0xdc/0x128
[   32.171012]  __asan_report_load1_noabort+0x20/0x30
[   32.171091]  page_alloc_uaf+0x328/0x350
[   32.171395]  kunit_try_run_case+0x170/0x3f0
[   32.171969]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.172430]  kthread+0x328/0x630
[   32.172499]  ret_from_fork+0x10/0x20
[   32.173635] 
[   32.173743] The buggy address belongs to the physical page:
[   32.173863] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b40
[   32.173942] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.174025] page_type: f0(buddy)
[   32.174386] raw: 0bfffe0000000000 fff00000ff6161b0 fff00000ff6161b0 0000000000000000
[   32.174543] raw: 0000000000000000 0000000000000006 00000000f0000000 0000000000000000
[   32.174851] page dumped because: kasan: bad access detected
[   32.175274] 
[   32.175402] Memory state around the buggy address:
[   32.175449]  fff00000c9b3ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.175772]  fff00000c9b3ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.175926] >fff00000c9b40000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.176041]                    ^
[   32.176285]  fff00000c9b40080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.176695]  fff00000c9b40100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.176740] ==================================================================

[   25.245937] ==================================================================
[   25.246522] BUG: KASAN: use-after-free in page_alloc_uaf+0x356/0x3d0
[   25.246816] Read of size 1 at addr ffff8881062f0000 by task kunit_try_catch/203
[   25.247300] 
[   25.247420] CPU: 0 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250725 #1 PREEMPT(voluntary) 
[   25.247468] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.247480] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.247500] Call Trace:
[   25.247645]  <TASK>
[   25.247676]  dump_stack_lvl+0x73/0xb0
[   25.247705]  print_report+0xd1/0x640
[   25.247728]  ? __virt_addr_valid+0x1db/0x2d0
[   25.247753]  ? page_alloc_uaf+0x356/0x3d0
[   25.247775]  ? kasan_addr_to_slab+0x11/0xa0
[   25.247797]  ? page_alloc_uaf+0x356/0x3d0
[   25.247819]  kasan_report+0x141/0x180
[   25.247846]  ? page_alloc_uaf+0x356/0x3d0
[   25.247874]  __asan_report_load1_noabort+0x18/0x20
[   25.247899]  page_alloc_uaf+0x356/0x3d0
[   25.247922]  ? __pfx_page_alloc_uaf+0x10/0x10
[   25.247956]  ? __schedule+0x10da/0x2b60
[   25.247978]  ? __pfx_read_tsc+0x10/0x10
[   25.248055]  ? ktime_get_ts64+0x86/0x230
[   25.248082]  kunit_try_run_case+0x1a5/0x480
[   25.248107]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.248130]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.248153]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.248179]  ? __kthread_parkme+0x82/0x180
[   25.248200]  ? preempt_count_sub+0x50/0x80
[   25.248224]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.248249]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.248273]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.248298]  kthread+0x337/0x6f0
[   25.248318]  ? trace_preempt_on+0x20/0xc0
[   25.248342]  ? __pfx_kthread+0x10/0x10
[   25.248363]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.248387]  ? calculate_sigpending+0x7b/0xa0
[   25.248411]  ? __pfx_kthread+0x10/0x10
[   25.248434]  ret_from_fork+0x116/0x1d0
[   25.248454]  ? __pfx_kthread+0x10/0x10
[   25.248475]  ret_from_fork_asm+0x1a/0x30
[   25.248507]  </TASK>
[   25.248518] 
[   25.257520] The buggy address belongs to the physical page:
[   25.258224] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1062f0
[   25.258507] flags: 0x200000000000000(node=0|zone=2)
[   25.258714] page_type: f0(buddy)
[   25.259439] raw: 0200000000000000 ffff88817fffb460 ffff88817fffb460 0000000000000000
[   25.260103] raw: 0000000000000000 0000000000000004 00000000f0000000 0000000000000000
[   25.260427] page dumped because: kasan: bad access detected
[   25.260635] 
[   25.260710] Memory state around the buggy address:
[   25.261187]  ffff8881062eff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   25.261493]  ffff8881062eff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   25.261782] >ffff8881062f0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   25.262807]                    ^
[   25.262936]  ffff8881062f0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   25.263567]  ffff8881062f0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   25.263938] ==================================================================