Hay
Date
July 12, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.641083] ==================================================================
[   19.641614] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   19.641727] Read of size 1 at addr fff00000c4561b08 by task kunit_try_catch/185
[   19.642059] 
[   19.642228] CPU: 0 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.642525] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.642611] Hardware name: linux,dummy-virt (DT)
[   19.642786] Call trace:
[   19.642920]  show_stack+0x20/0x38 (C)
[   19.643117]  dump_stack_lvl+0x8c/0xd0
[   19.643307]  print_report+0x118/0x608
[   19.643417]  kasan_report+0xdc/0x128
[   19.643786]  __asan_report_load1_noabort+0x20/0x30
[   19.643961]  kmalloc_uaf+0x300/0x338
[   19.644075]  kunit_try_run_case+0x170/0x3f0
[   19.644273]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.644477]  kthread+0x328/0x630
[   19.644570]  ret_from_fork+0x10/0x20
[   19.644936] 
[   19.645321] Allocated by task 185:
[   19.645500]  kasan_save_stack+0x3c/0x68
[   19.645706]  kasan_save_track+0x20/0x40
[   19.645858]  kasan_save_alloc_info+0x40/0x58
[   19.645990]  __kasan_kmalloc+0xd4/0xd8
[   19.646072]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.646182]  kmalloc_uaf+0xb8/0x338
[   19.646261]  kunit_try_run_case+0x170/0x3f0
[   19.646334]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.646414]  kthread+0x328/0x630
[   19.646481]  ret_from_fork+0x10/0x20
[   19.646573] 
[   19.646623] Freed by task 185:
[   19.646696]  kasan_save_stack+0x3c/0x68
[   19.646784]  kasan_save_track+0x20/0x40
[   19.646893]  kasan_save_free_info+0x4c/0x78
[   19.647030]  __kasan_slab_free+0x6c/0x98
[   19.647144]  kfree+0x214/0x3c8
[   19.647230]  kmalloc_uaf+0x11c/0x338
[   19.647312]  kunit_try_run_case+0x170/0x3f0
[   19.647404]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.647510]  kthread+0x328/0x630
[   19.647627]  ret_from_fork+0x10/0x20
[   19.647754] 
[   19.647832] The buggy address belongs to the object at fff00000c4561b00
[   19.647832]  which belongs to the cache kmalloc-16 of size 16
[   19.647959] The buggy address is located 8 bytes inside of
[   19.647959]  freed 16-byte region [fff00000c4561b00, fff00000c4561b10)
[   19.648193] 
[   19.648240] The buggy address belongs to the physical page:
[   19.648306] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104561
[   19.648439] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.648562] page_type: f5(slab)
[   19.648754] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.648955] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.649092] page dumped because: kasan: bad access detected
[   19.649250] 
[   19.649311] Memory state around the buggy address:
[   19.649399]  fff00000c4561a00: fa fb fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   19.649491]  fff00000c4561a80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.649572] >fff00000c4561b00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.649657]                       ^
[   19.649716]  fff00000c4561b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.649875]  fff00000c4561c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.649975] ==================================================================

[   12.867202] ==================================================================
[   12.867758] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   12.868089] Read of size 1 at addr ffff888101c05d08 by task kunit_try_catch/202
[   12.868338] 
[   12.868448] CPU: 1 UID: 0 PID: 202 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.868489] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.868499] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.868518] Call Trace:
[   12.868529]  <TASK>
[   12.868543]  dump_stack_lvl+0x73/0xb0
[   12.868571]  print_report+0xd1/0x650
[   12.868594]  ? __virt_addr_valid+0x1db/0x2d0
[   12.868616]  ? kmalloc_uaf+0x320/0x380
[   12.868635]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.868951]  ? kmalloc_uaf+0x320/0x380
[   12.868976]  kasan_report+0x141/0x180
[   12.868998]  ? kmalloc_uaf+0x320/0x380
[   12.869022]  __asan_report_load1_noabort+0x18/0x20
[   12.869048]  kmalloc_uaf+0x320/0x380
[   12.869067]  ? __pfx_kmalloc_uaf+0x10/0x10
[   12.869088]  ? __schedule+0x10cc/0x2b60
[   12.869111]  ? __pfx_read_tsc+0x10/0x10
[   12.869132]  ? ktime_get_ts64+0x86/0x230
[   12.869156]  kunit_try_run_case+0x1a5/0x480
[   12.869181]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.869203]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.869227]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.869251]  ? __kthread_parkme+0x82/0x180
[   12.869271]  ? preempt_count_sub+0x50/0x80
[   12.869295]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.869319]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.869343]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.869368]  kthread+0x337/0x6f0
[   12.869387]  ? trace_preempt_on+0x20/0xc0
[   12.869409]  ? __pfx_kthread+0x10/0x10
[   12.869430]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.869451]  ? calculate_sigpending+0x7b/0xa0
[   12.869476]  ? __pfx_kthread+0x10/0x10
[   12.869497]  ret_from_fork+0x116/0x1d0
[   12.869514]  ? __pfx_kthread+0x10/0x10
[   12.869534]  ret_from_fork_asm+0x1a/0x30
[   12.869566]  </TASK>
[   12.869576] 
[   12.877158] Allocated by task 202:
[   12.877287]  kasan_save_stack+0x45/0x70
[   12.877430]  kasan_save_track+0x18/0x40
[   12.877622]  kasan_save_alloc_info+0x3b/0x50
[   12.877890]  __kasan_kmalloc+0xb7/0xc0
[   12.878077]  __kmalloc_cache_noprof+0x189/0x420
[   12.878300]  kmalloc_uaf+0xaa/0x380
[   12.878479]  kunit_try_run_case+0x1a5/0x480
[   12.878680]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.878911]  kthread+0x337/0x6f0
[   12.879249]  ret_from_fork+0x116/0x1d0
[   12.879451]  ret_from_fork_asm+0x1a/0x30
[   12.879639] 
[   12.879800] Freed by task 202:
[   12.879939]  kasan_save_stack+0x45/0x70
[   12.880141]  kasan_save_track+0x18/0x40
[   12.880292]  kasan_save_free_info+0x3f/0x60
[   12.880501]  __kasan_slab_free+0x56/0x70
[   12.880637]  kfree+0x222/0x3f0
[   12.880764]  kmalloc_uaf+0x12c/0x380
[   12.880892]  kunit_try_run_case+0x1a5/0x480
[   12.881046]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.881293]  kthread+0x337/0x6f0
[   12.881558]  ret_from_fork+0x116/0x1d0
[   12.881942]  ret_from_fork_asm+0x1a/0x30
[   12.882143] 
[   12.882236] The buggy address belongs to the object at ffff888101c05d00
[   12.882236]  which belongs to the cache kmalloc-16 of size 16
[   12.882610] The buggy address is located 8 bytes inside of
[   12.882610]  freed 16-byte region [ffff888101c05d00, ffff888101c05d10)
[   12.884007] 
[   12.884113] The buggy address belongs to the physical page:
[   12.884366] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101c05
[   12.885281] flags: 0x200000000000000(node=0|zone=2)
[   12.885513] page_type: f5(slab)
[   12.885777] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.886294] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.886967] page dumped because: kasan: bad access detected
[   12.887307] 
[   12.887402] Memory state around the buggy address:
[   12.887615]  ffff888101c05c00: fa fb fc fc fa fb fc fc fa fb fc fc 00 05 fc fc
[   12.888220]  ffff888101c05c80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   12.888781] >ffff888101c05d00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.889080]                       ^
[   12.889245]  ffff888101c05d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.889532]  ffff888101c05e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.890212] ==================================================================