Hay
Date
July 17, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.805818] ==================================================================
[   16.805918] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   16.805989] Read of size 1 at addr fff00000c3e55180 by task kunit_try_catch/192
[   16.806068] 
[   16.806127] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.806356] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.806528] Hardware name: linux,dummy-virt (DT)
[   16.806571] Call trace:
[   16.806600]  show_stack+0x20/0x38 (C)
[   16.806653]  dump_stack_lvl+0x8c/0xd0
[   16.806728]  print_report+0x118/0x5d0
[   16.806793]  kasan_report+0xdc/0x128
[   16.806853]  __kasan_check_byte+0x54/0x70
[   16.806914]  kfree_sensitive+0x30/0xb0
[   16.806959]  kmalloc_double_kzfree+0x168/0x308
[   16.807045]  kunit_try_run_case+0x170/0x3f0
[   16.807092]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.807149]  kthread+0x328/0x630
[   16.807191]  ret_from_fork+0x10/0x20
[   16.807247] 
[   16.807265] Allocated by task 192:
[   16.807334]  kasan_save_stack+0x3c/0x68
[   16.807380]  kasan_save_track+0x20/0x40
[   16.807416]  kasan_save_alloc_info+0x40/0x58
[   16.807595]  __kasan_kmalloc+0xd4/0xd8
[   16.807665]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.807707]  kmalloc_double_kzfree+0xb8/0x308
[   16.807816]  kunit_try_run_case+0x170/0x3f0
[   16.807855]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.807909]  kthread+0x328/0x630
[   16.808135]  ret_from_fork+0x10/0x20
[   16.808273] 
[   16.808331] Freed by task 192:
[   16.808358]  kasan_save_stack+0x3c/0x68
[   16.808395]  kasan_save_track+0x20/0x40
[   16.808456]  kasan_save_free_info+0x4c/0x78
[   16.808499]  __kasan_slab_free+0x6c/0x98
[   16.808680]  kfree+0x214/0x3c8
[   16.808833]  kfree_sensitive+0x80/0xb0
[   16.808886]  kmalloc_double_kzfree+0x11c/0x308
[   16.808963]  kunit_try_run_case+0x170/0x3f0
[   16.809214]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.809333]  kthread+0x328/0x630
[   16.809463]  ret_from_fork+0x10/0x20
[   16.809599] 
[   16.809736] The buggy address belongs to the object at fff00000c3e55180
[   16.809736]  which belongs to the cache kmalloc-16 of size 16
[   16.809824] The buggy address is located 0 bytes inside of
[   16.809824]  freed 16-byte region [fff00000c3e55180, fff00000c3e55190)
[   16.809957] 
[   16.810023] The buggy address belongs to the physical page:
[   16.810361] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103e55
[   16.810560] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.810704] page_type: f5(slab)
[   16.810777] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.810826] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.811174] page dumped because: kasan: bad access detected
[   16.811297] 
[   16.811365] Memory state around the buggy address:
[   16.811428]  fff00000c3e55080: 00 05 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.811508]  fff00000c3e55100: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.811582] >fff00000c3e55180: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.811648]                    ^
[   16.811736]  fff00000c3e55200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.811815]  fff00000c3e55280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.812039] ==================================================================

[   12.614179] ==================================================================
[   12.615162] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   12.615695] Read of size 1 at addr ffff8881025ee340 by task kunit_try_catch/209
[   12.616180] 
[   12.616299] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.616347] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.616358] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.616379] Call Trace:
[   12.616391]  <TASK>
[   12.616407]  dump_stack_lvl+0x73/0xb0
[   12.616436]  print_report+0xd1/0x610
[   12.616457]  ? __virt_addr_valid+0x1db/0x2d0
[   12.616480]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.616502]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.616524]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.616547]  kasan_report+0x141/0x180
[   12.616568]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.616742]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.616769]  __kasan_check_byte+0x3d/0x50
[   12.616791]  kfree_sensitive+0x22/0x90
[   12.616837]  kmalloc_double_kzfree+0x19c/0x350
[   12.616859]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   12.616920]  ? __schedule+0x10cc/0x2b60
[   12.616944]  ? __pfx_read_tsc+0x10/0x10
[   12.616964]  ? ktime_get_ts64+0x86/0x230
[   12.616988]  kunit_try_run_case+0x1a5/0x480
[   12.617012]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.617034]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.617067]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.617090]  ? __kthread_parkme+0x82/0x180
[   12.617109]  ? preempt_count_sub+0x50/0x80
[   12.617133]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.617155]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.617178]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.617201]  kthread+0x337/0x6f0
[   12.617219]  ? trace_preempt_on+0x20/0xc0
[   12.617241]  ? __pfx_kthread+0x10/0x10
[   12.617261]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.617282]  ? calculate_sigpending+0x7b/0xa0
[   12.617305]  ? __pfx_kthread+0x10/0x10
[   12.617325]  ret_from_fork+0x116/0x1d0
[   12.617343]  ? __pfx_kthread+0x10/0x10
[   12.617362]  ret_from_fork_asm+0x1a/0x30
[   12.617394]  </TASK>
[   12.617404] 
[   12.627454] Allocated by task 209:
[   12.627918]  kasan_save_stack+0x45/0x70
[   12.628387]  kasan_save_track+0x18/0x40
[   12.628671]  kasan_save_alloc_info+0x3b/0x50
[   12.628953]  __kasan_kmalloc+0xb7/0xc0
[   12.629160]  __kmalloc_cache_noprof+0x189/0x420
[   12.629321]  kmalloc_double_kzfree+0xa9/0x350
[   12.629472]  kunit_try_run_case+0x1a5/0x480
[   12.630737]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.631298]  kthread+0x337/0x6f0
[   12.632223]  ret_from_fork+0x116/0x1d0
[   12.632427]  ret_from_fork_asm+0x1a/0x30
[   12.632634] 
[   12.632732] Freed by task 209:
[   12.632892]  kasan_save_stack+0x45/0x70
[   12.633030]  kasan_save_track+0x18/0x40
[   12.633207]  kasan_save_free_info+0x3f/0x60
[   12.633599]  __kasan_slab_free+0x56/0x70
[   12.633750]  kfree+0x222/0x3f0
[   12.633936]  kfree_sensitive+0x67/0x90
[   12.634094]  kmalloc_double_kzfree+0x12b/0x350
[   12.634308]  kunit_try_run_case+0x1a5/0x480
[   12.634523]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.634884]  kthread+0x337/0x6f0
[   12.635042]  ret_from_fork+0x116/0x1d0
[   12.635222]  ret_from_fork_asm+0x1a/0x30
[   12.635373] 
[   12.635471] The buggy address belongs to the object at ffff8881025ee340
[   12.635471]  which belongs to the cache kmalloc-16 of size 16
[   12.636171] The buggy address is located 0 bytes inside of
[   12.636171]  freed 16-byte region [ffff8881025ee340, ffff8881025ee350)
[   12.636733] 
[   12.636881] The buggy address belongs to the physical page:
[   12.637129] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1025ee
[   12.637424] flags: 0x200000000000000(node=0|zone=2)
[   12.637711] page_type: f5(slab)
[   12.638141] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.638493] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.638926] page dumped because: kasan: bad access detected
[   12.639205] 
[   12.639281] Memory state around the buggy address:
[   12.639516]  ffff8881025ee200: 00 02 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   12.639887]  ffff8881025ee280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   12.640199] >ffff8881025ee300: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   12.640516]                                            ^
[   12.640702]  ffff8881025ee380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.640909]  ffff8881025ee400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.641289] ==================================================================