Hay
Date
July 23, 2025, 3:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.190127] ==================================================================
[   31.190214] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   31.190273] Read of size 1 at addr fff00000c9a6faa8 by task kunit_try_catch/221
[   31.190326] 
[   31.190375] CPU: 0 UID: 0 PID: 221 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   31.190467] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   31.190507] Hardware name: linux,dummy-virt (DT)
[   31.190539] Call trace:
[   31.190561]  show_stack+0x20/0x38 (C)
[   31.190611]  dump_stack_lvl+0x8c/0xd0
[   31.190659]  print_report+0x118/0x5e8
[   31.190704]  kasan_report+0xdc/0x128
[   31.190747]  __asan_report_load1_noabort+0x20/0x30
[   31.190796]  kmalloc_uaf2+0x3f4/0x468
[   31.190841]  kunit_try_run_case+0x170/0x3f0
[   31.190894]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.191764]  kthread+0x328/0x630
[   31.191830]  ret_from_fork+0x10/0x20
[   31.192181] 
[   31.192218] Allocated by task 221:
[   31.192250]  kasan_save_stack+0x3c/0x68
[   31.192299]  kasan_save_track+0x20/0x40
[   31.192335]  kasan_save_alloc_info+0x40/0x58
[   31.192373]  __kasan_kmalloc+0xd4/0xd8
[   31.192569]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.192812]  kmalloc_uaf2+0xc4/0x468
[   31.193050]  kunit_try_run_case+0x170/0x3f0
[   31.193250]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.193321]  kthread+0x328/0x630
[   31.193464]  ret_from_fork+0x10/0x20
[   31.193540] 
[   31.193559] Freed by task 221:
[   31.193801]  kasan_save_stack+0x3c/0x68
[   31.193978]  kasan_save_track+0x20/0x40
[   31.194088]  kasan_save_free_info+0x4c/0x78
[   31.194145]  __kasan_slab_free+0x6c/0x98
[   31.194340]  kfree+0x214/0x3c8
[   31.194577]  kmalloc_uaf2+0x134/0x468
[   31.194730]  kunit_try_run_case+0x170/0x3f0
[   31.194821]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.194882]  kthread+0x328/0x630
[   31.195080]  ret_from_fork+0x10/0x20
[   31.195336] 
[   31.195362] The buggy address belongs to the object at fff00000c9a6fa80
[   31.195362]  which belongs to the cache kmalloc-64 of size 64
[   31.195635] The buggy address is located 40 bytes inside of
[   31.195635]  freed 64-byte region [fff00000c9a6fa80, fff00000c9a6fac0)
[   31.195858] 
[   31.195882] The buggy address belongs to the physical page:
[   31.195952] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a6f
[   31.196468] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.196577] page_type: f5(slab)
[   31.196747] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   31.196987] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   31.197127] page dumped because: kasan: bad access detected
[   31.197191] 
[   31.197255] Memory state around the buggy address:
[   31.197327]  fff00000c9a6f980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.197538]  fff00000c9a6fa00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.197705] >fff00000c9a6fa80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.197936]                                   ^
[   31.198154]  fff00000c9a6fb00: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   31.198284]  fff00000c9a6fb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.198367] ==================================================================

