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

Environment
qemu-arm64
qemu-x86_64

[   30.915688] ==================================================================
[   30.915771] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2cc/0x2f8
[   30.915823] Read of size 1 at addr fff00000c9a24000 by task kunit_try_catch/179
[   30.915870] 
[   30.915906] CPU: 0 UID: 0 PID: 179 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT 
[   30.915988] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.916024] Hardware name: linux,dummy-virt (DT)
[   30.916054] Call trace:
[   30.916077]  show_stack+0x20/0x38 (C)
[   30.916122]  dump_stack_lvl+0x8c/0xd0
[   30.916168]  print_report+0x118/0x5d0
[   30.916324]  kasan_report+0xdc/0x128
[   30.916381]  __asan_report_load1_noabort+0x20/0x30
[   30.916438]  kmalloc_large_uaf+0x2cc/0x2f8
[   30.916484]  kunit_try_run_case+0x170/0x3f0
[   30.916579]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.916697]  kthread+0x328/0x630
[   30.916741]  ret_from_fork+0x10/0x20
[   30.916798] 
[   30.916825] The buggy address belongs to the physical page:
[   30.916855] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a24
[   30.916905] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.916964] raw: 0bfffe0000000000 ffffc1ffc3268a08 fff00000da45cc40 0000000000000000
[   30.917012] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   30.917050] page dumped because: kasan: bad access detected
[   30.917080] 
[   30.917098] Memory state around the buggy address:
[   30.917127]  fff00000c9a23f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.917168]  fff00000c9a23f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.917220] >fff00000c9a24000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.917256]                    ^
[   30.917308]  fff00000c9a24080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.917349]  fff00000c9a24100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.917384] ==================================================================

[   22.880208] ==================================================================
[   22.880663] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2f1/0x340
[   22.881000] Read of size 1 at addr ffff888106314000 by task kunit_try_catch/196
[   22.881447] 
[   22.881655] CPU: 0 UID: 0 PID: 196 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT(voluntary) 
[   22.881726] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.881738] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.881761] Call Trace:
[   22.881903]  <TASK>
[   22.881928]  dump_stack_lvl+0x73/0xb0
[   22.881961]  print_report+0xd1/0x610
[   22.881986]  ? __virt_addr_valid+0x1db/0x2d0
[   22.882011]  ? kmalloc_large_uaf+0x2f1/0x340
[   22.882031]  ? kasan_addr_to_slab+0x11/0xa0
[   22.882052]  ? kmalloc_large_uaf+0x2f1/0x340
[   22.882073]  kasan_report+0x141/0x180
[   22.882096]  ? kmalloc_large_uaf+0x2f1/0x340
[   22.882121]  __asan_report_load1_noabort+0x18/0x20
[   22.882148]  kmalloc_large_uaf+0x2f1/0x340
[   22.882168]  ? __pfx_kmalloc_large_uaf+0x10/0x10
[   22.882190]  ? __schedule+0x10cc/0x2b60
[   22.882219]  ? __pfx_read_tsc+0x10/0x10
[   22.882256]  ? ktime_get_ts64+0x86/0x230
[   22.882283]  kunit_try_run_case+0x1a5/0x480
[   22.882306]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.882326]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.882348]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.882376]  ? __kthread_parkme+0x82/0x180
[   22.882398]  ? preempt_count_sub+0x50/0x80
[   22.882422]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.882444]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.882470]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.882497]  kthread+0x337/0x6f0
[   22.882518]  ? trace_preempt_on+0x20/0xc0
[   22.882543]  ? __pfx_kthread+0x10/0x10
[   22.882566]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.882593]  ? calculate_sigpending+0x7b/0xa0
[   22.882622]  ? __pfx_kthread+0x10/0x10
[   22.882645]  ret_from_fork+0x116/0x1d0
[   22.882666]  ? __pfx_kthread+0x10/0x10
[   22.882688]  ret_from_fork_asm+0x1a/0x30
[   22.882723]  </TASK>
[   22.882736] 
[   22.891705] The buggy address belongs to the physical page:
[   22.892152] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106314
[   22.892669] flags: 0x200000000000000(node=0|zone=2)
[   22.892852] raw: 0200000000000000 ffffea000418c608 ffff888154839fc0 0000000000000000
[   22.893590] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   22.894319] page dumped because: kasan: bad access detected
[   22.894687] 
[   22.895087] Memory state around the buggy address:
[   22.895345]  ffff888106313f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.895639]  ffff888106313f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.896163] >ffff888106314000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.896650]                    ^
[   22.896938]  ffff888106314080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.897453]  ffff888106314100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.897737] ==================================================================