Hay
Date
June 25, 2025, 8:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   26.419344] ==================================================================
[   26.419448] BUG: KASAN: use-after-free in page_alloc_uaf+0x328/0x350
[   26.419529] Read of size 1 at addr fff00000c7960000 by task kunit_try_catch/166
[   26.419605] 
[   26.419651] CPU: 1 UID: 0 PID: 166 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT 
[   26.419736] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.419763] Hardware name: linux,dummy-virt (DT)
[   26.419806] Call trace:
[   26.419829]  show_stack+0x20/0x38 (C)
[   26.419879]  dump_stack_lvl+0x8c/0xd0
[   26.419936]  print_report+0x118/0x608
[   26.419982]  kasan_report+0xdc/0x128
[   26.420036]  __asan_report_load1_noabort+0x20/0x30
[   26.420083]  page_alloc_uaf+0x328/0x350
[   26.420129]  kunit_try_run_case+0x170/0x3f0
[   26.420178]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.420229]  kthread+0x328/0x630
[   26.420270]  ret_from_fork+0x10/0x20
[   26.420323] 
[   26.420345] The buggy address belongs to the physical page:
[   26.420377] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107960
[   26.420439] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   26.420490] page_type: f0(buddy)
[   26.420583] raw: 0bfffe0000000000 fff00000ff616108 fff00000ff616108 0000000000000000
[   26.420689] raw: 0000000000000000 0000000000000005 00000000f0000000 0000000000000000
[   26.420858] page dumped because: kasan: bad access detected
[   26.420891] 
[   26.420955] Memory state around the buggy address:
[   26.421017]  fff00000c795ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.421172]  fff00000c795ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.421262] >fff00000c7960000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.421440]                    ^
[   26.421577]  fff00000c7960080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.421709]  fff00000c7960100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.421774] ==================================================================

[   21.455409] ==================================================================
[   21.456053] BUG: KASAN: use-after-free in page_alloc_uaf+0x356/0x3d0
[   21.456341] Read of size 1 at addr ffff888102c00000 by task kunit_try_catch/183
[   21.456618] 
[   21.456740] CPU: 0 UID: 0 PID: 183 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   21.456788] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.456800] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.456836] Call Trace:
[   21.456852]  <TASK>
[   21.456870]  dump_stack_lvl+0x73/0xb0
[   21.456899]  print_report+0xd1/0x650
[   21.456921]  ? __virt_addr_valid+0x1db/0x2d0
[   21.456954]  ? page_alloc_uaf+0x356/0x3d0
[   21.456977]  ? kasan_addr_to_slab+0x11/0xa0
[   21.456998]  ? page_alloc_uaf+0x356/0x3d0
[   21.457021]  kasan_report+0x141/0x180
[   21.457042]  ? page_alloc_uaf+0x356/0x3d0
[   21.457069]  __asan_report_load1_noabort+0x18/0x20
[   21.457094]  page_alloc_uaf+0x356/0x3d0
[   21.457132]  ? __pfx_page_alloc_uaf+0x10/0x10
[   21.457155]  ? __schedule+0x10cc/0x2b60
[   21.457181]  ? __pfx_read_tsc+0x10/0x10
[   21.457203]  ? ktime_get_ts64+0x86/0x230
[   21.457231]  kunit_try_run_case+0x1a5/0x480
[   21.457258]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.457282]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   21.457304]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.457330]  ? __kthread_parkme+0x82/0x180
[   21.457352]  ? preempt_count_sub+0x50/0x80
[   21.457376]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.457401]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.457426]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.457450]  kthread+0x337/0x6f0
[   21.457471]  ? trace_preempt_on+0x20/0xc0
[   21.457495]  ? __pfx_kthread+0x10/0x10
[   21.457516]  ? _raw_spin_unlock_irq+0x47/0x80
[   21.457540]  ? calculate_sigpending+0x7b/0xa0
[   21.457565]  ? __pfx_kthread+0x10/0x10
[   21.457587]  ret_from_fork+0x116/0x1d0
[   21.457607]  ? __pfx_kthread+0x10/0x10
[   21.457628]  ret_from_fork_asm+0x1a/0x30
[   21.457660]  </TASK>
[   21.457671] 
[   21.464374] The buggy address belongs to the physical page:
[   21.464627] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102c00
[   21.464980] flags: 0x200000000000000(node=0|zone=2)
[   21.465175] page_type: f0(buddy)
[   21.465334] raw: 0200000000000000 ffff88817fffb4f0 ffff88817fffb4f0 0000000000000000
[   21.465667] raw: 0000000000000000 0000000000000006 00000000f0000000 0000000000000000
[   21.465984] page dumped because: kasan: bad access detected
[   21.466231] 
[   21.466322] Memory state around the buggy address:
[   21.466535]  ffff888102bfff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.466738]  ffff888102bfff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.467018] >ffff888102c00000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.467316]                    ^
[   21.467474]  ffff888102c00080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.467749]  ffff888102c00100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.467994] ==================================================================