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

Environment
qemu-arm64
qemu-x86_64

[   26.367225] ==================================================================
[   26.367357] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2cc/0x2f8
[   26.367647] Read of size 1 at addr fff00000c7820000 by task kunit_try_catch/160
[   26.367854] 
[   26.367948] CPU: 1 UID: 0 PID: 160 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT 
[   26.368182] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.368214] Hardware name: linux,dummy-virt (DT)
[   26.368246] Call trace:
[   26.368563]  show_stack+0x20/0x38 (C)
[   26.368620]  dump_stack_lvl+0x8c/0xd0
[   26.368867]  print_report+0x118/0x608
[   26.368927]  kasan_report+0xdc/0x128
[   26.369097]  __asan_report_load1_noabort+0x20/0x30
[   26.369147]  kmalloc_large_uaf+0x2cc/0x2f8
[   26.369191]  kunit_try_run_case+0x170/0x3f0
[   26.369241]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.369293]  kthread+0x328/0x630
[   26.369334]  ret_from_fork+0x10/0x20
[   26.369380] 
[   26.369422] The buggy address belongs to the physical page:
[   26.369453] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107820
[   26.369678] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   26.370033] raw: 0bfffe0000000000 ffffc1ffc31e0908 fff00000da488c80 0000000000000000
[   26.370087] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   26.370130] page dumped because: kasan: bad access detected
[   26.370160] 
[   26.370179] Memory state around the buggy address:
[   26.370573]  fff00000c781ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.370618]  fff00000c781ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.370659] >fff00000c7820000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.370695]                    ^
[   26.370997]  fff00000c7820080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.371109]  fff00000c7820100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.371146] ==================================================================

[   21.408390] ==================================================================
[   21.409014] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2f1/0x340
[   21.409546] Read of size 1 at addr ffff888102ccc000 by task kunit_try_catch/177
[   21.410233] 
[   21.410359] CPU: 1 UID: 0 PID: 177 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   21.410411] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.410575] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.410600] Call Trace:
[   21.410615]  <TASK>
[   21.410633]  dump_stack_lvl+0x73/0xb0
[   21.410662]  print_report+0xd1/0x650
[   21.410684]  ? __virt_addr_valid+0x1db/0x2d0
[   21.410707]  ? kmalloc_large_uaf+0x2f1/0x340
[   21.410727]  ? kasan_addr_to_slab+0x11/0xa0
[   21.410746]  ? kmalloc_large_uaf+0x2f1/0x340
[   21.410767]  kasan_report+0x141/0x180
[   21.410789]  ? kmalloc_large_uaf+0x2f1/0x340
[   21.410816]  __asan_report_load1_noabort+0x18/0x20
[   21.410840]  kmalloc_large_uaf+0x2f1/0x340
[   21.410860]  ? __pfx_kmalloc_large_uaf+0x10/0x10
[   21.410880]  ? __schedule+0x10cc/0x2b60
[   21.410905]  ? __pfx_read_tsc+0x10/0x10
[   21.410925]  ? ktime_get_ts64+0x86/0x230
[   21.410965]  kunit_try_run_case+0x1a5/0x480
[   21.410990]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.411012]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   21.411031]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.411055]  ? __kthread_parkme+0x82/0x180
[   21.411075]  ? preempt_count_sub+0x50/0x80
[   21.411098]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.411122]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.411145]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.411166]  kthread+0x337/0x6f0
[   21.411185]  ? trace_preempt_on+0x20/0xc0
[   21.411208]  ? __pfx_kthread+0x10/0x10
[   21.411227]  ? _raw_spin_unlock_irq+0x47/0x80
[   21.411249]  ? calculate_sigpending+0x7b/0xa0
[   21.411272]  ? __pfx_kthread+0x10/0x10
[   21.411293]  ret_from_fork+0x116/0x1d0
[   21.411311]  ? __pfx_kthread+0x10/0x10
[   21.411330]  ret_from_fork_asm+0x1a/0x30
[   21.411365]  </TASK>
[   21.411376] 
[   21.421050] The buggy address belongs to the physical page:
[   21.421439] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ccc
[   21.421852] flags: 0x200000000000000(node=0|zone=2)
[   21.422344] raw: 0200000000000000 ffffea00040b1008 ffff88815b139fc0 0000000000000000
[   21.422654] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   21.422992] page dumped because: kasan: bad access detected
[   21.423522] 
[   21.423614] Memory state around the buggy address:
[   21.423995]  ffff888102ccbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.424336]  ffff888102ccbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.424629] >ffff888102ccc000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.425118]                    ^
[   21.425315]  ffff888102ccc080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.425667]  ffff888102ccc100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.426180] ==================================================================