Hay
Date
July 5, 2025, 5:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.454176] ==================================================================
[   18.454243] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   18.454289] Free of addr fff00000c5cb3720 by task kunit_try_catch/192
[   18.454408] 
[   18.454521] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.454600] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.454626] Hardware name: linux,dummy-virt (DT)
[   18.454676] Call trace:
[   18.454705]  show_stack+0x20/0x38 (C)
[   18.454850]  dump_stack_lvl+0x8c/0xd0
[   18.454909]  print_report+0x118/0x608
[   18.454955]  kasan_report_invalid_free+0xc0/0xe8
[   18.455004]  check_slab_allocation+0xd4/0x108
[   18.455059]  __kasan_slab_pre_free+0x2c/0x48
[   18.455107]  kfree+0xe8/0x3c8
[   18.455148]  kfree_sensitive+0x3c/0xb0
[   18.455191]  kmalloc_double_kzfree+0x168/0x308
[   18.455239]  kunit_try_run_case+0x170/0x3f0
[   18.455285]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.455343]  kthread+0x328/0x630
[   18.455400]  ret_from_fork+0x10/0x20
[   18.455453] 
[   18.455471] Allocated by task 192:
[   18.455526]  kasan_save_stack+0x3c/0x68
[   18.455566]  kasan_save_track+0x20/0x40
[   18.455607]  kasan_save_alloc_info+0x40/0x58
[   18.455649]  __kasan_kmalloc+0xd4/0xd8
[   18.455686]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.455723]  kmalloc_double_kzfree+0xb8/0x308
[   18.455770]  kunit_try_run_case+0x170/0x3f0
[   18.455820]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.455909]  kthread+0x328/0x630
[   18.456207]  ret_from_fork+0x10/0x20
[   18.456263] 
[   18.456343] Freed by task 192:
[   18.456438]  kasan_save_stack+0x3c/0x68
[   18.456477]  kasan_save_track+0x20/0x40
[   18.456515]  kasan_save_free_info+0x4c/0x78
[   18.456553]  __kasan_slab_free+0x6c/0x98
[   18.456630]  kfree+0x214/0x3c8
[   18.456770]  kfree_sensitive+0x80/0xb0
[   18.456806]  kmalloc_double_kzfree+0x11c/0x308
[   18.456985]  kunit_try_run_case+0x170/0x3f0
[   18.457043]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.457147]  kthread+0x328/0x630
[   18.457236]  ret_from_fork+0x10/0x20
[   18.457289] 
[   18.457307] The buggy address belongs to the object at fff00000c5cb3720
[   18.457307]  which belongs to the cache kmalloc-16 of size 16
[   18.457361] The buggy address is located 0 bytes inside of
[   18.457361]  16-byte region [fff00000c5cb3720, fff00000c5cb3730)
[   18.457419] 
[   18.457438] The buggy address belongs to the physical page:
[   18.457517] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105cb3
[   18.457568] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.457661] page_type: f5(slab)
[   18.457745] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.458476] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.458538] page dumped because: kasan: bad access detected
[   18.458631] 
[   18.458654] Memory state around the buggy address:
[   18.458726]  fff00000c5cb3600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.458776]  fff00000c5cb3680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.458818] >fff00000c5cb3700: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   18.458855]                                ^
[   18.458895]  fff00000c5cb3780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.458937]  fff00000c5cb3800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.458975] ==================================================================

