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

Environment
qemu-arm64
qemu-x86_64

[   29.693138] ==================================================================
[   29.693252] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   29.693325] Read of size 1 at addr fff00000c5a48a40 by task kunit_try_catch/225
[   29.693419] 
[   29.693511] CPU: 0 UID: 0 PID: 225 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT 
[   29.693599] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.693624] Hardware name: linux,dummy-virt (DT)
[   29.693751] Call trace:
[   29.693805]  show_stack+0x20/0x38 (C)
[   29.693858]  dump_stack_lvl+0x8c/0xd0
[   29.693925]  print_report+0x118/0x608
[   29.694001]  kasan_report+0xdc/0x128
[   29.694240]  __kasan_check_byte+0x54/0x70
[   29.694298]  kfree_sensitive+0x30/0xb0
[   29.694371]  kmalloc_double_kzfree+0x168/0x308
[   29.694422]  kunit_try_run_case+0x170/0x3f0
[   29.694482]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.694538]  kthread+0x328/0x630
[   29.694590]  ret_from_fork+0x10/0x20
[   29.694638] 
[   29.694671] Allocated by task 225:
[   29.694701]  kasan_save_stack+0x3c/0x68
[   29.694742]  kasan_save_track+0x20/0x40
[   29.694780]  kasan_save_alloc_info+0x40/0x58
[   29.694828]  __kasan_kmalloc+0xd4/0xd8
[   29.694887]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.694950]  kmalloc_double_kzfree+0xb8/0x308
[   29.694999]  kunit_try_run_case+0x170/0x3f0
[   29.695040]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.695109]  kthread+0x328/0x630
[   29.695144]  ret_from_fork+0x10/0x20
[   29.695190] 
[   29.695221] Freed by task 225:
[   29.695248]  kasan_save_stack+0x3c/0x68
[   29.695298]  kasan_save_track+0x20/0x40
[   29.695348]  kasan_save_free_info+0x4c/0x78
[   29.695384]  __kasan_slab_free+0x6c/0x98
[   29.695422]  kfree+0x214/0x3c8
[   29.695466]  kfree_sensitive+0x80/0xb0
[   29.695503]  kmalloc_double_kzfree+0x11c/0x308
[   29.695559]  kunit_try_run_case+0x170/0x3f0
[   29.695599]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.695650]  kthread+0x328/0x630
[   29.695683]  ret_from_fork+0x10/0x20
[   29.695719] 
[   29.695739] The buggy address belongs to the object at fff00000c5a48a40
[   29.695739]  which belongs to the cache kmalloc-16 of size 16
[   29.695796] The buggy address is located 0 bytes inside of
[   29.695796]  freed 16-byte region [fff00000c5a48a40, fff00000c5a48a50)
[   29.695857] 
[   29.696171] The buggy address belongs to the physical page:
[   29.696261] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a48
[   29.696360] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.696790] page_type: f5(slab)
[   29.696840] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   29.697214] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   29.697283] page dumped because: kasan: bad access detected
[   29.697378] 
[   29.697441] Memory state around the buggy address:
[   29.697508]  fff00000c5a48900: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   29.697576]  fff00000c5a48980: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.697651] >fff00000c5a48a00: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   29.697690]                                            ^
[   29.697753]  fff00000c5a48a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.697796]  fff00000c5a48b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.698040] ==================================================================

