Hay
Date
July 23, 2025, 3:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.158157] ==================================================================
[   31.158494] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   31.158584] Read of size 1 at addr fff00000c8603ec8 by task kunit_try_catch/217
[   31.158701] 
[   31.158739] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   31.159122] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   31.159183] Hardware name: linux,dummy-virt (DT)
[   31.159226] Call trace:
[   31.159252]  show_stack+0x20/0x38 (C)
[   31.159306]  dump_stack_lvl+0x8c/0xd0
[   31.159354]  print_report+0x118/0x5e8
[   31.159398]  kasan_report+0xdc/0x128
[   31.159736]  __asan_report_load1_noabort+0x20/0x30
[   31.159808]  kmalloc_uaf+0x300/0x338
[   31.159853]  kunit_try_run_case+0x170/0x3f0
[   31.160196]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.160386]  kthread+0x328/0x630
[   31.160439]  ret_from_fork+0x10/0x20
[   31.160508] 
[   31.160614] Allocated by task 217:
[   31.160682]  kasan_save_stack+0x3c/0x68
[   31.160783]  kasan_save_track+0x20/0x40
[   31.160817]  kasan_save_alloc_info+0x40/0x58
[   31.160856]  __kasan_kmalloc+0xd4/0xd8
[   31.161062]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.161265]  kmalloc_uaf+0xb8/0x338
[   31.161359]  kunit_try_run_case+0x170/0x3f0
[   31.161399]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.161630]  kthread+0x328/0x630
[   31.161849]  ret_from_fork+0x10/0x20
[   31.161912] 
[   31.161931] Freed by task 217:
[   31.162172]  kasan_save_stack+0x3c/0x68
[   31.162301]  kasan_save_track+0x20/0x40
[   31.162625]  kasan_save_free_info+0x4c/0x78
[   31.162699]  __kasan_slab_free+0x6c/0x98
[   31.162895]  kfree+0x214/0x3c8
[   31.162987]  kmalloc_uaf+0x11c/0x338
[   31.163193]  kunit_try_run_case+0x170/0x3f0
[   31.163534]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.163657]  kthread+0x328/0x630
[   31.163740]  ret_from_fork+0x10/0x20
[   31.163979] 
[   31.164030] The buggy address belongs to the object at fff00000c8603ec0
[   31.164030]  which belongs to the cache kmalloc-16 of size 16
[   31.164191] The buggy address is located 8 bytes inside of
[   31.164191]  freed 16-byte region [fff00000c8603ec0, fff00000c8603ed0)
[   31.164293] 
[   31.164339] The buggy address belongs to the physical page:
[   31.164395] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xfff00000c8603e00 pfn:0x108603
[   31.164458] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.164516] page_type: f5(slab)
[   31.164953] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   31.165042] raw: fff00000c8603e00 000000008080007f 00000000f5000000 0000000000000000
[   31.165107] page dumped because: kasan: bad access detected
[   31.165264] 
[   31.165323] Memory state around the buggy address:
[   31.165481]  fff00000c8603d80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.165598]  fff00000c8603e00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.165707] >fff00000c8603e80: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   31.165835]                                               ^
[   31.165893]  fff00000c8603f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.165949]  fff00000c8603f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.166201] ==================================================================

