Hay
Date
July 24, 2025, 4:41 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.633761] ==================================================================
[   32.633845] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   32.634341] Read of size 1 at addr fff00000c86834e8 by task kunit_try_catch/215
[   32.634460] 
[   32.634503] CPU: 0 UID: 0 PID: 215 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250724 #1 PREEMPT 
[   32.634773] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.634856] Hardware name: linux,dummy-virt (DT)
[   32.634891] Call trace:
[   32.635072]  show_stack+0x20/0x38 (C)
[   32.635159]  dump_stack_lvl+0x8c/0xd0
[   32.635324]  print_report+0x118/0x5e8
[   32.635424]  kasan_report+0xdc/0x128
[   32.635487]  __asan_report_load1_noabort+0x20/0x30
[   32.635703]  kmalloc_uaf+0x300/0x338
[   32.635965]  kunit_try_run_case+0x170/0x3f0
[   32.636475]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.636569]  kthread+0x328/0x630
[   32.636786]  ret_from_fork+0x10/0x20
[   32.637043] 
[   32.637112] Allocated by task 215:
[   32.637241]  kasan_save_stack+0x3c/0x68
[   32.637334]  kasan_save_track+0x20/0x40
[   32.637404]  kasan_save_alloc_info+0x40/0x58
[   32.637538]  __kasan_kmalloc+0xd4/0xd8
[   32.637576]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.637805]  kmalloc_uaf+0xb8/0x338
[   32.638050]  kunit_try_run_case+0x170/0x3f0
[   32.638097]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.638144]  kthread+0x328/0x630
[   32.638240]  ret_from_fork+0x10/0x20
[   32.638287] 
[   32.638315] Freed by task 215:
[   32.638344]  kasan_save_stack+0x3c/0x68
[   32.638381]  kasan_save_track+0x20/0x40
[   32.638424]  kasan_save_free_info+0x4c/0x78
[   32.638467]  __kasan_slab_free+0x6c/0x98
[   32.638504]  kfree+0x214/0x3c8
[   32.638544]  kmalloc_uaf+0x11c/0x338
[   32.638579]  kunit_try_run_case+0x170/0x3f0
[   32.638623]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.638666]  kthread+0x328/0x630
[   32.638699]  ret_from_fork+0x10/0x20
[   32.638742] 
[   32.638961] The buggy address belongs to the object at fff00000c86834e0
[   32.638961]  which belongs to the cache kmalloc-16 of size 16
[   32.639233] The buggy address is located 8 bytes inside of
[   32.639233]  freed 16-byte region [fff00000c86834e0, fff00000c86834f0)
[   32.639343] 
[   32.639387] The buggy address belongs to the physical page:
[   32.639619] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x108683
[   32.639839] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.639946] page_type: f5(slab)
[   32.640087] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   32.640196] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   32.640240] page dumped because: kasan: bad access detected
[   32.640443] 
[   32.640684] Memory state around the buggy address:
[   32.640821]  fff00000c8683380: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.640936]  fff00000c8683400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.641012] >fff00000c8683480: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.641173]                                                           ^
[   32.641237]  fff00000c8683500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.641506]  fff00000c8683580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.641810] ==================================================================

