Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.547522] ==================================================================
[   16.547586] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2cc/0x2f8
[   16.547630] Read of size 1 at addr fff00000c7800000 by task kunit_try_catch/148
[   16.547676] 
[   16.548816] CPU: 0 UID: 0 PID: 148 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   16.548956] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.549055] Hardware name: linux,dummy-virt (DT)
[   16.549104] Call trace:
[   16.549128]  show_stack+0x20/0x38 (C)
[   16.549334]  dump_stack_lvl+0x8c/0xd0
[   16.549477]  print_report+0x118/0x608
[   16.549704]  kasan_report+0xdc/0x128
[   16.549781]  __asan_report_load1_noabort+0x20/0x30
[   16.550225]  kmalloc_large_uaf+0x2cc/0x2f8
[   16.550297]  kunit_try_run_case+0x170/0x3f0
[   16.550377]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.551120]  kthread+0x328/0x630
[   16.551270]  ret_from_fork+0x10/0x20
[   16.551320] 
[   16.551341] The buggy address belongs to the physical page:
[   16.551398] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107800
[   16.551755] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.552121] raw: 0bfffe0000000000 ffffc1ffc31e0108 fff00000da457c40 0000000000000000
[   16.552213] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   16.552409] page dumped because: kasan: bad access detected
[   16.552587] 
[   16.552611] Memory state around the buggy address:
[   16.552849]  fff00000c77fff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.552971]  fff00000c77fff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.553124] >fff00000c7800000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.553242]                    ^
[   16.553271]  fff00000c7800080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.553323]  fff00000c7800100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.553361] ==================================================================

[   10.989591] ==================================================================
[   10.990632] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2f1/0x340
[   10.990931] Read of size 1 at addr ffff8881029fc000 by task kunit_try_catch/166
[   10.991244] 
[   10.991417] CPU: 0 UID: 0 PID: 166 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   10.991458] Tainted: [B]=BAD_PAGE, [N]=TEST
[   10.991469] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   10.991488] Call Trace:
[   10.991500]  <TASK>
[   10.991514]  dump_stack_lvl+0x73/0xb0
[   10.991540]  print_report+0xd1/0x650
[   10.991562]  ? __virt_addr_valid+0x1db/0x2d0
[   10.991583]  ? kmalloc_large_uaf+0x2f1/0x340
[   10.991602]  ? kasan_addr_to_slab+0x11/0xa0
[   10.991622]  ? kmalloc_large_uaf+0x2f1/0x340
[   10.991641]  kasan_report+0x141/0x180
[   10.991662]  ? kmalloc_large_uaf+0x2f1/0x340
[   10.991687]  __asan_report_load1_noabort+0x18/0x20
[   10.991711]  kmalloc_large_uaf+0x2f1/0x340
[   10.991730]  ? __pfx_kmalloc_large_uaf+0x10/0x10
[   10.991752]  ? __schedule+0x10cc/0x2b60
[   10.991773]  ? __pfx_read_tsc+0x10/0x10
[   10.991792]  ? ktime_get_ts64+0x86/0x230
[   10.991815]  kunit_try_run_case+0x1a5/0x480
[   10.991838]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.991859]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   10.991880]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   10.991902]  ? __kthread_parkme+0x82/0x180
[   10.991921]  ? preempt_count_sub+0x50/0x80
[   10.991944]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.991966]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.991988]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   10.992009]  kthread+0x337/0x6f0
[   10.992028]  ? trace_preempt_on+0x20/0xc0
[   10.992051]  ? __pfx_kthread+0x10/0x10
[   10.992070]  ? _raw_spin_unlock_irq+0x47/0x80
[   10.992090]  ? calculate_sigpending+0x7b/0xa0
[   10.992127]  ? __pfx_kthread+0x10/0x10
[   10.992147]  ret_from_fork+0x116/0x1d0
[   10.992165]  ? __pfx_kthread+0x10/0x10
[   10.992184]  ret_from_fork_asm+0x1a/0x30
[   10.992214]  </TASK>
[   10.992224] 
[   10.999289] The buggy address belongs to the physical page:
[   10.999625] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029fc
[   10.999897] flags: 0x200000000000000(node=0|zone=2)
[   11.000071] raw: 0200000000000000 ffffea00040a8008 ffff88815b039f80 0000000000000000
[   11.000365] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   11.000809] page dumped because: kasan: bad access detected
[   11.001055] 
[   11.001254] Memory state around the buggy address:
[   11.001447]  ffff8881029fbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.001667]  ffff8881029fbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.001982] >ffff8881029fc000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.002542]                    ^
[   11.002676]  ffff8881029fc080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.002987]  ffff8881029fc100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.003345] ==================================================================