Hay
Date
July 24, 2025, 4:41 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.471140] ==================================================================
[   32.471242] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   32.471333] Read of size 16 at addr fff00000c86834c0 by task kunit_try_catch/199
[   32.471704] 
[   32.471856] CPU: 0 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250724 #1 PREEMPT 
[   32.471945] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.471972] Hardware name: linux,dummy-virt (DT)
[   32.472004] Call trace:
[   32.472693]  show_stack+0x20/0x38 (C)
[   32.473260]  dump_stack_lvl+0x8c/0xd0
[   32.473429]  print_report+0x118/0x5e8
[   32.473476]  kasan_report+0xdc/0x128
[   32.473806]  __asan_report_load16_noabort+0x20/0x30
[   32.474007]  kmalloc_uaf_16+0x3bc/0x438
[   32.474662]  kunit_try_run_case+0x170/0x3f0
[   32.475041]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.475176]  kthread+0x328/0x630
[   32.475463]  ret_from_fork+0x10/0x20
[   32.475604] 
[   32.475664] Allocated by task 199:
[   32.475843]  kasan_save_stack+0x3c/0x68
[   32.476106]  kasan_save_track+0x20/0x40
[   32.476346]  kasan_save_alloc_info+0x40/0x58
[   32.476582]  __kasan_kmalloc+0xd4/0xd8
[   32.476840]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.476888]  kmalloc_uaf_16+0x140/0x438
[   32.476924]  kunit_try_run_case+0x170/0x3f0
[   32.476960]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.477001]  kthread+0x328/0x630
[   32.477033]  ret_from_fork+0x10/0x20
[   32.477067] 
[   32.478003] Freed by task 199:
[   32.478406]  kasan_save_stack+0x3c/0x68
[   32.478471]  kasan_save_track+0x20/0x40
[   32.478505]  kasan_save_free_info+0x4c/0x78
[   32.478541]  __kasan_slab_free+0x6c/0x98
[   32.478575]  kfree+0x214/0x3c8
[   32.479229]  kmalloc_uaf_16+0x190/0x438
[   32.479440]  kunit_try_run_case+0x170/0x3f0
[   32.479549]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.479743]  kthread+0x328/0x630
[   32.479798]  ret_from_fork+0x10/0x20
[   32.480370] 
[   32.480494] The buggy address belongs to the object at fff00000c86834c0
[   32.480494]  which belongs to the cache kmalloc-16 of size 16
[   32.480555] The buggy address is located 0 bytes inside of
[   32.480555]  freed 16-byte region [fff00000c86834c0, fff00000c86834d0)
[   32.480617] 
[   32.481095] The buggy address belongs to the physical page:
[   32.481336] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x108683
[   32.481482] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.481595] page_type: f5(slab)
[   32.482303] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   32.482475] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   32.482627] page dumped because: kasan: bad access detected
[   32.483261] 
[   32.483484] Memory state around the buggy address:
[   32.483650]  fff00000c8683380: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.484051]  fff00000c8683400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.484177] >fff00000c8683480: fa fb fc fc 00 00 fc fc fa fb fc fc fc fc fc fc
[   32.484250]                                            ^
[   32.484506]  fff00000c8683500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.484831]  fff00000c8683580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.484995] ==================================================================

