Hay
Date
July 1, 2025, 3:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.173166] ==================================================================
[   17.173251] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   17.173792] Read of size 1 at addr fff00000c57c9f28 by task kunit_try_catch/189
[   17.174767] 
[   17.175124] CPU: 1 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   17.175605] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.175701] Hardware name: linux,dummy-virt (DT)
[   17.175997] Call trace:
[   17.176083]  show_stack+0x20/0x38 (C)
[   17.176168]  dump_stack_lvl+0x8c/0xd0
[   17.176528]  print_report+0x118/0x608
[   17.176710]  kasan_report+0xdc/0x128
[   17.176838]  __asan_report_load1_noabort+0x20/0x30
[   17.177149]  kmalloc_uaf2+0x3f4/0x468
[   17.177290]  kunit_try_run_case+0x170/0x3f0
[   17.177522]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.177744]  kthread+0x328/0x630
[   17.177913]  ret_from_fork+0x10/0x20
[   17.178007] 
[   17.178150] Allocated by task 189:
[   17.178183]  kasan_save_stack+0x3c/0x68
[   17.178280]  kasan_save_track+0x20/0x40
[   17.178634]  kasan_save_alloc_info+0x40/0x58
[   17.178716]  __kasan_kmalloc+0xd4/0xd8
[   17.178754]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.179077]  kmalloc_uaf2+0xc4/0x468
[   17.179247]  kunit_try_run_case+0x170/0x3f0
[   17.179300]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.179614]  kthread+0x328/0x630
[   17.179767]  ret_from_fork+0x10/0x20
[   17.179860] 
[   17.179995] Freed by task 189:
[   17.180025]  kasan_save_stack+0x3c/0x68
[   17.180092]  kasan_save_track+0x20/0x40
[   17.180460]  kasan_save_free_info+0x4c/0x78
[   17.180530]  __kasan_slab_free+0x6c/0x98
[   17.180692]  kfree+0x214/0x3c8
[   17.180906]  kmalloc_uaf2+0x134/0x468
[   17.180966]  kunit_try_run_case+0x170/0x3f0
[   17.181006]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.181445]  kthread+0x328/0x630
[   17.181501]  ret_from_fork+0x10/0x20
[   17.181539] 
[   17.181559] The buggy address belongs to the object at fff00000c57c9f00
[   17.181559]  which belongs to the cache kmalloc-64 of size 64
[   17.181635] The buggy address is located 40 bytes inside of
[   17.181635]  freed 64-byte region [fff00000c57c9f00, fff00000c57c9f40)
[   17.181698] 
[   17.181721] The buggy address belongs to the physical page:
[   17.181753] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1057c9
[   17.181815] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.181867] page_type: f5(slab)
[   17.181910] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   17.181963] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   17.182005] page dumped because: kasan: bad access detected
[   17.182037] 
[   17.182055] Memory state around the buggy address:
[   17.182090]  fff00000c57c9e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.182135]  fff00000c57c9e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.182180] >fff00000c57c9f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.182221]                                   ^
[   17.182253]  fff00000c57c9f80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   17.182296]  fff00000c57ca000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.182337] ==================================================================

