Hay
Date
July 1, 2025, 11:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.515050] ==================================================================
[   18.515224] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   18.515344] Read of size 1 at addr fff00000c77311a8 by task kunit_try_catch/189
[   18.515448] 
[   18.515569] CPU: 1 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.515701] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.515767] Hardware name: linux,dummy-virt (DT)
[   18.515814] Call trace:
[   18.515839]  show_stack+0x20/0x38 (C)
[   18.515895]  dump_stack_lvl+0x8c/0xd0
[   18.515950]  print_report+0x118/0x608
[   18.516030]  kasan_report+0xdc/0x128
[   18.516205]  __asan_report_load1_noabort+0x20/0x30
[   18.516266]  kmalloc_uaf2+0x3f4/0x468
[   18.516314]  kunit_try_run_case+0x170/0x3f0
[   18.516436]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.516587]  kthread+0x328/0x630
[   18.516658]  ret_from_fork+0x10/0x20
[   18.517001] 
[   18.517076] Allocated by task 189:
[   18.517170]  kasan_save_stack+0x3c/0x68
[   18.517258]  kasan_save_track+0x20/0x40
[   18.517349]  kasan_save_alloc_info+0x40/0x58
[   18.517424]  __kasan_kmalloc+0xd4/0xd8
[   18.517500]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.517635]  kmalloc_uaf2+0xc4/0x468
[   18.517720]  kunit_try_run_case+0x170/0x3f0
[   18.517843]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.517961]  kthread+0x328/0x630
[   18.518090]  ret_from_fork+0x10/0x20
[   18.518242] 
[   18.518329] Freed by task 189:
[   18.518359]  kasan_save_stack+0x3c/0x68
[   18.518399]  kasan_save_track+0x20/0x40
[   18.518570]  kasan_save_free_info+0x4c/0x78
[   18.518841]  __kasan_slab_free+0x6c/0x98
[   18.518932]  kfree+0x214/0x3c8
[   18.519011]  kmalloc_uaf2+0x134/0x468
[   18.519104]  kunit_try_run_case+0x170/0x3f0
[   18.519537]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.519639]  kthread+0x328/0x630
[   18.519733]  ret_from_fork+0x10/0x20
[   18.519844] 
[   18.519906] The buggy address belongs to the object at fff00000c7731180
[   18.519906]  which belongs to the cache kmalloc-64 of size 64
[   18.520029] The buggy address is located 40 bytes inside of
[   18.520029]  freed 64-byte region [fff00000c7731180, fff00000c77311c0)
[   18.520192] 
[   18.520301] The buggy address belongs to the physical page:
[   18.520340] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107731
[   18.520403] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.520859] page_type: f5(slab)
[   18.520953] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   18.521196] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   18.521245] page dumped because: kasan: bad access detected
[   18.521281] 
[   18.521306] Memory state around the buggy address:
[   18.521432]  fff00000c7731080: 00 00 00 00 02 fc fc fc fc fc fc fc fc fc fc fc
[   18.521526]  fff00000c7731100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.521629] >fff00000c7731180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.521694]                                   ^
[   18.521750]  fff00000c7731200: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   18.521827]  fff00000c7731280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.521872] ==================================================================

[   11.792470] ==================================================================
[   11.793272] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   11.793620] Read of size 1 at addr ffff888102f040a8 by task kunit_try_catch/205
[   11.793900] 
[   11.794016] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.794065] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.794077] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.794100] Call Trace:
[   11.794114]  <TASK>
[   11.794136]  dump_stack_lvl+0x73/0xb0
[   11.794231]  print_report+0xd1/0x650
[   11.794258]  ? __virt_addr_valid+0x1db/0x2d0
[   11.794283]  ? kmalloc_uaf2+0x4a8/0x520
[   11.794301]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.794322]  ? kmalloc_uaf2+0x4a8/0x520
[   11.794341]  kasan_report+0x141/0x180
[   11.794361]  ? kmalloc_uaf2+0x4a8/0x520
[   11.794397]  __asan_report_load1_noabort+0x18/0x20
[   11.794420]  kmalloc_uaf2+0x4a8/0x520
[   11.794440]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   11.794459]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   11.794488]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   11.794511]  kunit_try_run_case+0x1a5/0x480
[   11.794536]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.794556]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.794579]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.794601]  ? __kthread_parkme+0x82/0x180
[   11.794622]  ? preempt_count_sub+0x50/0x80
[   11.794646]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.794668]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.794689]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.794710]  kthread+0x337/0x6f0
[   11.794729]  ? trace_preempt_on+0x20/0xc0
[   11.794752]  ? __pfx_kthread+0x10/0x10
[   11.794771]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.794790]  ? calculate_sigpending+0x7b/0xa0
[   11.794814]  ? __pfx_kthread+0x10/0x10
[   11.794834]  ret_from_fork+0x116/0x1d0
[   11.794852]  ? __pfx_kthread+0x10/0x10
[   11.794871]  ret_from_fork_asm+0x1a/0x30
[   11.794901]  </TASK>
[   11.794913] 
[   11.802549] Allocated by task 205:
[   11.802717]  kasan_save_stack+0x45/0x70
[   11.803128]  kasan_save_track+0x18/0x40
[   11.803291]  kasan_save_alloc_info+0x3b/0x50
[   11.803454]  __kasan_kmalloc+0xb7/0xc0
[   11.803657]  __kmalloc_cache_noprof+0x189/0x420
[   11.803881]  kmalloc_uaf2+0xc6/0x520
[   11.804263]  kunit_try_run_case+0x1a5/0x480
[   11.804466]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.804693]  kthread+0x337/0x6f0
[   11.804818]  ret_from_fork+0x116/0x1d0
[   11.804964]  ret_from_fork_asm+0x1a/0x30
[   11.805163] 
[   11.805263] Freed by task 205:
[   11.805432]  kasan_save_stack+0x45/0x70
[   11.805679]  kasan_save_track+0x18/0x40
[   11.805838]  kasan_save_free_info+0x3f/0x60
[   11.805982]  __kasan_slab_free+0x56/0x70
[   11.806118]  kfree+0x222/0x3f0
[   11.806233]  kmalloc_uaf2+0x14c/0x520
[   11.806465]  kunit_try_run_case+0x1a5/0x480
[   11.806671]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.806919]  kthread+0x337/0x6f0
[   11.807089]  ret_from_fork+0x116/0x1d0
[   11.807616]  ret_from_fork_asm+0x1a/0x30
[   11.807845] 
[   11.807992] The buggy address belongs to the object at ffff888102f04080
[   11.807992]  which belongs to the cache kmalloc-64 of size 64
[   11.808481] The buggy address is located 40 bytes inside of
[   11.808481]  freed 64-byte region [ffff888102f04080, ffff888102f040c0)
[   11.808900] 
[   11.808976] The buggy address belongs to the physical page:
[   11.809216] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102f04
[   11.809588] flags: 0x200000000000000(node=0|zone=2)
[   11.809931] page_type: f5(slab)
[   11.810132] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.810410] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.810738] page dumped because: kasan: bad access detected
[   11.811188] 
[   11.811285] Memory state around the buggy address:
[   11.811504]  ffff888102f03f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.811740]  ffff888102f04000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.812063] >ffff888102f04080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.812348]                                   ^
[   11.813056]  ffff888102f04100: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   11.813289]  ffff888102f04180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.814335] ==================================================================