Hay
Date
July 4, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.568412] ==================================================================
[   29.568537] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   29.568592] Read of size 16 at addr fff00000c5a48a00 by task kunit_try_catch/201
[   29.568855] 
[   29.568947] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT 
[   29.569050] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.569142] Hardware name: linux,dummy-virt (DT)
[   29.569222] Call trace:
[   29.569247]  show_stack+0x20/0x38 (C)
[   29.569331]  dump_stack_lvl+0x8c/0xd0
[   29.569377]  print_report+0x118/0x608
[   29.569423]  kasan_report+0xdc/0x128
[   29.569611]  __asan_report_load16_noabort+0x20/0x30
[   29.569693]  kmalloc_uaf_16+0x3bc/0x438
[   29.569876]  kunit_try_run_case+0x170/0x3f0
[   29.570022]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.570076]  kthread+0x328/0x630
[   29.570126]  ret_from_fork+0x10/0x20
[   29.570173] 
[   29.570192] Allocated by task 201:
[   29.570220]  kasan_save_stack+0x3c/0x68
[   29.570418]  kasan_save_track+0x20/0x40
[   29.570492]  kasan_save_alloc_info+0x40/0x58
[   29.570623]  __kasan_kmalloc+0xd4/0xd8
[   29.570829]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.570909]  kmalloc_uaf_16+0x140/0x438
[   29.571103]  kunit_try_run_case+0x170/0x3f0
[   29.571294]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.571348]  kthread+0x328/0x630
[   29.571524]  ret_from_fork+0x10/0x20
[   29.571683] 
[   29.571787] Freed by task 201:
[   29.571916]  kasan_save_stack+0x3c/0x68
[   29.572011]  kasan_save_track+0x20/0x40
[   29.572076]  kasan_save_free_info+0x4c/0x78
[   29.572182]  __kasan_slab_free+0x6c/0x98
[   29.572223]  kfree+0x214/0x3c8
[   29.572294]  kmalloc_uaf_16+0x190/0x438
[   29.572561]  kunit_try_run_case+0x170/0x3f0
[   29.572692]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.572788]  kthread+0x328/0x630
[   29.572950]  ret_from_fork+0x10/0x20
[   29.573181] 
[   29.573231] The buggy address belongs to the object at fff00000c5a48a00
[   29.573231]  which belongs to the cache kmalloc-16 of size 16
[   29.573297] The buggy address is located 0 bytes inside of
[   29.573297]  freed 16-byte region [fff00000c5a48a00, fff00000c5a48a10)
[   29.573362] 
[   29.573383] The buggy address belongs to the physical page:
[   29.573591] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a48
[   29.573768] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.573882] page_type: f5(slab)
[   29.574049] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   29.574204] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   29.574302] page dumped because: kasan: bad access detected
[   29.574461] 
[   29.574481] Memory state around the buggy address:
[   29.574512]  fff00000c5a48900: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   29.574697]  fff00000c5a48980: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
[   29.574868] >fff00000c5a48a00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.574975]                    ^
[   29.575082]  fff00000c5a48a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.575169]  fff00000c5a48b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.575282] ==================================================================