[   26.880352] ==================================================================
[   26.881331] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   26.881745] Read of size 16 at addr ffff888104625b60 by task kunit_try_catch/216
[   26.882359] 
[   26.882471] CPU: 1 UID: 0 PID: 216 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250724 #1 PREEMPT(voluntary) 
[   26.882522] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   26.882535] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.882556] Call Trace:
[   26.882568]  <TASK>
[   26.882596]  dump_stack_lvl+0x73/0xb0
[   26.882627]  print_report+0xd1/0x640
[   26.882650]  ? __virt_addr_valid+0x1db/0x2d0
[   26.882674]  ? kmalloc_uaf_16+0x47b/0x4c0
[   26.882695]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.882720]  ? kmalloc_uaf_16+0x47b/0x4c0
[   26.882740]  kasan_report+0x141/0x180
[   26.882761]  ? kmalloc_uaf_16+0x47b/0x4c0
[   26.882846]  __asan_report_load16_noabort+0x18/0x20
[   26.882877]  kmalloc_uaf_16+0x47b/0x4c0
[   26.882899]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   26.882961]  ? __schedule+0x10da/0x2b60
[   26.882988]  ? __pfx_read_tsc+0x10/0x10
[   26.883009]  ? ktime_get_ts64+0x86/0x230
[   26.883046]  kunit_try_run_case+0x1a5/0x480
[   26.883072]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.883093]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.883130]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.883154]  ? __kthread_parkme+0x82/0x180
[   26.883174]  ? preempt_count_sub+0x50/0x80
[   26.883208]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.883231]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.883259]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.883282]  kthread+0x337/0x6f0
[   26.883303]  ? trace_preempt_on+0x20/0xc0
[   26.883327]  ? __pfx_kthread+0x10/0x10
[   26.883347]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.883369]  ? calculate_sigpending+0x7b/0xa0
[   26.883392]  ? __pfx_kthread+0x10/0x10
[   26.883413]  ret_from_fork+0x116/0x1d0
[   26.883432]  ? __pfx_kthread+0x10/0x10
[   26.883451]  ret_from_fork_asm+0x1a/0x30
[   26.883482]  </TASK>
[   26.883493] 
[   26.891641] Allocated by task 216:
[   26.891864]  kasan_save_stack+0x45/0x70
[   26.892085]  kasan_save_track+0x18/0x40
[   26.892494]  kasan_save_alloc_info+0x3b/0x50
[   26.892800]  __kasan_kmalloc+0xb7/0xc0
[   26.893108]  __kmalloc_cache_noprof+0x189/0x420
[   26.893356]  kmalloc_uaf_16+0x15b/0x4c0
[   26.893548]  kunit_try_run_case+0x1a5/0x480
[   26.893799]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.894177]  kthread+0x337/0x6f0
[   26.894362]  ret_from_fork+0x116/0x1d0
[   26.894566]  ret_from_fork_asm+0x1a/0x30
[   26.894746] 
[   26.894930] Freed by task 216:
[   26.895158]  kasan_save_stack+0x45/0x70
[   26.895304]  kasan_save_track+0x18/0x40
[   26.895536]  kasan_save_free_info+0x3f/0x60
[   26.895777]  __kasan_slab_free+0x56/0x70
[   26.896160]  kfree+0x222/0x3f0
[   26.896380]  kmalloc_uaf_16+0x1d6/0x4c0
[   26.896583]  kunit_try_run_case+0x1a5/0x480
[   26.896793]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.897110]  kthread+0x337/0x6f0
[   26.897283]  ret_from_fork+0x116/0x1d0
[   26.897479]  ret_from_fork_asm+0x1a/0x30
[   26.897673] 
[   26.897797] The buggy address belongs to the object at ffff888104625b60
[   26.897797]  which belongs to the cache kmalloc-16 of size 16
[   26.898879] The buggy address is located 0 bytes inside of
[   26.898879]  freed 16-byte region [ffff888104625b60, ffff888104625b70)
[   26.899539] 
[   26.899620] The buggy address belongs to the physical page:
[   26.899790] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104625
[   26.900178] flags: 0x200000000000000(node=0|zone=2)
[   26.900883] page_type: f5(slab)
[   26.901040] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   26.901259] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   26.901635] page dumped because: kasan: bad access detected
[   26.902071] 
[   26.902194] Memory state around the buggy address:
[   26.902422]  ffff888104625a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   26.902785]  ffff888104625a80: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   26.903176] >ffff888104625b00: 00 06 fc fc 00 06 fc fc 00 06 fc fc fa fb fc fc
[   26.903510]                                                        ^
[   26.903874]  ffff888104625b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.904360]  ffff888104625c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.904742] ==================================================================