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

Environment
qemu-arm64
qemu-x86_64

[   31.635337] ==================================================================
[   31.635394] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   31.635444] Read of size 1 at addr fff00000c907e0e8 by task kunit_try_catch/215
[   31.635493] 
[   31.635522] CPU: 0 UID: 0 PID: 215 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT 
[   31.635605] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.635630] Hardware name: linux,dummy-virt (DT)
[   31.635661] Call trace:
[   31.635685]  show_stack+0x20/0x38 (C)
[   31.635732]  dump_stack_lvl+0x8c/0xd0
[   31.635779]  print_report+0x118/0x5e8
[   31.635820]  kasan_report+0xdc/0x128
[   31.635862]  __asan_report_load1_noabort+0x20/0x30
[   31.635910]  kmalloc_uaf+0x300/0x338
[   31.635952]  kunit_try_run_case+0x170/0x3f0
[   31.635998]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.636528]  kthread+0x328/0x630
[   31.636835]  ret_from_fork+0x10/0x20
[   31.637096] 
[   31.637226] Allocated by task 215:
[   31.637279]  kasan_save_stack+0x3c/0x68
[   31.637643]  kasan_save_track+0x20/0x40
[   31.637711]  kasan_save_alloc_info+0x40/0x58
[   31.637772]  __kasan_kmalloc+0xd4/0xd8
[   31.637856]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.637958]  kmalloc_uaf+0xb8/0x338
[   31.638126]  kunit_try_run_case+0x170/0x3f0
[   31.638224]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.638536]  kthread+0x328/0x630
[   31.638699]  ret_from_fork+0x10/0x20
[   31.638857] 
[   31.638926] Freed by task 215:
[   31.639055]  kasan_save_stack+0x3c/0x68
[   31.639132]  kasan_save_track+0x20/0x40
[   31.639236]  kasan_save_free_info+0x4c/0x78
[   31.639305]  __kasan_slab_free+0x6c/0x98
[   31.639370]  kfree+0x214/0x3c8
[   31.639678]  kmalloc_uaf+0x11c/0x338
[   31.639768]  kunit_try_run_case+0x170/0x3f0
[   31.639842]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.639990]  kthread+0x328/0x630
[   31.640156]  ret_from_fork+0x10/0x20
[   31.640242] 
[   31.640568] The buggy address belongs to the object at fff00000c907e0e0
[   31.640568]  which belongs to the cache kmalloc-16 of size 16
[   31.640657] The buggy address is located 8 bytes inside of
[   31.640657]  freed 16-byte region [fff00000c907e0e0, fff00000c907e0f0)
[   31.640820] 
[   31.640869] The buggy address belongs to the physical page:
[   31.640928] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xfff00000c907e020 pfn:0x10907e
[   31.641251] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.641379] page_type: f5(slab)
[   31.641434] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   31.641532] raw: fff00000c907e020 000000008080007f 00000000f5000000 0000000000000000
[   31.641641] page dumped because: kasan: bad access detected
[   31.641724] 
[   31.641792] Memory state around the buggy address:
[   31.642106]  fff00000c907df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.642211]  fff00000c907e000: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.642285] >fff00000c907e080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.642354]                                                           ^
[   31.642495]  fff00000c907e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.642569]  fff00000c907e180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.642725] ==================================================================


