Hay
Date
July 8, 2025, 4:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.024136] ==================================================================
[   18.024201] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   18.024264] Free of addr fff00000c5cff700 by task kunit_try_catch/194
[   18.024306] 
[   18.024347] CPU: 1 UID: 0 PID: 194 Comm: kunit_try_catch Tainted: G    B            N  6.15.6-rc1 #1 PREEMPT 
[   18.024790] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.024890] Hardware name: linux,dummy-virt (DT)
[   18.024958] Call trace:
[   18.025009]  show_stack+0x20/0x38 (C)
[   18.025059]  dump_stack_lvl+0x8c/0xd0
[   18.025108]  print_report+0x118/0x608
[   18.025152]  kasan_report_invalid_free+0xc0/0xe8
[   18.025201]  check_slab_allocation+0xd4/0x108
[   18.025377]  __kasan_slab_pre_free+0x2c/0x48
[   18.025452]  kfree+0xe8/0x3c8
[   18.025506]  kfree_sensitive+0x3c/0xb0
[   18.025553]  kmalloc_double_kzfree+0x168/0x308
[   18.025601]  kunit_try_run_case+0x170/0x3f0
[   18.025650]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.025703]  kthread+0x328/0x630
[   18.025815]  ret_from_fork+0x10/0x20
[   18.025912] 
[   18.025970] Allocated by task 194:
[   18.025999]  kasan_save_stack+0x3c/0x68
[   18.026066]  kasan_save_track+0x20/0x40
[   18.026145]  kasan_save_alloc_info+0x40/0x58
[   18.026212]  __kasan_kmalloc+0xd4/0xd8
[   18.026247]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.026517]  kmalloc_double_kzfree+0xb8/0x308
[   18.026598]  kunit_try_run_case+0x170/0x3f0
[   18.026639]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.026710]  kthread+0x328/0x630
[   18.026787]  ret_from_fork+0x10/0x20
[   18.026875] 
[   18.026925] Freed by task 194:
[   18.026971]  kasan_save_stack+0x3c/0x68
[   18.027008]  kasan_save_track+0x20/0x40
[   18.027045]  kasan_save_free_info+0x4c/0x78
[   18.027081]  __kasan_slab_free+0x6c/0x98
[   18.027118]  kfree+0x214/0x3c8
[   18.027149]  kfree_sensitive+0x80/0xb0
[   18.027265]  kmalloc_double_kzfree+0x11c/0x308
[   18.027358]  kunit_try_run_case+0x170/0x3f0
[   18.027469]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.027538]  kthread+0x328/0x630
[   18.027606]  ret_from_fork+0x10/0x20
[   18.027710] 
[   18.027758] The buggy address belongs to the object at fff00000c5cff700
[   18.027758]  which belongs to the cache kmalloc-16 of size 16
[   18.027823] The buggy address is located 0 bytes inside of
[   18.027823]  16-byte region [fff00000c5cff700, fff00000c5cff710)
[   18.028063] 
[   18.028141] The buggy address belongs to the physical page:
[   18.028193] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105cff
[   18.028284] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.028391] page_type: f5(slab)
[   18.028488] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.028772] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.028817] page dumped because: kasan: bad access detected
[   18.028850] 
[   18.029952] Memory state around the buggy address:
[   18.030012]  fff00000c5cff600: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.030068]  fff00000c5cff680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.030127] >fff00000c5cff700: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.030165]                    ^
[   18.030191]  fff00000c5cff780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.030242]  fff00000c5cff800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.030282] ==================================================================