[   25.271047] ==================================================================
[   25.271871] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   25.272592] Read of size 1 at addr ffff88810527f2c0 by task kunit_try_catch/241
[   25.272881] 
[   25.273001] CPU: 1 UID: 0 PID: 241 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) 
[   25.273053] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.273066] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.273091] Call Trace:
[   25.273104]  <TASK>
[   25.273123]  dump_stack_lvl+0x73/0xb0
[   25.273154]  print_report+0xd1/0x650
[   25.273177]  ? __virt_addr_valid+0x1db/0x2d0
[   25.273201]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.273223]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.273261]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.273285]  kasan_report+0x141/0x180
[   25.273307]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.273332]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.273355]  __kasan_check_byte+0x3d/0x50
[   25.273376]  kfree_sensitive+0x22/0x90
[   25.273416]  kmalloc_double_kzfree+0x19c/0x350
[   25.273439]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   25.273462]  ? __schedule+0x10cc/0x2b60
[   25.273488]  ? __pfx_read_tsc+0x10/0x10
[   25.273510]  ? ktime_get_ts64+0x86/0x230
[   25.273536]  kunit_try_run_case+0x1a5/0x480
[   25.273562]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.273585]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.273609]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.273634]  ? __kthread_parkme+0x82/0x180
[   25.273654]  ? preempt_count_sub+0x50/0x80
[   25.273678]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.273703]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.273728]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.273752]  kthread+0x337/0x6f0
[   25.273772]  ? trace_preempt_on+0x20/0xc0
[   25.273796]  ? __pfx_kthread+0x10/0x10
[   25.273817]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.273840]  ? calculate_sigpending+0x7b/0xa0
[   25.273864]  ? __pfx_kthread+0x10/0x10
[   25.273929]  ret_from_fork+0x116/0x1d0
[   25.273954]  ? __pfx_kthread+0x10/0x10
[   25.273975]  ret_from_fork_asm+0x1a/0x30
[   25.274008]  </TASK>
[   25.274022] 
[   25.281966] Allocated by task 241:
[   25.282155]  kasan_save_stack+0x45/0x70
[   25.282412]  kasan_save_track+0x18/0x40
[   25.282598]  kasan_save_alloc_info+0x3b/0x50
[   25.282784]  __kasan_kmalloc+0xb7/0xc0
[   25.282978]  __kmalloc_cache_noprof+0x189/0x420
[   25.283156]  kmalloc_double_kzfree+0xa9/0x350
[   25.283382]  kunit_try_run_case+0x1a5/0x480
[   25.283791]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.284091]  kthread+0x337/0x6f0
[   25.284300]  ret_from_fork+0x116/0x1d0
[   25.284446]  ret_from_fork_asm+0x1a/0x30
[   25.284586] 
[   25.284654] Freed by task 241:
[   25.284765]  kasan_save_stack+0x45/0x70
[   25.284955]  kasan_save_track+0x18/0x40
[   25.285146]  kasan_save_free_info+0x3f/0x60
[   25.285402]  __kasan_slab_free+0x56/0x70
[   25.285738]  kfree+0x222/0x3f0
[   25.285967]  kfree_sensitive+0x67/0x90
[   25.286157]  kmalloc_double_kzfree+0x12b/0x350
[   25.286311]  kunit_try_run_case+0x1a5/0x480
[   25.286471]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.286649]  kthread+0x337/0x6f0
[   25.286871]  ret_from_fork+0x116/0x1d0
[   25.287070]  ret_from_fork_asm+0x1a/0x30
[   25.287272] 
[   25.287370] The buggy address belongs to the object at ffff88810527f2c0
[   25.287370]  which belongs to the cache kmalloc-16 of size 16
[   25.288193] The buggy address is located 0 bytes inside of
[   25.288193]  freed 16-byte region [ffff88810527f2c0, ffff88810527f2d0)
[   25.288832] 
[   25.288955] The buggy address belongs to the physical page:
[   25.289137] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10527f
[   25.289382] flags: 0x200000000000000(node=0|zone=2)
[   25.289880] page_type: f5(slab)
[   25.290079] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   25.290443] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   25.290800] page dumped because: kasan: bad access detected
[   25.291131] 
[   25.291228] Memory state around the buggy address:
[   25.291425]  ffff88810527f180: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.291663]  ffff88810527f200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.292597] >ffff88810527f280: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   25.292843]                                            ^
[   25.293038]  ffff88810527f300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.293376]  ffff88810527f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.293611] ==================================================================