Hay
Date
July 18, 2025, 1:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.508182] ==================================================================
[   31.508373] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   31.508572] Read of size 16 at addr fff00000c907e0c0 by task kunit_try_catch/199
[   31.508681] 
[   31.508744] CPU: 0 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT 
[   31.508998] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.509175] Hardware name: linux,dummy-virt (DT)
[   31.509280] Call trace:
[   31.509303]  show_stack+0x20/0x38 (C)
[   31.509409]  dump_stack_lvl+0x8c/0xd0
[   31.509678]  print_report+0x118/0x5e8
[   31.509849]  kasan_report+0xdc/0x128
[   31.510044]  __asan_report_load16_noabort+0x20/0x30
[   31.510303]  kmalloc_uaf_16+0x3bc/0x438
[   31.510363]  kunit_try_run_case+0x170/0x3f0
[   31.510587]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.510789]  kthread+0x328/0x630
[   31.510997]  ret_from_fork+0x10/0x20
[   31.511266] 
[   31.511414] Allocated by task 199:
[   31.511591]  kasan_save_stack+0x3c/0x68
[   31.511952]  kasan_save_track+0x20/0x40
[   31.512022]  kasan_save_alloc_info+0x40/0x58
[   31.512076]  __kasan_kmalloc+0xd4/0xd8
[   31.512220]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.512260]  kmalloc_uaf_16+0x140/0x438
[   31.512312]  kunit_try_run_case+0x170/0x3f0
[   31.512347]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.512586]  kthread+0x328/0x630
[   31.512825]  ret_from_fork+0x10/0x20
[   31.512926] 
[   31.513017] Freed by task 199:
[   31.513061]  kasan_save_stack+0x3c/0x68
[   31.513107]  kasan_save_track+0x20/0x40
[   31.513457]  kasan_save_free_info+0x4c/0x78
[   31.513513]  __kasan_slab_free+0x6c/0x98
[   31.513844]  kfree+0x214/0x3c8
[   31.513960]  kmalloc_uaf_16+0x190/0x438
[   31.513999]  kunit_try_run_case+0x170/0x3f0
[   31.514051]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.514105]  kthread+0x328/0x630
[   31.514137]  ret_from_fork+0x10/0x20
[   31.514172] 
[   31.514191] The buggy address belongs to the object at fff00000c907e0c0
[   31.514191]  which belongs to the cache kmalloc-16 of size 16
[   31.514374] The buggy address is located 0 bytes inside of
[   31.514374]  freed 16-byte region [fff00000c907e0c0, fff00000c907e0d0)
[   31.514453] 
[   31.514482] The buggy address belongs to the physical page:
[   31.514526] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xfff00000c907e020 pfn:0x10907e
[   31.514591] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.514646] page_type: f5(slab)
[   31.514700] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   31.514749] raw: fff00000c907e020 000000008080007f 00000000f5000000 0000000000000000
[   31.514787] page dumped because: kasan: bad access detected
[   31.514816] 
[   31.514833] Memory state around the buggy address:
[   31.514863]  fff00000c907df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.514905]  fff00000c907e000: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.514945] >fff00000c907e080: fa fb fc fc 00 00 fc fc fa fb fc fc fc fc fc fc
[   31.514981]                                            ^
[   31.515013]  fff00000c907e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.515062]  fff00000c907e180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.515108] ==================================================================


