Hay
Date
July 15, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.227655] ==================================================================
[   15.227898] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2cc/0x2f8
[   15.227950] Read of size 1 at addr fff00000c7834000 by task kunit_try_catch/149
[   15.228192] 
[   15.228346] CPU: 1 UID: 0 PID: 149 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.228427] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.228463] Hardware name: linux,dummy-virt (DT)
[   15.228605] Call trace:
[   15.228730]  show_stack+0x20/0x38 (C)
[   15.228779]  dump_stack_lvl+0x8c/0xd0
[   15.228823]  print_report+0x118/0x5d0
[   15.228867]  kasan_report+0xdc/0x128
[   15.228911]  __asan_report_load1_noabort+0x20/0x30
[   15.228960]  kmalloc_large_uaf+0x2cc/0x2f8
[   15.229003]  kunit_try_run_case+0x170/0x3f0
[   15.229049]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.229099]  kthread+0x328/0x630
[   15.229139]  ret_from_fork+0x10/0x20
[   15.229454] 
[   15.229522] The buggy address belongs to the physical page:
[   15.229566] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107834
[   15.229712] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.229785] raw: 0bfffe0000000000 ffffc1ffc31e0e08 fff00000da478c40 0000000000000000
[   15.229835] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   15.229874] page dumped because: kasan: bad access detected
[   15.229904] 
[   15.229945] Memory state around the buggy address:
[   15.229975]  fff00000c7833f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.230018]  fff00000c7833f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.230058] >fff00000c7834000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   15.230257]                    ^
[   15.230497]  fff00000c7834080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   15.230541]  fff00000c7834100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   15.230578] ==================================================================

[   12.078520] ==================================================================
[   12.078987] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2f1/0x340
[   12.079277] Read of size 1 at addr ffff8881026b8000 by task kunit_try_catch/165
[   12.079746] 
[   12.079863] CPU: 1 UID: 0 PID: 165 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.079906] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.079917] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.079937] Call Trace:
[   12.079948]  <TASK>
[   12.079962]  dump_stack_lvl+0x73/0xb0
[   12.079992]  print_report+0xd1/0x610
[   12.080014]  ? __virt_addr_valid+0x1db/0x2d0
[   12.080037]  ? kmalloc_large_uaf+0x2f1/0x340
[   12.080058]  ? kasan_addr_to_slab+0x11/0xa0
[   12.080078]  ? kmalloc_large_uaf+0x2f1/0x340
[   12.080100]  kasan_report+0x141/0x180
[   12.080122]  ? kmalloc_large_uaf+0x2f1/0x340
[   12.080147]  __asan_report_load1_noabort+0x18/0x20
[   12.080172]  kmalloc_large_uaf+0x2f1/0x340
[   12.080193]  ? __pfx_kmalloc_large_uaf+0x10/0x10
[   12.080215]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   12.080242]  ? trace_hardirqs_on+0x37/0xe0
[   12.080265]  ? __pfx_read_tsc+0x10/0x10
[   12.080285]  ? ktime_get_ts64+0x86/0x230
[   12.080310]  kunit_try_run_case+0x1a5/0x480
[   12.080528]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.080557]  ? queued_spin_lock_slowpath+0x116/0xb40
[   12.080581]  ? __kthread_parkme+0x82/0x180
[   12.080601]  ? preempt_count_sub+0x50/0x80
[   12.080624]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.080649]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.080683]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.080708]  kthread+0x337/0x6f0
[   12.080727]  ? trace_preempt_on+0x20/0xc0
[   12.080749]  ? __pfx_kthread+0x10/0x10
[   12.080787]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.080808]  ? calculate_sigpending+0x7b/0xa0
[   12.080832]  ? __pfx_kthread+0x10/0x10
[   12.080854]  ret_from_fork+0x116/0x1d0
[   12.080872]  ? __pfx_kthread+0x10/0x10
[   12.080893]  ret_from_fork_asm+0x1a/0x30
[   12.080923]  </TASK>
[   12.080933] 
[   12.088510] The buggy address belongs to the physical page:
[   12.088972] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1026b8
[   12.089323] flags: 0x200000000000000(node=0|zone=2)
[   12.089642] raw: 0200000000000000 ffffea000409af08 ffff88815b139f80 0000000000000000
[   12.089958] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   12.090291] page dumped because: kasan: bad access detected
[   12.090514] 
[   12.090629] Memory state around the buggy address:
[   12.090830]  ffff8881026b7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.091052]  ffff8881026b7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.091377] >ffff8881026b8000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   12.091974]                    ^
[   12.092125]  ffff8881026b8080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   12.092365]  ffff8881026b8100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   12.092577] ==================================================================