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

Environment
qemu-arm64
qemu-x86_64

[   16.716665] ==================================================================
[   16.716736] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   16.716786] Read of size 16 at addr fff00000c45d1aa0 by task kunit_try_catch/168
[   16.716887] 
[   16.716946] CPU: 1 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.717026] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.717052] Hardware name: linux,dummy-virt (DT)
[   16.717082] Call trace:
[   16.717102]  show_stack+0x20/0x38 (C)
[   16.717190]  dump_stack_lvl+0x8c/0xd0
[   16.717238]  print_report+0x118/0x5d0
[   16.717324]  kasan_report+0xdc/0x128
[   16.717400]  __asan_report_load16_noabort+0x20/0x30
[   16.717471]  kmalloc_uaf_16+0x3bc/0x438
[   16.717516]  kunit_try_run_case+0x170/0x3f0
[   16.717561]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.717620]  kthread+0x328/0x630
[   16.717688]  ret_from_fork+0x10/0x20
[   16.717754] 
[   16.717771] Allocated by task 168:
[   16.717798]  kasan_save_stack+0x3c/0x68
[   16.717837]  kasan_save_track+0x20/0x40
[   16.717893]  kasan_save_alloc_info+0x40/0x58
[   16.717938]  __kasan_kmalloc+0xd4/0xd8
[   16.717972]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.718009]  kmalloc_uaf_16+0x140/0x438
[   16.718212]  kunit_try_run_case+0x170/0x3f0
[   16.718282]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.718326]  kthread+0x328/0x630
[   16.718408]  ret_from_fork+0x10/0x20
[   16.718443] 
[   16.718461] Freed by task 168:
[   16.718492]  kasan_save_stack+0x3c/0x68
[   16.718529]  kasan_save_track+0x20/0x40
[   16.718564]  kasan_save_free_info+0x4c/0x78
[   16.718602]  __kasan_slab_free+0x6c/0x98
[   16.718786]  kfree+0x214/0x3c8
[   16.718846]  kmalloc_uaf_16+0x190/0x438
[   16.718881]  kunit_try_run_case+0x170/0x3f0
[   16.718917]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.719002]  kthread+0x328/0x630
[   16.719047]  ret_from_fork+0x10/0x20
[   16.719082] 
[   16.719100] The buggy address belongs to the object at fff00000c45d1aa0
[   16.719100]  which belongs to the cache kmalloc-16 of size 16
[   16.719194] The buggy address is located 0 bytes inside of
[   16.719194]  freed 16-byte region [fff00000c45d1aa0, fff00000c45d1ab0)
[   16.719289] 
[   16.719322] The buggy address belongs to the physical page:
[   16.719355] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1045d1
[   16.719433] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.719481] page_type: f5(slab)
[   16.719721] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.719873] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.719925] page dumped because: kasan: bad access detected
[   16.719982] 
[   16.720252] Memory state around the buggy address:
[   16.720334]  fff00000c45d1980: fa fb fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   16.720435]  fff00000c45d1a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.720513] >fff00000c45d1a80: 00 00 fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   16.720556]                                ^
[   16.720586]  fff00000c45d1b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.720735]  fff00000c45d1b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.720881] ==================================================================