[   27.097836] ==================================================================
[   27.098593] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   27.099227] Read of size 1 at addr ffff888105424ac8 by task kunit_try_catch/232
[   27.099603] 
[   27.099709] CPU: 0 UID: 0 PID: 232 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250724 #1 PREEMPT(voluntary) 
[   27.099761] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   27.099774] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.099797] Call Trace:
[   27.099809]  <TASK>
[   27.099913]  dump_stack_lvl+0x73/0xb0
[   27.099950]  print_report+0xd1/0x640
[   27.099974]  ? __virt_addr_valid+0x1db/0x2d0
[   27.099999]  ? kmalloc_uaf+0x320/0x380
[   27.100040]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.100079]  ? kmalloc_uaf+0x320/0x380
[   27.100099]  kasan_report+0x141/0x180
[   27.100121]  ? kmalloc_uaf+0x320/0x380
[   27.100146]  __asan_report_load1_noabort+0x18/0x20
[   27.100170]  kmalloc_uaf+0x320/0x380
[   27.100190]  ? __pfx_kmalloc_uaf+0x10/0x10
[   27.100210]  ? __schedule+0x10da/0x2b60
[   27.100236]  ? __pfx_read_tsc+0x10/0x10
[   27.100257]  ? ktime_get_ts64+0x86/0x230
[   27.100283]  kunit_try_run_case+0x1a5/0x480
[   27.100308]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.100330]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.100355]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.100380]  ? __kthread_parkme+0x82/0x180
[   27.100400]  ? preempt_count_sub+0x50/0x80
[   27.100424]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.100447]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.100470]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.100492]  kthread+0x337/0x6f0
[   27.100513]  ? trace_preempt_on+0x20/0xc0
[   27.100536]  ? __pfx_kthread+0x10/0x10
[   27.100556]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.100590]  ? calculate_sigpending+0x7b/0xa0
[   27.100613]  ? __pfx_kthread+0x10/0x10
[   27.100634]  ret_from_fork+0x116/0x1d0
[   27.100654]  ? __pfx_kthread+0x10/0x10
[   27.100674]  ret_from_fork_asm+0x1a/0x30
[   27.100705]  </TASK>
[   27.100716] 
[   27.108172] Allocated by task 232:
[   27.108308]  kasan_save_stack+0x45/0x70
[   27.108471]  kasan_save_track+0x18/0x40
[   27.108673]  kasan_save_alloc_info+0x3b/0x50
[   27.109059]  __kasan_kmalloc+0xb7/0xc0
[   27.109236]  __kmalloc_cache_noprof+0x189/0x420
[   27.109455]  kmalloc_uaf+0xaa/0x380
[   27.109636]  kunit_try_run_case+0x1a5/0x480
[   27.109841]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.110311]  kthread+0x337/0x6f0
[   27.110462]  ret_from_fork+0x116/0x1d0
[   27.110598]  ret_from_fork_asm+0x1a/0x30
[   27.110845] 
[   27.110964] Freed by task 232:
[   27.111113]  kasan_save_stack+0x45/0x70
[   27.111303]  kasan_save_track+0x18/0x40
[   27.111498]  kasan_save_free_info+0x3f/0x60
[   27.111663]  __kasan_slab_free+0x56/0x70
[   27.111961]  kfree+0x222/0x3f0
[   27.112103]  kmalloc_uaf+0x12c/0x380
[   27.112277]  kunit_try_run_case+0x1a5/0x480
[   27.112441]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.112727]  kthread+0x337/0x6f0
[   27.112911]  ret_from_fork+0x116/0x1d0
[   27.113066]  ret_from_fork_asm+0x1a/0x30
[   27.113194] 
[   27.113284] The buggy address belongs to the object at ffff888105424ac0
[   27.113284]  which belongs to the cache kmalloc-16 of size 16
[   27.114177] The buggy address is located 8 bytes inside of
[   27.114177]  freed 16-byte region [ffff888105424ac0, ffff888105424ad0)
[   27.114748] 
[   27.114850] The buggy address belongs to the physical page:
[   27.115129] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105424
[   27.115476] flags: 0x200000000000000(node=0|zone=2)
[   27.115735] page_type: f5(slab)
[   27.115898] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   27.116222] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   27.116743] page dumped because: kasan: bad access detected
[   27.116981] 
[   27.117061] Memory state around the buggy address:
[   27.117205]  ffff888105424980: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.117401]  ffff888105424a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.117610] >ffff888105424a80: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   27.117812]                                               ^
[   27.118329]  ffff888105424b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.118649]  ffff888105424b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.119294] ==================================================================