[   24.853252] ==================================================================
[   24.853626] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   24.854194] Read of size 16 at addr ffff888105380c00 by task kunit_try_catch/216
[   24.854848] 
[   24.855020] CPU: 0 UID: 0 PID: 216 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT(voluntary) 
[   24.855070] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.855081] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.855103] Call Trace:
[   24.855115]  <TASK>
[   24.855131]  dump_stack_lvl+0x73/0xb0
[   24.855165]  print_report+0xd1/0x640
[   24.855188]  ? __virt_addr_valid+0x1db/0x2d0
[   24.855228]  ? kmalloc_uaf_16+0x47b/0x4c0
[   24.855247]  ? kasan_complete_mode_report_info+0x64/0x200
[   24.855272]  ? kmalloc_uaf_16+0x47b/0x4c0
[   24.855292]  kasan_report+0x141/0x180
[   24.855313]  ? kmalloc_uaf_16+0x47b/0x4c0
[   24.855337]  __asan_report_load16_noabort+0x18/0x20
[   24.855361]  kmalloc_uaf_16+0x47b/0x4c0
[   24.855381]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   24.855401]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   24.855426]  ? trace_hardirqs_on+0x37/0xe0
[   24.855449]  ? __pfx_read_tsc+0x10/0x10
[   24.855471]  ? ktime_get_ts64+0x86/0x230
[   24.855511]  kunit_try_run_case+0x1a5/0x480
[   24.855554]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.855588]  ? queued_spin_lock_slowpath+0x116/0xb40
[   24.855623]  ? __kthread_parkme+0x82/0x180
[   24.855643]  ? preempt_count_sub+0x50/0x80
[   24.855665]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.855687]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.855710]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.855732]  kthread+0x337/0x6f0
[   24.855750]  ? trace_preempt_on+0x20/0xc0
[   24.855772]  ? __pfx_kthread+0x10/0x10
[   24.855791]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.855838]  ? calculate_sigpending+0x7b/0xa0
[   24.855862]  ? __pfx_kthread+0x10/0x10
[   24.855882]  ret_from_fork+0x116/0x1d0
[   24.855901]  ? __pfx_kthread+0x10/0x10
[   24.855920]  ret_from_fork_asm+0x1a/0x30
[   24.855951]  </TASK>
[   24.855962] 
[   24.868450] Allocated by task 216:
[   24.868593]  kasan_save_stack+0x45/0x70
[   24.868739]  kasan_save_track+0x18/0x40
[   24.869110]  kasan_save_alloc_info+0x3b/0x50
[   24.869515]  __kasan_kmalloc+0xb7/0xc0
[   24.869836]  __kmalloc_cache_noprof+0x189/0x420
[   24.870319]  kmalloc_uaf_16+0x15b/0x4c0
[   24.870734]  kunit_try_run_case+0x1a5/0x480
[   24.871190]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.871514]  kthread+0x337/0x6f0
[   24.871631]  ret_from_fork+0x116/0x1d0
[   24.871758]  ret_from_fork_asm+0x1a/0x30
[   24.872235] 
[   24.872388] Freed by task 216:
[   24.872655]  kasan_save_stack+0x45/0x70
[   24.873022]  kasan_save_track+0x18/0x40
[   24.873494]  kasan_save_free_info+0x3f/0x60
[   24.873881]  __kasan_slab_free+0x56/0x70
[   24.874336]  kfree+0x222/0x3f0
[   24.874675]  kmalloc_uaf_16+0x1d6/0x4c0
[   24.875078]  kunit_try_run_case+0x1a5/0x480
[   24.875240]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.875407]  kthread+0x337/0x6f0
[   24.875519]  ret_from_fork+0x116/0x1d0
[   24.875643]  ret_from_fork_asm+0x1a/0x30
[   24.875775] 
[   24.875977] The buggy address belongs to the object at ffff888105380c00
[   24.875977]  which belongs to the cache kmalloc-16 of size 16
[   24.877113] The buggy address is located 0 bytes inside of
[   24.877113]  freed 16-byte region [ffff888105380c00, ffff888105380c10)
[   24.878340] 
[   24.878504] The buggy address belongs to the physical page:
[   24.879088] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105380
[   24.879833] flags: 0x200000000000000(node=0|zone=2)
[   24.880405] page_type: f5(slab)
[   24.880540] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   24.880764] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   24.881447] page dumped because: kasan: bad access detected
[   24.881934] 
[   24.882102] Memory state around the buggy address:
[   24.882714]  ffff888105380b00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   24.883365]  ffff888105380b80: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
[   24.883581] >ffff888105380c00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.883787]                    ^
[   24.884167]  ffff888105380c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.884871]  ffff888105380d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.885836] ==================================================================