[   11.923184] ==================================================================
[   11.924253] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   11.924682] Read of size 1 at addr ffff8881027cbfa8 by task kunit_try_catch/205
[   11.925428] 
[   11.925799] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.925850] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.925862] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.925883] Call Trace:
[   11.925895]  <TASK>
[   11.925914]  dump_stack_lvl+0x73/0xb0
[   11.925945]  print_report+0xd1/0x650
[   11.925968]  ? __virt_addr_valid+0x1db/0x2d0
[   11.925992]  ? kmalloc_uaf2+0x4a8/0x520
[   11.926011]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.926046]  ? kmalloc_uaf2+0x4a8/0x520
[   11.926065]  kasan_report+0x141/0x180
[   11.926086]  ? kmalloc_uaf2+0x4a8/0x520
[   11.926109]  __asan_report_load1_noabort+0x18/0x20
[   11.926132]  kmalloc_uaf2+0x4a8/0x520
[   11.926151]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   11.926169]  ? finish_task_switch.isra.0+0x153/0x700
[   11.926191]  ? __switch_to+0x47/0xf50
[   11.926218]  ? __schedule+0x10cc/0x2b60
[   11.926239]  ? __pfx_read_tsc+0x10/0x10
[   11.926260]  ? ktime_get_ts64+0x86/0x230
[   11.926283]  kunit_try_run_case+0x1a5/0x480
[   11.926306]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.926328]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.926350]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.926371]  ? __kthread_parkme+0x82/0x180
[   11.926391]  ? preempt_count_sub+0x50/0x80
[   11.926412]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.926434]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.926456]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.926477]  kthread+0x337/0x6f0
[   11.926495]  ? trace_preempt_on+0x20/0xc0
[   11.926518]  ? __pfx_kthread+0x10/0x10
[   11.926537]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.926556]  ? calculate_sigpending+0x7b/0xa0
[   11.926579]  ? __pfx_kthread+0x10/0x10
[   11.926599]  ret_from_fork+0x116/0x1d0
[   11.926616]  ? __pfx_kthread+0x10/0x10
[   11.926636]  ret_from_fork_asm+0x1a/0x30
[   11.926666]  </TASK>
[   11.926678] 
[   11.941155] Allocated by task 205:
[   11.941352]  kasan_save_stack+0x45/0x70
[   11.941504]  kasan_save_track+0x18/0x40
[   11.941682]  kasan_save_alloc_info+0x3b/0x50
[   11.942099]  __kasan_kmalloc+0xb7/0xc0
[   11.942446]  __kmalloc_cache_noprof+0x189/0x420
[   11.942941]  kmalloc_uaf2+0xc6/0x520
[   11.943288]  kunit_try_run_case+0x1a5/0x480
[   11.943823]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.944018]  kthread+0x337/0x6f0
[   11.944162]  ret_from_fork+0x116/0x1d0
[   11.944294]  ret_from_fork_asm+0x1a/0x30
[   11.944433] 
[   11.944503] Freed by task 205:
[   11.944614]  kasan_save_stack+0x45/0x70
[   11.945299]  kasan_save_track+0x18/0x40
[   11.945691]  kasan_save_free_info+0x3f/0x60
[   11.946180]  __kasan_slab_free+0x56/0x70
[   11.946530]  kfree+0x222/0x3f0
[   11.946850]  kmalloc_uaf2+0x14c/0x520
[   11.947250]  kunit_try_run_case+0x1a5/0x480
[   11.947787]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.948290]  kthread+0x337/0x6f0
[   11.948596]  ret_from_fork+0x116/0x1d0
[   11.949061]  ret_from_fork_asm+0x1a/0x30
[   11.949410] 
[   11.949482] The buggy address belongs to the object at ffff8881027cbf80
[   11.949482]  which belongs to the cache kmalloc-64 of size 64
[   11.949941] The buggy address is located 40 bytes inside of
[   11.949941]  freed 64-byte region [ffff8881027cbf80, ffff8881027cbfc0)
[   11.951167] 
[   11.951333] The buggy address belongs to the physical page:
[   11.951847] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027cb
[   11.952668] flags: 0x200000000000000(node=0|zone=2)
[   11.952976] page_type: f5(slab)
[   11.953117] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.953350] raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
[   11.953577] page dumped because: kasan: bad access detected
[   11.954087] 
[   11.954245] Memory state around the buggy address:
[   11.954719]  ffff8881027cbe80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.955327]  ffff8881027cbf00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.956260] >ffff8881027cbf80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.956482]                                   ^
[   11.956696]  ffff8881027cc000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   11.957479]  ffff8881027cc080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.958306] ==================================================================