[   11.964837] ==================================================================
[   11.965120] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   11.965655] Free of addr ffff88810274c260 by task kunit_try_catch/210
[   11.966001] 
[   11.966112] CPU: 1 UID: 0 PID: 210 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.966154] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.966165] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.966185] Call Trace:
[   11.966243]  <TASK>
[   11.966259]  dump_stack_lvl+0x73/0xb0
[   11.966288]  print_report+0xd1/0x650
[   11.966310]  ? __virt_addr_valid+0x1db/0x2d0
[   11.966332]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.966353]  ? kfree_sensitive+0x2e/0x90
[   11.966373]  kasan_report_invalid_free+0x10a/0x130
[   11.966397]  ? kfree_sensitive+0x2e/0x90
[   11.966418]  ? kfree_sensitive+0x2e/0x90
[   11.966436]  check_slab_allocation+0x101/0x130
[   11.966473]  __kasan_slab_pre_free+0x28/0x40
[   11.966494]  kfree+0xf0/0x3f0
[   11.966516]  ? kfree_sensitive+0x2e/0x90
[   11.966537]  kfree_sensitive+0x2e/0x90
[   11.966556]  kmalloc_double_kzfree+0x19c/0x350
[   11.966578]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.966601]  ? __schedule+0x10cc/0x2b60
[   11.966623]  ? __pfx_read_tsc+0x10/0x10
[   11.966643]  ? ktime_get_ts64+0x86/0x230
[   11.966665]  kunit_try_run_case+0x1a5/0x480
[   11.966689]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.966710]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.966732]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.966754]  ? __kthread_parkme+0x82/0x180
[   11.966772]  ? preempt_count_sub+0x50/0x80
[   11.966795]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.966817]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.966838]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.966860]  kthread+0x337/0x6f0
[   11.966879]  ? trace_preempt_on+0x20/0xc0
[   11.966900]  ? __pfx_kthread+0x10/0x10
[   11.966920]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.966940]  ? calculate_sigpending+0x7b/0xa0
[   11.966962]  ? __pfx_kthread+0x10/0x10
[   11.966983]  ret_from_fork+0x116/0x1d0
[   11.967000]  ? __pfx_kthread+0x10/0x10
[   11.967019]  ret_from_fork_asm+0x1a/0x30
[   11.967049]  </TASK>
[   11.967061] 
[   11.975273] Allocated by task 210:
[   11.975444]  kasan_save_stack+0x45/0x70
[   11.975597]  kasan_save_track+0x18/0x40
[   11.975755]  kasan_save_alloc_info+0x3b/0x50
[   11.975969]  __kasan_kmalloc+0xb7/0xc0
[   11.976152]  __kmalloc_cache_noprof+0x189/0x420
[   11.976377]  kmalloc_double_kzfree+0xa9/0x350
[   11.976782]  kunit_try_run_case+0x1a5/0x480
[   11.976940]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.977245]  kthread+0x337/0x6f0
[   11.977441]  ret_from_fork+0x116/0x1d0
[   11.977632]  ret_from_fork_asm+0x1a/0x30
[   11.977825] 
[   11.977898] Freed by task 210:
[   11.978054]  kasan_save_stack+0x45/0x70
[   11.978298]  kasan_save_track+0x18/0x40
[   11.978490]  kasan_save_free_info+0x3f/0x60
[   11.978644]  __kasan_slab_free+0x56/0x70
[   11.978955]  kfree+0x222/0x3f0
[   11.979098]  kfree_sensitive+0x67/0x90
[   11.979331]  kmalloc_double_kzfree+0x12b/0x350
[   11.979521]  kunit_try_run_case+0x1a5/0x480
[   11.979725]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.980080]  kthread+0x337/0x6f0
[   11.980203]  ret_from_fork+0x116/0x1d0
[   11.980336]  ret_from_fork_asm+0x1a/0x30
[   11.980530] 
[   11.980629] The buggy address belongs to the object at ffff88810274c260
[   11.980629]  which belongs to the cache kmalloc-16 of size 16
[   11.981633] The buggy address is located 0 bytes inside of
[   11.981633]  16-byte region [ffff88810274c260, ffff88810274c270)
[   11.981976] 
[   11.982051] The buggy address belongs to the physical page:
[   11.982224] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10274c
[   11.982568] flags: 0x200000000000000(node=0|zone=2)
[   11.982801] page_type: f5(slab)
[   11.982973] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.983598] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.984181] page dumped because: kasan: bad access detected
[   11.984353] 
[   11.984424] Memory state around the buggy address:
[   11.984590]  ffff88810274c100: 00 02 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   11.984805]  ffff88810274c180: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.985024] >ffff88810274c200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.985669]                                                        ^
[   11.985964]  ffff88810274c280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.986286]  ffff88810274c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.986631] ==================================================================