Hay
Date
July 3, 2025, 3:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   15.548924] ==================================================================
[   15.548998] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   15.549495] Read of size 16 at addr fff00000c55f0900 by task kunit_try_catch/171
[   15.549565] 
[   15.549929] CPU: 1 UID: 0 PID: 171 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc1 #1 PREEMPT 
[   15.550086] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.550140] Hardware name: linux,dummy-virt (DT)
[   15.550643] Call trace:
[   15.550750]  show_stack+0x20/0x38 (C)
[   15.550821]  dump_stack_lvl+0x8c/0xd0
[   15.550979]  print_report+0x118/0x608
[   15.551400]  kasan_report+0xdc/0x128
[   15.551479]  __asan_report_load16_noabort+0x20/0x30
[   15.551593]  kmalloc_uaf_16+0x3bc/0x438
[   15.551827]  kunit_try_run_case+0x170/0x3f0
[   15.552245]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.552339]  kthread+0x328/0x630
[   15.552479]  ret_from_fork+0x10/0x20
[   15.553052] 
[   15.553112] Allocated by task 171:
[   15.553209]  kasan_save_stack+0x3c/0x68
[   15.553326]  kasan_save_track+0x20/0x40
[   15.553448]  kasan_save_alloc_info+0x40/0x58
[   15.553650]  __kasan_kmalloc+0xd4/0xd8
[   15.553873]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.554195]  kmalloc_uaf_16+0x140/0x438
[   15.554358]  kunit_try_run_case+0x170/0x3f0
[   15.554415]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.554668]  kthread+0x328/0x630
[   15.554729]  ret_from_fork+0x10/0x20
[   15.555108] 
[   15.555224] Freed by task 171:
[   15.555319]  kasan_save_stack+0x3c/0x68
[   15.555417]  kasan_save_track+0x20/0x40
[   15.555717]  kasan_save_free_info+0x4c/0x78
[   15.555965]  __kasan_slab_free+0x6c/0x98
[   15.556117]  kfree+0x214/0x3c8
[   15.556293]  kmalloc_uaf_16+0x190/0x438
[   15.556334]  kunit_try_run_case+0x170/0x3f0
[   15.556659]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.556864]  kthread+0x328/0x630
[   15.557437]  ret_from_fork+0x10/0x20
[   15.557697] 
[   15.557887] The buggy address belongs to the object at fff00000c55f0900
[   15.557887]  which belongs to the cache kmalloc-16 of size 16
[   15.557970] The buggy address is located 0 bytes inside of
[   15.557970]  freed 16-byte region [fff00000c55f0900, fff00000c55f0910)
[   15.558231] 
[   15.558263] The buggy address belongs to the physical page:
[   15.558295] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1055f0
[   15.558351] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.558399] page_type: f5(slab)
[   15.558445] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.558990] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.559063] page dumped because: kasan: bad access detected
[   15.559188] 
[   15.559370] Memory state around the buggy address:
[   15.559561]  fff00000c55f0800: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.559762]  fff00000c55f0880: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
[   15.559840] >fff00000c55f0900: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.560053]                    ^
[   15.560223]  fff00000c55f0980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.560274]  fff00000c55f0a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.560354] ==================================================================

