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

Environment
qemu-arm64
qemu-x86_64

[   29.358075] ==================================================================
[   29.358138] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2cc/0x2f8
[   29.358187] Read of size 1 at addr fff00000c9a50000 by task kunit_try_catch/181
[   29.358235] 
[   29.358265] CPU: 0 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT 
[   29.358349] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.358391] Hardware name: linux,dummy-virt (DT)
[   29.358441] Call trace:
[   29.358542]  show_stack+0x20/0x38 (C)
[   29.358629]  dump_stack_lvl+0x8c/0xd0
[   29.358674]  print_report+0x118/0x608
[   29.358745]  kasan_report+0xdc/0x128
[   29.358811]  __asan_report_load1_noabort+0x20/0x30
[   29.358867]  kmalloc_large_uaf+0x2cc/0x2f8
[   29.359004]  kunit_try_run_case+0x170/0x3f0
[   29.359063]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.359116]  kthread+0x328/0x630
[   29.359175]  ret_from_fork+0x10/0x20
[   29.359288] 
[   29.359336] The buggy address belongs to the physical page:
[   29.359413] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a50
[   29.359463] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.359521] raw: 0bfffe0000000000 ffffc1ffc3269508 fff00000da45cc40 0000000000000000
[   29.359569] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   29.359607] page dumped because: kasan: bad access detected
[   29.359637] 
[   29.359654] Memory state around the buggy address:
[   29.361713]  fff00000c9a4ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.361767]  fff00000c9a4ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.361809] >fff00000c9a50000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.361845]                    ^
[   29.361873]  fff00000c9a50080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.361923]  fff00000c9a50100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   29.361959] ==================================================================

[   24.368432] ==================================================================
[   24.369688] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2f1/0x340
[   24.370544] Read of size 1 at addr ffff88810623c000 by task kunit_try_catch/197
[   24.371347] 
[   24.371607] CPU: 0 UID: 0 PID: 197 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) 
[   24.371664] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.371677] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.371700] Call Trace:
[   24.371714]  <TASK>
[   24.371734]  dump_stack_lvl+0x73/0xb0
[   24.371763]  print_report+0xd1/0x650
[   24.371786]  ? __virt_addr_valid+0x1db/0x2d0
[   24.371812]  ? kmalloc_large_uaf+0x2f1/0x340
[   24.371832]  ? kasan_addr_to_slab+0x11/0xa0
[   24.371874]  ? kmalloc_large_uaf+0x2f1/0x340
[   24.371895]  kasan_report+0x141/0x180
[   24.371917]  ? kmalloc_large_uaf+0x2f1/0x340
[   24.371943]  __asan_report_load1_noabort+0x18/0x20
[   24.371967]  kmalloc_large_uaf+0x2f1/0x340
[   24.371988]  ? __pfx_kmalloc_large_uaf+0x10/0x10
[   24.372009]  ? __schedule+0x10cc/0x2b60
[   24.372036]  ? __pfx_read_tsc+0x10/0x10
[   24.372059]  ? ktime_get_ts64+0x86/0x230
[   24.372085]  kunit_try_run_case+0x1a5/0x480
[   24.372112]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.372136]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   24.372161]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.372186]  ? __kthread_parkme+0x82/0x180
[   24.372208]  ? preempt_count_sub+0x50/0x80
[   24.372236]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.372262]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.372287]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.372312]  kthread+0x337/0x6f0
[   24.372332]  ? trace_preempt_on+0x20/0xc0
[   24.372356]  ? __pfx_kthread+0x10/0x10
[   24.372378]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.372410]  ? calculate_sigpending+0x7b/0xa0
[   24.372434]  ? __pfx_kthread+0x10/0x10
[   24.372466]  ret_from_fork+0x116/0x1d0
[   24.372486]  ? __pfx_kthread+0x10/0x10
[   24.372508]  ret_from_fork_asm+0x1a/0x30
[   24.372552]  </TASK>
[   24.372565] 
[   24.385340] The buggy address belongs to the physical page:
[   24.386709] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10623c
[   24.387749] flags: 0x200000000000000(node=0|zone=2)
[   24.388626] raw: 0200000000000000 ffffea000418b008 ffff88815b039fc0 0000000000000000
[   24.389734] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   24.390856] page dumped because: kasan: bad access detected
[   24.391890] 
[   24.392081] Memory state around the buggy address:
[   24.392789]  ffff88810623bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.393803]  ffff88810623bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.395382] >ffff88810623c000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.396280]                    ^
[   24.396434]  ffff88810623c080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.396664]  ffff88810623c100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.397235] ==================================================================