[   25.421703] ==================================================================
[   25.422236] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   25.422662] Read of size 1 at addr ffff888104963088 by task kunit_try_catch/233
[   25.422971] 
[   25.423258] CPU: 0 UID: 0 PID: 233 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   25.423315] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.423328] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.423351] Call Trace:
[   25.423364]  <TASK>
[   25.423383]  dump_stack_lvl+0x73/0xb0
[   25.423415]  print_report+0xd1/0x640
[   25.423438]  ? __virt_addr_valid+0x1db/0x2d0
[   25.423463]  ? kmalloc_uaf+0x320/0x380
[   25.423483]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.423508]  ? kmalloc_uaf+0x320/0x380
[   25.423528]  kasan_report+0x141/0x180
[   25.423550]  ? kmalloc_uaf+0x320/0x380
[   25.423574]  __asan_report_load1_noabort+0x18/0x20
[   25.423652]  kmalloc_uaf+0x320/0x380
[   25.423675]  ? __pfx_kmalloc_uaf+0x10/0x10
[   25.423696]  ? __schedule+0x10da/0x2b60
[   25.423722]  ? __pfx_read_tsc+0x10/0x10
[   25.423744]  ? ktime_get_ts64+0x86/0x230
[   25.423769]  kunit_try_run_case+0x1a5/0x480
[   25.423795]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.423817]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.423842]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.423867]  ? __kthread_parkme+0x82/0x180
[   25.423888]  ? preempt_count_sub+0x50/0x80
[   25.423912]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.423936]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.424011]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.424034]  kthread+0x337/0x6f0
[   25.424055]  ? trace_preempt_on+0x20/0xc0
[   25.424092]  ? __pfx_kthread+0x10/0x10
[   25.424114]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.424138]  ? calculate_sigpending+0x7b/0xa0
[   25.424175]  ? __pfx_kthread+0x10/0x10
[   25.424197]  ret_from_fork+0x116/0x1d0
[   25.424217]  ? __pfx_kthread+0x10/0x10
[   25.424238]  ret_from_fork_asm+0x1a/0x30
[   25.424269]  </TASK>
[   25.424280] 
[   25.436637] Allocated by task 233:
[   25.437005]  kasan_save_stack+0x45/0x70
[   25.437463]  kasan_save_track+0x18/0x40
[   25.437964]  kasan_save_alloc_info+0x3b/0x50
[   25.438410]  __kasan_kmalloc+0xb7/0xc0
[   25.438624]  __kmalloc_cache_noprof+0x189/0x420
[   25.438779]  kmalloc_uaf+0xaa/0x380
[   25.438901]  kunit_try_run_case+0x1a5/0x480
[   25.439484]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.440175]  kthread+0x337/0x6f0
[   25.440529]  ret_from_fork+0x116/0x1d0
[   25.440931]  ret_from_fork_asm+0x1a/0x30
[   25.441417] 
[   25.441586] Freed by task 233:
[   25.441897]  kasan_save_stack+0x45/0x70
[   25.442119]  kasan_save_track+0x18/0x40
[   25.442457]  kasan_save_free_info+0x3f/0x60
[   25.442950]  __kasan_slab_free+0x56/0x70
[   25.443261]  kfree+0x222/0x3f0
[   25.443574]  kmalloc_uaf+0x12c/0x380
[   25.443707]  kunit_try_run_case+0x1a5/0x480
[   25.444132]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.444806]  kthread+0x337/0x6f0
[   25.444987]  ret_from_fork+0x116/0x1d0
[   25.445425]  ret_from_fork_asm+0x1a/0x30
[   25.445794] 
[   25.445863] The buggy address belongs to the object at ffff888104963080
[   25.445863]  which belongs to the cache kmalloc-16 of size 16
[   25.446740] The buggy address is located 8 bytes inside of
[   25.446740]  freed 16-byte region [ffff888104963080, ffff888104963090)
[   25.447970] 
[   25.448141] The buggy address belongs to the physical page:
[   25.448457] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104963
[   25.449227] flags: 0x200000000000000(node=0|zone=2)
[   25.449510] page_type: f5(slab)
[   25.449735] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   25.450464] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   25.450681] page dumped because: kasan: bad access detected
[   25.450845] 
[   25.450910] Memory state around the buggy address:
[   25.451074]  ffff888104962f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.451410]  ffff888104963000: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.451952] >ffff888104963080: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.452238]                       ^
[   25.452418]  ffff888104963100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.453243]  ffff888104963180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.453687] ==================================================================