Hay
Date
July 18, 2025, 1:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.694141] ==================================================================
[   31.694214] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   31.694284] Read of size 1 at addr fff00000c907e100 by task kunit_try_catch/223
[   31.694576] 
[   31.694644] CPU: 0 UID: 0 PID: 223 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT 
[   31.694733] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.694761] Hardware name: linux,dummy-virt (DT)
[   31.694844] Call trace:
[   31.694871]  show_stack+0x20/0x38 (C)
[   31.694924]  dump_stack_lvl+0x8c/0xd0
[   31.695225]  print_report+0x118/0x5e8
[   31.695310]  kasan_report+0xdc/0x128
[   31.695354]  __kasan_check_byte+0x54/0x70
[   31.695564]  kfree_sensitive+0x30/0xb0
[   31.695643]  kmalloc_double_kzfree+0x168/0x308
[   31.695696]  kunit_try_run_case+0x170/0x3f0
[   31.696122]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.696301]  kthread+0x328/0x630
[   31.696359]  ret_from_fork+0x10/0x20
[   31.696646] 
[   31.696755] Allocated by task 223:
[   31.696900]  kasan_save_stack+0x3c/0x68
[   31.697221]  kasan_save_track+0x20/0x40
[   31.697346]  kasan_save_alloc_info+0x40/0x58
[   31.697424]  __kasan_kmalloc+0xd4/0xd8
[   31.697478]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.697674]  kmalloc_double_kzfree+0xb8/0x308
[   31.697936]  kunit_try_run_case+0x170/0x3f0
[   31.697986]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.698034]  kthread+0x328/0x630
[   31.698414]  ret_from_fork+0x10/0x20
[   31.698534] 
[   31.698577] Freed by task 223:
[   31.698606]  kasan_save_stack+0x3c/0x68
[   31.698785]  kasan_save_track+0x20/0x40
[   31.699007]  kasan_save_free_info+0x4c/0x78
[   31.699134]  __kasan_slab_free+0x6c/0x98
[   31.699171]  kfree+0x214/0x3c8
[   31.699462]  kfree_sensitive+0x80/0xb0
[   31.699601]  kmalloc_double_kzfree+0x11c/0x308
[   31.699690]  kunit_try_run_case+0x170/0x3f0
[   31.699756]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.699799]  kthread+0x328/0x630
[   31.699833]  ret_from_fork+0x10/0x20
[   31.699867] 
[   31.700239] The buggy address belongs to the object at fff00000c907e100
[   31.700239]  which belongs to the cache kmalloc-16 of size 16
[   31.700354] The buggy address is located 0 bytes inside of
[   31.700354]  freed 16-byte region [fff00000c907e100, fff00000c907e110)
[   31.700477] 
[   31.700518] The buggy address belongs to the physical page:
[   31.700558] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xfff00000c907e020 pfn:0x10907e
[   31.700942] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.701070] page_type: f5(slab)
[   31.701143] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   31.701474] raw: fff00000c907e020 000000008080007f 00000000f5000000 0000000000000000
[   31.701542] page dumped because: kasan: bad access detected
[   31.701634] 
[   31.701666] Memory state around the buggy address:
[   31.701699]  fff00000c907e000: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.701772]  fff00000c907e080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.702100] >fff00000c907e100: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.702197]                    ^
[   31.702279]  fff00000c907e180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.702358]  fff00000c907e200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.702670] ==================================================================