[   24.911536] ==================================================================
[   24.912011] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   24.912534] Read of size 16 at addr ffff88810527f2a0 by task kunit_try_catch/217
[   24.913169] 
[   24.913306] CPU: 1 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) 
[   24.913362] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.913376] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.913414] Call Trace:
[   24.913428]  <TASK>
[   24.913448]  dump_stack_lvl+0x73/0xb0
[   24.913478]  print_report+0xd1/0x650
[   24.913503]  ? __virt_addr_valid+0x1db/0x2d0
[   24.913530]  ? kmalloc_uaf_16+0x47b/0x4c0
[   24.913553]  ? kasan_complete_mode_report_info+0x64/0x200
[   24.913581]  ? kmalloc_uaf_16+0x47b/0x4c0
[   24.913603]  kasan_report+0x141/0x180
[   24.913627]  ? kmalloc_uaf_16+0x47b/0x4c0
[   24.913654]  __asan_report_load16_noabort+0x18/0x20
[   24.913680]  kmalloc_uaf_16+0x47b/0x4c0
[   24.913703]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   24.913726]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   24.913754]  ? trace_hardirqs_on+0x37/0xe0
[   24.913781]  ? __pfx_read_tsc+0x10/0x10
[   24.913805]  ? ktime_get_ts64+0x86/0x230
[   24.913832]  kunit_try_run_case+0x1a5/0x480
[   24.913861]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.914042]  ? queued_spin_lock_slowpath+0x116/0xb40
[   24.914081]  ? __kthread_parkme+0x82/0x180
[   24.914106]  ? preempt_count_sub+0x50/0x80
[   24.914133]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.914214]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.914243]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.914271]  kthread+0x337/0x6f0
[   24.914293]  ? trace_preempt_on+0x20/0xc0
[   24.914319]  ? __pfx_kthread+0x10/0x10
[   24.914342]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.914367]  ? calculate_sigpending+0x7b/0xa0
[   24.914406]  ? __pfx_kthread+0x10/0x10
[   24.914430]  ret_from_fork+0x116/0x1d0
[   24.914452]  ? __pfx_kthread+0x10/0x10
[   24.914475]  ret_from_fork_asm+0x1a/0x30
[   24.914510]  </TASK>
[   24.914524] 
[   24.925481] Allocated by task 217:
[   24.925691]  kasan_save_stack+0x45/0x70
[   24.926265]  kasan_save_track+0x18/0x40
[   24.926481]  kasan_save_alloc_info+0x3b/0x50
[   24.926800]  __kasan_kmalloc+0xb7/0xc0
[   24.927023]  __kmalloc_cache_noprof+0x189/0x420
[   24.927434]  kmalloc_uaf_16+0x15b/0x4c0
[   24.927635]  kunit_try_run_case+0x1a5/0x480
[   24.927819]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.928422]  kthread+0x337/0x6f0
[   24.928722]  ret_from_fork+0x116/0x1d0
[   24.929039]  ret_from_fork_asm+0x1a/0x30
[   24.929269] 
[   24.929512] Freed by task 217:
[   24.929644]  kasan_save_stack+0x45/0x70
[   24.930058]  kasan_save_track+0x18/0x40
[   24.930353]  kasan_save_free_info+0x3f/0x60
[   24.930533]  __kasan_slab_free+0x56/0x70
[   24.930977]  kfree+0x222/0x3f0
[   24.931360]  kmalloc_uaf_16+0x1d6/0x4c0
[   24.931571]  kunit_try_run_case+0x1a5/0x480
[   24.931727]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.932133]  kthread+0x337/0x6f0
[   24.932443]  ret_from_fork+0x116/0x1d0
[   24.932592]  ret_from_fork_asm+0x1a/0x30
[   24.932801] 
[   24.932894] The buggy address belongs to the object at ffff88810527f2a0
[   24.932894]  which belongs to the cache kmalloc-16 of size 16
[   24.934078] The buggy address is located 0 bytes inside of
[   24.934078]  freed 16-byte region [ffff88810527f2a0, ffff88810527f2b0)
[   24.934888] 
[   24.935004] The buggy address belongs to the physical page:
[   24.935239] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10527f
[   24.935598] flags: 0x200000000000000(node=0|zone=2)
[   24.935818] page_type: f5(slab)
[   24.935963] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   24.936354] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   24.936887] page dumped because: kasan: bad access detected
[   24.937118] 
[   24.937277] Memory state around the buggy address:
[   24.937469]  ffff88810527f180: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   24.937806]  ffff88810527f200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   24.938132] >ffff88810527f280: 00 00 fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   24.938502]                                ^
[   24.938710]  ffff88810527f300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.938939]  ffff88810527f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.939495] ==================================================================