Hay
Date
May 12, 2025, 11:48 a.m.

Environment
qemu-arm64
qemu-x86_64

[   16.329849] ==================================================================
[   16.330014] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2cc/0x2f8
[   16.330130] Read of size 1 at addr fff00000c78dc000 by task kunit_try_catch/148
[   16.330471] 
[   16.330540] CPU: 1 UID: 0 PID: 148 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250512 #1 PREEMPT 
[   16.330839] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.330925] Hardware name: linux,dummy-virt (DT)
[   16.331126] Call trace:
[   16.331180]  show_stack+0x20/0x38 (C)
[   16.331537]  dump_stack_lvl+0x8c/0xd0
[   16.332067]  print_report+0x118/0x608
[   16.332339]  kasan_report+0xdc/0x128
[   16.332486]  __asan_report_load1_noabort+0x20/0x30
[   16.332591]  kmalloc_large_uaf+0x2cc/0x2f8
[   16.332697]  kunit_try_run_case+0x170/0x3f0
[   16.333177]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.333402]  kthread+0x328/0x630
[   16.333581]  ret_from_fork+0x10/0x20
[   16.333689] 
[   16.333902] The buggy address belongs to the physical page:
[   16.333965] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078dc
[   16.334090] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.334508] raw: 0bfffe0000000000 ffffc1ffc31e3808 fff00000da47cc00 0000000000000000
[   16.334817] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   16.334913] page dumped because: kasan: bad access detected
[   16.334977] 
[   16.335017] Memory state around the buggy address:
[   16.335106]  fff00000c78dbf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.335354]  fff00000c78dbf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.335477] >fff00000c78dc000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.335558]                    ^
[   16.335622]  fff00000c78dc080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.336091]  fff00000c78dc100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.336186] ==================================================================

[   15.908317] ==================================================================
[   15.909124] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2f1/0x340
[   15.909454] Read of size 1 at addr ffff888102990000 by task kunit_try_catch/165
[   15.911471] 
[   15.911692] CPU: 1 UID: 0 PID: 165 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250512 #1 PREEMPT(voluntary) 
[   15.911788] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.911808] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   15.911844] Call Trace:
[   15.911867]  <TASK>
[   15.911899]  dump_stack_lvl+0x73/0xb0
[   15.911959]  print_report+0xd1/0x650
[   15.911997]  ? __virt_addr_valid+0x1db/0x2d0
[   15.912036]  ? kmalloc_large_uaf+0x2f1/0x340
[   15.912072]  ? kasan_addr_to_slab+0x11/0xa0
[   15.912106]  ? kmalloc_large_uaf+0x2f1/0x340
[   15.912141]  kasan_report+0x141/0x180
[   15.912176]  ? kmalloc_large_uaf+0x2f1/0x340
[   15.912223]  __asan_report_load1_noabort+0x18/0x20
[   15.912381]  kmalloc_large_uaf+0x2f1/0x340
[   15.912433]  ? __pfx_kmalloc_large_uaf+0x10/0x10
[   15.912476]  ? __schedule+0x10cc/0x2b60
[   15.912523]  ? __pfx_read_tsc+0x10/0x10
[   15.912567]  ? ktime_get_ts64+0x86/0x230
[   15.912618]  kunit_try_run_case+0x1a5/0x480
[   15.912679]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.912881]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   15.912934]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   15.912976]  ? __kthread_parkme+0x82/0x180
[   15.913013]  ? preempt_count_sub+0x50/0x80
[   15.913051]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.913093]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.913173]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   15.913220]  kthread+0x337/0x6f0
[   15.913299]  ? trace_preempt_on+0x20/0xc0
[   15.913349]  ? __pfx_kthread+0x10/0x10
[   15.913387]  ? _raw_spin_unlock_irq+0x47/0x80
[   15.913422]  ? calculate_sigpending+0x7b/0xa0
[   15.913465]  ? __pfx_kthread+0x10/0x10
[   15.913506]  ret_from_fork+0x116/0x1d0
[   15.913547]  ? __pfx_kthread+0x10/0x10
[   15.913584]  ret_from_fork_asm+0x1a/0x30
[   15.913628]  </TASK>
[   15.913644] 
[   15.924782] The buggy address belongs to the physical page:
[   15.925096] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102990
[   15.925527] flags: 0x200000000000000(node=0|zone=2)
[   15.925827] raw: 0200000000000000 ffffea00040a6508 ffff88815b139f80 0000000000000000
[   15.926232] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   15.926802] page dumped because: kasan: bad access detected
[   15.927239] 
[   15.927414] Memory state around the buggy address:
[   15.927808]  ffff88810298ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.928153]  ffff88810298ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.928481] >ffff888102990000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   15.928769]                    ^
[   15.929038]  ffff888102990080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   15.929535]  ffff888102990100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   15.930074] ==================================================================