[   13.006449] ==================================================================
[   13.006906] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   13.007334] Read of size 16 at addr ffff888101c9b460 by task kunit_try_catch/185
[   13.007914] 
[   13.008018] CPU: 0 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.008283] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.008298] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.008329] Call Trace:
[   13.008342]  <TASK>
[   13.008361]  dump_stack_lvl+0x73/0xb0
[   13.008409]  print_report+0xd1/0x610
[   13.008614]  ? __virt_addr_valid+0x1db/0x2d0
[   13.008641]  ? kmalloc_uaf_16+0x47b/0x4c0
[   13.008674]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.008698]  ? kmalloc_uaf_16+0x47b/0x4c0
[   13.008718]  kasan_report+0x141/0x180
[   13.008739]  ? kmalloc_uaf_16+0x47b/0x4c0
[   13.008765]  __asan_report_load16_noabort+0x18/0x20
[   13.008790]  kmalloc_uaf_16+0x47b/0x4c0
[   13.008810]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   13.008832]  ? __schedule+0x10cc/0x2b60
[   13.008855]  ? __pfx_read_tsc+0x10/0x10
[   13.008877]  ? ktime_get_ts64+0x86/0x230
[   13.008903]  kunit_try_run_case+0x1a5/0x480
[   13.008929]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.008952]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.008976]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.009111]  ? __kthread_parkme+0x82/0x180
[   13.009134]  ? preempt_count_sub+0x50/0x80
[   13.009172]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.009197]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.009222]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.009247]  kthread+0x337/0x6f0
[   13.009275]  ? trace_preempt_on+0x20/0xc0
[   13.009300]  ? __pfx_kthread+0x10/0x10
[   13.009321]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.009344]  ? calculate_sigpending+0x7b/0xa0
[   13.009374]  ? __pfx_kthread+0x10/0x10
[   13.009395]  ret_from_fork+0x116/0x1d0
[   13.009414]  ? __pfx_kthread+0x10/0x10
[   13.009434]  ret_from_fork_asm+0x1a/0x30
[   13.009466]  </TASK>
[   13.009478] 
[   13.018827] Allocated by task 185:
[   13.019524]  kasan_save_stack+0x45/0x70
[   13.019717]  kasan_save_track+0x18/0x40
[   13.019911]  kasan_save_alloc_info+0x3b/0x50
[   13.020296]  __kasan_kmalloc+0xb7/0xc0
[   13.020452]  __kmalloc_cache_noprof+0x189/0x420
[   13.020683]  kmalloc_uaf_16+0x15b/0x4c0
[   13.020864]  kunit_try_run_case+0x1a5/0x480
[   13.021064]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.021631]  kthread+0x337/0x6f0
[   13.021787]  ret_from_fork+0x116/0x1d0
[   13.021959]  ret_from_fork_asm+0x1a/0x30
[   13.022472] 
[   13.022567] Freed by task 185:
[   13.022716]  kasan_save_stack+0x45/0x70
[   13.022895]  kasan_save_track+0x18/0x40
[   13.023289]  kasan_save_free_info+0x3f/0x60
[   13.023508]  __kasan_slab_free+0x56/0x70
[   13.023783]  kfree+0x222/0x3f0
[   13.024098]  kmalloc_uaf_16+0x1d6/0x4c0
[   13.024287]  kunit_try_run_case+0x1a5/0x480
[   13.024684]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.025109]  kthread+0x337/0x6f0
[   13.025293]  ret_from_fork+0x116/0x1d0
[   13.025575]  ret_from_fork_asm+0x1a/0x30
[   13.025770] 
[   13.025871] The buggy address belongs to the object at ffff888101c9b460
[   13.025871]  which belongs to the cache kmalloc-16 of size 16
[   13.026622] The buggy address is located 0 bytes inside of
[   13.026622]  freed 16-byte region [ffff888101c9b460, ffff888101c9b470)
[   13.027501] 
[   13.027610] The buggy address belongs to the physical page:
[   13.027849] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101c9b
[   13.028250] flags: 0x200000000000000(node=0|zone=2)
[   13.028573] page_type: f5(slab)
[   13.028704] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.029046] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.029703] page dumped because: kasan: bad access detected
[   13.029931] 
[   13.030026] Memory state around the buggy address:
[   13.030409]  ffff888101c9b300: 00 02 fc fc 00 05 fc fc 00 02 fc fc 00 02 fc fc
[   13.030722]  ffff888101c9b380: 00 02 fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   13.031010] >ffff888101c9b400: fa fb fc fc 00 05 fc fc 00 00 fc fc fa fb fc fc
[   13.031304]                                                        ^
[   13.031563]  ffff888101c9b480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.031854]  ffff888101c9b500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.032142] ==================================================================