[   25.061527] ==================================================================
[   25.061989] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   25.062220] Read of size 1 at addr ffff888105380c28 by task kunit_try_catch/232
[   25.062436] 
[   25.062520] CPU: 0 UID: 0 PID: 232 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT(voluntary) 
[   25.062569] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.062580] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.062601] Call Trace:
[   25.062613]  <TASK>
[   25.062636]  dump_stack_lvl+0x73/0xb0
[   25.062667]  print_report+0xd1/0x640
[   25.062689]  ? __virt_addr_valid+0x1db/0x2d0
[   25.062712]  ? kmalloc_uaf+0x320/0x380
[   25.062730]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.062755]  ? kmalloc_uaf+0x320/0x380
[   25.062774]  kasan_report+0x141/0x180
[   25.062794]  ? kmalloc_uaf+0x320/0x380
[   25.062817]  __asan_report_load1_noabort+0x18/0x20
[   25.062841]  kmalloc_uaf+0x320/0x380
[   25.062860]  ? __pfx_kmalloc_uaf+0x10/0x10
[   25.062879]  ? __schedule+0x10da/0x2b60
[   25.062902]  ? __pfx_read_tsc+0x10/0x10
[   25.062923]  ? ktime_get_ts64+0x86/0x230
[   25.062947]  kunit_try_run_case+0x1a5/0x480
[   25.062971]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.062992]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.063025]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.063056]  ? __kthread_parkme+0x82/0x180
[   25.063075]  ? preempt_count_sub+0x50/0x80
[   25.063097]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.063118]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.063140]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.063161]  kthread+0x337/0x6f0
[   25.063180]  ? trace_preempt_on+0x20/0xc0
[   25.063607]  ? __pfx_kthread+0x10/0x10
[   25.063646]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.063696]  ? calculate_sigpending+0x7b/0xa0
[   25.063723]  ? __pfx_kthread+0x10/0x10
[   25.063750]  ret_from_fork+0x116/0x1d0
[   25.063770]  ? __pfx_kthread+0x10/0x10
[   25.063967]  ret_from_fork_asm+0x1a/0x30
[   25.064001]  </TASK>
[   25.064040] 
[   25.076858] Allocated by task 232:
[   25.077174]  kasan_save_stack+0x45/0x70
[   25.077602]  kasan_save_track+0x18/0x40
[   25.077835]  kasan_save_alloc_info+0x3b/0x50
[   25.078171]  __kasan_kmalloc+0xb7/0xc0
[   25.078533]  __kmalloc_cache_noprof+0x189/0x420
[   25.078738]  kmalloc_uaf+0xaa/0x380
[   25.078955]  kunit_try_run_case+0x1a5/0x480
[   25.079337]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.079674]  kthread+0x337/0x6f0
[   25.079814]  ret_from_fork+0x116/0x1d0
[   25.080294]  ret_from_fork_asm+0x1a/0x30
[   25.080522] 
[   25.080595] Freed by task 232:
[   25.080776]  kasan_save_stack+0x45/0x70
[   25.081281]  kasan_save_track+0x18/0x40
[   25.081444]  kasan_save_free_info+0x3f/0x60
[   25.081668]  __kasan_slab_free+0x56/0x70
[   25.082118]  kfree+0x222/0x3f0
[   25.082373]  kmalloc_uaf+0x12c/0x380
[   25.082662]  kunit_try_run_case+0x1a5/0x480
[   25.082912]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.083396]  kthread+0x337/0x6f0
[   25.083562]  ret_from_fork+0x116/0x1d0
[   25.083731]  ret_from_fork_asm+0x1a/0x30
[   25.083975] 
[   25.084065] The buggy address belongs to the object at ffff888105380c20
[   25.084065]  which belongs to the cache kmalloc-16 of size 16
[   25.085149] The buggy address is located 8 bytes inside of
[   25.085149]  freed 16-byte region [ffff888105380c20, ffff888105380c30)
[   25.085753] 
[   25.085858] The buggy address belongs to the physical page:
[   25.086247] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105380
[   25.086785] flags: 0x200000000000000(node=0|zone=2)
[   25.087254] page_type: f5(slab)
[   25.087527] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   25.087896] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   25.088351] page dumped because: kasan: bad access detected
[   25.088607] 
[   25.088696] Memory state around the buggy address:
[   25.089152]  ffff888105380b00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.089460]  ffff888105380b80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.089751] >ffff888105380c00: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   25.090283]                                   ^
[   25.090525]  ffff888105380c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.090972]  ffff888105380d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.091256] ==================================================================