[   25.495319] ==================================================================
[   25.496596] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   25.497246] Read of size 1 at addr ffff8881055e70a8 by task kunit_try_catch/237
[   25.497942] 
[   25.498128] CPU: 1 UID: 0 PID: 237 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   25.498188] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.498200] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.498221] Call Trace:
[   25.498235]  <TASK>
[   25.498252]  dump_stack_lvl+0x73/0xb0
[   25.498281]  print_report+0xd1/0x640
[   25.498304]  ? __virt_addr_valid+0x1db/0x2d0
[   25.498329]  ? kmalloc_uaf2+0x4a8/0x520
[   25.498358]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.498384]  ? kmalloc_uaf2+0x4a8/0x520
[   25.498404]  kasan_report+0x141/0x180
[   25.498426]  ? kmalloc_uaf2+0x4a8/0x520
[   25.498450]  __asan_report_load1_noabort+0x18/0x20
[   25.498474]  kmalloc_uaf2+0x4a8/0x520
[   25.498495]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   25.498514]  ? finish_task_switch.isra.0+0x153/0x700
[   25.498537]  ? __switch_to+0x47/0xf80
[   25.498563]  ? __schedule+0x10da/0x2b60
[   25.498588]  ? __pfx_read_tsc+0x10/0x10
[   25.498610]  ? ktime_get_ts64+0x86/0x230
[   25.498636]  kunit_try_run_case+0x1a5/0x480
[   25.498660]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.498683]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.498708]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.498735]  ? __kthread_parkme+0x82/0x180
[   25.498756]  ? preempt_count_sub+0x50/0x80
[   25.498779]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.498803]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.498826]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.498849]  kthread+0x337/0x6f0
[   25.498869]  ? trace_preempt_on+0x20/0xc0
[   25.498893]  ? __pfx_kthread+0x10/0x10
[   25.498914]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.498937]  ? calculate_sigpending+0x7b/0xa0
[   25.498970]  ? __pfx_kthread+0x10/0x10
[   25.498991]  ret_from_fork+0x116/0x1d0
[   25.499011]  ? __pfx_kthread+0x10/0x10
[   25.499031]  ret_from_fork_asm+0x1a/0x30
[   25.499061]  </TASK>
[   25.499072] 
[   25.510421] Allocated by task 237:
[   25.510783]  kasan_save_stack+0x45/0x70
[   25.511166]  kasan_save_track+0x18/0x40
[   25.511554]  kasan_save_alloc_info+0x3b/0x50
[   25.512043]  __kasan_kmalloc+0xb7/0xc0
[   25.512180]  __kmalloc_cache_noprof+0x189/0x420
[   25.512331]  kmalloc_uaf2+0xc6/0x520
[   25.512497]  kunit_try_run_case+0x1a5/0x480
[   25.512642]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.512812]  kthread+0x337/0x6f0
[   25.512927]  ret_from_fork+0x116/0x1d0
[   25.513054]  ret_from_fork_asm+0x1a/0x30
[   25.513340] 
[   25.513527] Freed by task 237:
[   25.513831]  kasan_save_stack+0x45/0x70
[   25.514195]  kasan_save_track+0x18/0x40
[   25.514598]  kasan_save_free_info+0x3f/0x60
[   25.515026]  __kasan_slab_free+0x56/0x70
[   25.515382]  kfree+0x222/0x3f0
[   25.515668]  kmalloc_uaf2+0x14c/0x520
[   25.516063]  kunit_try_run_case+0x1a5/0x480
[   25.516464]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.517015]  kthread+0x337/0x6f0
[   25.517310]  ret_from_fork+0x116/0x1d0
[   25.517634]  ret_from_fork_asm+0x1a/0x30
[   25.518019] 
[   25.518367] The buggy address belongs to the object at ffff8881055e7080
[   25.518367]  which belongs to the cache kmalloc-64 of size 64
[   25.519236] The buggy address is located 40 bytes inside of
[   25.519236]  freed 64-byte region [ffff8881055e7080, ffff8881055e70c0)
[   25.520301] 
[   25.520545] The buggy address belongs to the physical page:
[   25.520771] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1055e7
[   25.521530] flags: 0x200000000000000(node=0|zone=2)
[   25.522080] page_type: f5(slab)
[   25.522414] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   25.523154] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   25.523610] page dumped because: kasan: bad access detected
[   25.523930] 
[   25.524117] Memory state around the buggy address:
[   25.524287]  ffff8881055e6f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.524806]  ffff8881055e7000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.525474] >ffff8881055e7080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.526162]                                   ^
[   25.526648]  ffff8881055e7100: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   25.526940]  ffff8881055e7180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.527685] ==================================================================