[   11.214423] ==================================================================
[   11.214881] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   11.215192] Read of size 16 at addr ffff888102224100 by task kunit_try_catch/187
[   11.215641] 
[   11.215837] CPU: 0 UID: 0 PID: 187 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc1 #1 PREEMPT(voluntary) 
[   11.215885] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.215897] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.215930] Call Trace:
[   11.215942]  <TASK>
[   11.215960]  dump_stack_lvl+0x73/0xb0
[   11.215990]  print_report+0xd1/0x650
[   11.216025]  ? __virt_addr_valid+0x1db/0x2d0
[   11.216049]  ? kmalloc_uaf_16+0x47b/0x4c0
[   11.216070]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.216101]  ? kmalloc_uaf_16+0x47b/0x4c0
[   11.216123]  kasan_report+0x141/0x180
[   11.216146]  ? kmalloc_uaf_16+0x47b/0x4c0
[   11.216183]  __asan_report_load16_noabort+0x18/0x20
[   11.216205]  kmalloc_uaf_16+0x47b/0x4c0
[   11.216226]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   11.216257]  ? __schedule+0x10cc/0x2b60
[   11.216338]  ? __pfx_read_tsc+0x10/0x10
[   11.216361]  ? ktime_get_ts64+0x86/0x230
[   11.216389]  kunit_try_run_case+0x1a5/0x480
[   11.216415]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.216437]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.216462]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.216485]  ? __kthread_parkme+0x82/0x180
[   11.216508]  ? preempt_count_sub+0x50/0x80
[   11.216546]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.216570]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.216593]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.216628]  kthread+0x337/0x6f0
[   11.216644]  ? trace_preempt_on+0x20/0xc0
[   11.216669]  ? __pfx_kthread+0x10/0x10
[   11.216696]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.216718]  ? calculate_sigpending+0x7b/0xa0
[   11.216740]  ? __pfx_kthread+0x10/0x10
[   11.216759]  ret_from_fork+0x41/0x80
[   11.216779]  ? __pfx_kthread+0x10/0x10
[   11.216797]  ret_from_fork_asm+0x1a/0x30
[   11.216828]  </TASK>
[   11.216839] 
[   11.224542] Allocated by task 187:
[   11.224797]  kasan_save_stack+0x45/0x70
[   11.225032]  kasan_save_track+0x18/0x40
[   11.225264]  kasan_save_alloc_info+0x3b/0x50
[   11.225531]  __kasan_kmalloc+0xb7/0xc0
[   11.225917]  __kmalloc_cache_noprof+0x189/0x420
[   11.226139]  kmalloc_uaf_16+0x15b/0x4c0
[   11.226451]  kunit_try_run_case+0x1a5/0x480
[   11.226671]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.226961]  kthread+0x337/0x6f0
[   11.227132]  ret_from_fork+0x41/0x80
[   11.227399]  ret_from_fork_asm+0x1a/0x30
[   11.227603] 
[   11.227697] Freed by task 187:
[   11.227810]  kasan_save_stack+0x45/0x70
[   11.228078]  kasan_save_track+0x18/0x40
[   11.228220]  kasan_save_free_info+0x3f/0x60
[   11.228709]  __kasan_slab_free+0x56/0x70
[   11.228911]  kfree+0x222/0x3f0
[   11.229091]  kmalloc_uaf_16+0x1d6/0x4c0
[   11.229282]  kunit_try_run_case+0x1a5/0x480
[   11.229428]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.229620]  kthread+0x337/0x6f0
[   11.229764]  ret_from_fork+0x41/0x80
[   11.229949]  ret_from_fork_asm+0x1a/0x30
[   11.230393] 
[   11.230495] The buggy address belongs to the object at ffff888102224100
[   11.230495]  which belongs to the cache kmalloc-16 of size 16
[   11.231048] The buggy address is located 0 bytes inside of
[   11.231048]  freed 16-byte region [ffff888102224100, ffff888102224110)
[   11.231913] 
[   11.232034] The buggy address belongs to the physical page:
[   11.232365] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102224
[   11.232779] flags: 0x200000000000000(node=0|zone=2)
[   11.233018] page_type: f5(slab)
[   11.233209] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.233665] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.233997] page dumped because: kasan: bad access detected
[   11.234258] 
[   11.234559] Memory state around the buggy address:
[   11.234832]  ffff888102224000: 00 02 fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   11.235158]  ffff888102224080: fa fb fc fc 00 05 fc fc fa fb fc fc 00 00 fc fc
[   11.235522] >ffff888102224100: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.235927]                    ^
[   11.236051]  ffff888102224180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.236476]  ffff888102224200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.236735] ==================================================================