[   25.173121] ==================================================================
[   25.173685] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   25.174122] Read of size 1 at addr ffff888105380c40 by task kunit_try_catch/240
[   25.174616] 
[   25.174723] CPU: 0 UID: 0 PID: 240 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT(voluntary) 
[   25.174774] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.174785] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.174807] Call Trace:
[   25.174820]  <TASK>
[   25.174836]  dump_stack_lvl+0x73/0xb0
[   25.174870]  print_report+0xd1/0x640
[   25.174921]  ? __virt_addr_valid+0x1db/0x2d0
[   25.174945]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.174966]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.174991]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.175013]  kasan_report+0x141/0x180
[   25.175033]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.175057]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.175144]  __kasan_check_byte+0x3d/0x50
[   25.175171]  kfree_sensitive+0x22/0x90
[   25.175192]  kmalloc_double_kzfree+0x19c/0x350
[   25.175303]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   25.175326]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   25.175352]  ? trace_hardirqs_on+0x37/0xe0
[   25.175375]  ? __pfx_read_tsc+0x10/0x10
[   25.175396]  ? ktime_get_ts64+0x86/0x230
[   25.175420]  kunit_try_run_case+0x1a5/0x480
[   25.175445]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.175467]  ? queued_spin_lock_slowpath+0x116/0xb40
[   25.175502]  ? __kthread_parkme+0x82/0x180
[   25.175521]  ? preempt_count_sub+0x50/0x80
[   25.175544]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.175566]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.175588]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.175610]  kthread+0x337/0x6f0
[   25.175628]  ? trace_preempt_on+0x20/0xc0
[   25.175649]  ? __pfx_kthread+0x10/0x10
[   25.175668]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.175698]  ? calculate_sigpending+0x7b/0xa0
[   25.175720]  ? __pfx_kthread+0x10/0x10
[   25.175741]  ret_from_fork+0x116/0x1d0
[   25.175759]  ? __pfx_kthread+0x10/0x10
[   25.175778]  ret_from_fork_asm+0x1a/0x30
[   25.175858]  </TASK>
[   25.175870] 
[   25.183662] Allocated by task 240:
[   25.183791]  kasan_save_stack+0x45/0x70
[   25.183990]  kasan_save_track+0x18/0x40
[   25.184169]  kasan_save_alloc_info+0x3b/0x50
[   25.184378]  __kasan_kmalloc+0xb7/0xc0
[   25.184551]  __kmalloc_cache_noprof+0x189/0x420
[   25.184695]  kmalloc_double_kzfree+0xa9/0x350
[   25.184889]  kunit_try_run_case+0x1a5/0x480
[   25.185072]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.185385]  kthread+0x337/0x6f0
[   25.185528]  ret_from_fork+0x116/0x1d0
[   25.185699]  ret_from_fork_asm+0x1a/0x30
[   25.185977] 
[   25.186071] Freed by task 240:
[   25.186331]  kasan_save_stack+0x45/0x70
[   25.186553]  kasan_save_track+0x18/0x40
[   25.186711]  kasan_save_free_info+0x3f/0x60
[   25.187061]  __kasan_slab_free+0x56/0x70
[   25.187235]  kfree+0x222/0x3f0
[   25.187388]  kfree_sensitive+0x67/0x90
[   25.187585]  kmalloc_double_kzfree+0x12b/0x350
[   25.187746]  kunit_try_run_case+0x1a5/0x480
[   25.188049]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.188308]  kthread+0x337/0x6f0
[   25.188465]  ret_from_fork+0x116/0x1d0
[   25.188627]  ret_from_fork_asm+0x1a/0x30
[   25.188902] 
[   25.188999] The buggy address belongs to the object at ffff888105380c40
[   25.188999]  which belongs to the cache kmalloc-16 of size 16
[   25.189513] The buggy address is located 0 bytes inside of
[   25.189513]  freed 16-byte region [ffff888105380c40, ffff888105380c50)
[   25.190041] 
[   25.190128] The buggy address belongs to the physical page:
[   25.190383] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105380
[   25.190733] flags: 0x200000000000000(node=0|zone=2)
[   25.190959] page_type: f5(slab)
[   25.191082] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   25.191309] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   25.191521] page dumped because: kasan: bad access detected
[   25.191782] 
[   25.191925] Memory state around the buggy address:
[   25.192169]  ffff888105380b00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.192510]  ffff888105380b80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.192828] >ffff888105380c00: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   25.193135]                                            ^
[   25.193646]  ffff888105380c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.194038]  ffff888105380d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.194308] ==================================================================