Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.839457] ==================================================================
[   17.839518] BUG: KASAN: use-after-free in page_alloc_uaf+0x328/0x350
[   17.839637] Read of size 1 at addr fff00000c77a0000 by task kunit_try_catch/154
[   17.839689] 
[   17.839751] CPU: 1 UID: 0 PID: 154 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   17.840090] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.840123] Hardware name: linux,dummy-virt (DT)
[   17.840370] Call trace:
[   17.840427]  show_stack+0x20/0x38 (C)
[   17.840519]  dump_stack_lvl+0x8c/0xd0
[   17.840573]  print_report+0x118/0x608
[   17.840700]  kasan_report+0xdc/0x128
[   17.840792]  __asan_report_load1_noabort+0x20/0x30
[   17.840845]  page_alloc_uaf+0x328/0x350
[   17.840890]  kunit_try_run_case+0x170/0x3f0
[   17.840992]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.841047]  kthread+0x328/0x630
[   17.841092]  ret_from_fork+0x10/0x20
[   17.841206] 
[   17.841273] The buggy address belongs to the physical page:
[   17.841512] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1077a0
[   17.841583] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.842042] page_type: f0(buddy)
[   17.842126] raw: 0bfffe0000000000 fff00000ff616108 fff00000ff616108 0000000000000000
[   17.842318] raw: 0000000000000000 0000000000000005 00000000f0000000 0000000000000000
[   17.842420] page dumped because: kasan: bad access detected
[   17.842490] 
[   17.842509] Memory state around the buggy address:
[   17.842542]  fff00000c779ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.842881]  fff00000c779ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.842939] >fff00000c77a0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.843396]                    ^
[   17.843435]  fff00000c77a0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.843741]  fff00000c77a0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.844056] ==================================================================


[   13.529147] ==================================================================
[   13.529764] BUG: KASAN: use-after-free in page_alloc_uaf+0x356/0x3d0
[   13.530119] Read of size 1 at addr ffff888103bc0000 by task kunit_try_catch/172
[   13.530436] 
[   13.530588] CPU: 0 UID: 0 PID: 172 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   13.530683] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.530709] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.530739] Call Trace:
[   13.530755]  <TASK>
[   13.530776]  dump_stack_lvl+0x73/0xb0
[   13.530808]  print_report+0xd1/0x650
[   13.530832]  ? __virt_addr_valid+0x1db/0x2d0
[   13.530857]  ? page_alloc_uaf+0x356/0x3d0
[   13.530893]  ? kasan_addr_to_slab+0x11/0xa0
[   13.530974]  ? page_alloc_uaf+0x356/0x3d0
[   13.531023]  kasan_report+0x141/0x180
[   13.531068]  ? page_alloc_uaf+0x356/0x3d0
[   13.531122]  __asan_report_load1_noabort+0x18/0x20
[   13.531164]  page_alloc_uaf+0x356/0x3d0
[   13.531212]  ? __pfx_page_alloc_uaf+0x10/0x10
[   13.531269]  ? __schedule+0x10cc/0x2b60
[   13.531316]  ? __pfx_read_tsc+0x10/0x10
[   13.531357]  ? ktime_get_ts64+0x86/0x230
[   13.531407]  kunit_try_run_case+0x1a5/0x480
[   13.531458]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.531502]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.531547]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.531592]  ? __kthread_parkme+0x82/0x180
[   13.531631]  ? preempt_count_sub+0x50/0x80
[   13.531669]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.531702]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.531745]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.531778]  kthread+0x337/0x6f0
[   13.531807]  ? trace_preempt_on+0x20/0xc0
[   13.531845]  ? __pfx_kthread+0x10/0x10
[   13.531875]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.531906]  ? calculate_sigpending+0x7b/0xa0
[   13.531941]  ? __pfx_kthread+0x10/0x10
[   13.531977]  ret_from_fork+0x116/0x1d0
[   13.532009]  ? __pfx_kthread+0x10/0x10
[   13.532040]  ret_from_fork_asm+0x1a/0x30
[   13.532092]  </TASK>
[   13.532110] 
[   13.540946] The buggy address belongs to the physical page:
[   13.541313] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103bc0
[   13.541686] flags: 0x200000000000000(node=0|zone=2)
[   13.541898] page_type: f0(buddy)
[   13.542061] raw: 0200000000000000 ffff88817fffb4f0 ffff88817fffb4f0 0000000000000000
[   13.542980] raw: 0000000000000000 0000000000000006 00000000f0000000 0000000000000000
[   13.543524] page dumped because: kasan: bad access detected
[   13.544038] 
[   13.544208] Memory state around the buggy address:
[   13.544958]  ffff888103bbff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.545502]  ffff888103bbff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.545887] >ffff888103bc0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.546123]                    ^
[   13.546752]  ffff888103bc0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.547006]  ffff888103bc0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.547510] ==================================================================