[   11.672599] ==================================================================
[   11.672855] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   11.673500] Free of addr ffff88810242c940 by task kunit_try_catch/212
[   11.674163] 
[   11.674337] CPU: 0 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.15.6-rc1 #1 PREEMPT(voluntary) 
[   11.674400] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.674412] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.674434] Call Trace:
[   11.674447]  <TASK>
[   11.674463]  dump_stack_lvl+0x73/0xb0
[   11.674490]  print_report+0xd1/0x650
[   11.674563]  ? __virt_addr_valid+0x1db/0x2d0
[   11.674602]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.674625]  ? kfree_sensitive+0x2e/0x90
[   11.674647]  kasan_report_invalid_free+0x10a/0x130
[   11.674673]  ? kfree_sensitive+0x2e/0x90
[   11.674696]  ? kfree_sensitive+0x2e/0x90
[   11.674717]  check_slab_allocation+0x101/0x130
[   11.674739]  __kasan_slab_pre_free+0x28/0x40
[   11.674761]  kfree+0xf0/0x3f0
[   11.674779]  ? kfree_sensitive+0x2e/0x90
[   11.674802]  kfree_sensitive+0x2e/0x90
[   11.674823]  kmalloc_double_kzfree+0x19c/0x350
[   11.674896]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.674920]  ? __schedule+0x10cc/0x2b60
[   11.674944]  ? __pfx_read_tsc+0x10/0x10
[   11.674965]  ? ktime_get_ts64+0x86/0x230
[   11.674990]  kunit_try_run_case+0x1a5/0x480
[   11.675012]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.675032]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.675057]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.675081]  ? __kthread_parkme+0x82/0x180
[   11.675103]  ? preempt_count_sub+0x50/0x80
[   11.675128]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.675148]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.675172]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.675195]  kthread+0x337/0x6f0
[   11.675212]  ? trace_preempt_on+0x20/0xc0
[   11.675234]  ? __pfx_kthread+0x10/0x10
[   11.675253]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.675275]  ? calculate_sigpending+0x7b/0xa0
[   11.675296]  ? __pfx_kthread+0x10/0x10
[   11.675314]  ret_from_fork+0x41/0x80
[   11.675336]  ? __pfx_kthread+0x10/0x10
[   11.675354]  ret_from_fork_asm+0x1a/0x30
[   11.675384]  </TASK>
[   11.675395] 
[   11.686532] Allocated by task 212:
[   11.687124]  kasan_save_stack+0x45/0x70
[   11.687336]  kasan_save_track+0x18/0x40
[   11.687797]  kasan_save_alloc_info+0x3b/0x50
[   11.688160]  __kasan_kmalloc+0xb7/0xc0
[   11.688439]  __kmalloc_cache_noprof+0x189/0x420
[   11.688741]  kmalloc_double_kzfree+0xa9/0x350
[   11.689230]  kunit_try_run_case+0x1a5/0x480
[   11.689458]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.690022]  kthread+0x337/0x6f0
[   11.690167]  ret_from_fork+0x41/0x80
[   11.690383]  ret_from_fork_asm+0x1a/0x30
[   11.690718] 
[   11.691064] Freed by task 212:
[   11.691227]  kasan_save_stack+0x45/0x70
[   11.691387]  kasan_save_track+0x18/0x40
[   11.691850]  kasan_save_free_info+0x3f/0x60
[   11.692082]  __kasan_slab_free+0x56/0x70
[   11.692305]  kfree+0x222/0x3f0
[   11.692476]  kfree_sensitive+0x67/0x90
[   11.692889]  kmalloc_double_kzfree+0x12b/0x350
[   11.693103]  kunit_try_run_case+0x1a5/0x480
[   11.693264]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.693761]  kthread+0x337/0x6f0
[   11.693917]  ret_from_fork+0x41/0x80
[   11.694269]  ret_from_fork_asm+0x1a/0x30
[   11.694483] 
[   11.694558] The buggy address belongs to the object at ffff88810242c940
[   11.694558]  which belongs to the cache kmalloc-16 of size 16
[   11.695210] The buggy address is located 0 bytes inside of
[   11.695210]  16-byte region [ffff88810242c940, ffff88810242c950)
[   11.696105] 
[   11.696215] The buggy address belongs to the physical page:
[   11.696481] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10242c
[   11.697070] flags: 0x200000000000000(node=0|zone=2)
[   11.697490] page_type: f5(slab)
[   11.697956] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.698439] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.699054] page dumped because: kasan: bad access detected
[   11.699805] 
[   11.700122] Memory state around the buggy address:
[   11.700770]  ffff88810242c800: 00 04 fc fc 00 00 fc fc 00 04 fc fc 00 04 fc fc
[   11.701198]  ffff88810242c880: 00 00 fc fc 00 04 fc fc fa fb fc fc fa fb fc fc
[   11.701412] >ffff88810242c900: 00 05 fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   11.701648]                                            ^
[   11.702170]  ffff88810242c980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.702672]  ffff88810242ca00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.703126] ==================================================================