Hay
Date
July 1, 2025, 3:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.211267] ==================================================================
[   17.211344] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   17.211396] Free of addr fff00000c56b6140 by task kunit_try_catch/193
[   17.211465] 
[   17.211504] CPU: 1 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   17.211861] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.211902] Hardware name: linux,dummy-virt (DT)
[   17.212193] Call trace:
[   17.212233]  show_stack+0x20/0x38 (C)
[   17.212287]  dump_stack_lvl+0x8c/0xd0
[   17.212345]  print_report+0x118/0x608
[   17.212390]  kasan_report_invalid_free+0xc0/0xe8
[   17.212703]  check_slab_allocation+0xd4/0x108
[   17.212784]  __kasan_slab_pre_free+0x2c/0x48
[   17.212837]  kfree+0xe8/0x3c8
[   17.212999]  kfree_sensitive+0x3c/0xb0
[   17.213186]  kmalloc_double_kzfree+0x168/0x308
[   17.213359]  kunit_try_run_case+0x170/0x3f0
[   17.213504]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.213561]  kthread+0x328/0x630
[   17.213866]  ret_from_fork+0x10/0x20
[   17.213934] 
[   17.214006] Allocated by task 193:
[   17.214084]  kasan_save_stack+0x3c/0x68
[   17.214162]  kasan_save_track+0x20/0x40
[   17.214251]  kasan_save_alloc_info+0x40/0x58
[   17.214330]  __kasan_kmalloc+0xd4/0xd8
[   17.214622]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.214711]  kmalloc_double_kzfree+0xb8/0x308
[   17.214839]  kunit_try_run_case+0x170/0x3f0
[   17.214906]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.215003]  kthread+0x328/0x630
[   17.215037]  ret_from_fork+0x10/0x20
[   17.215113] 
[   17.215410] Freed by task 193:
[   17.215582]  kasan_save_stack+0x3c/0x68
[   17.215644]  kasan_save_track+0x20/0x40
[   17.216047]  kasan_save_free_info+0x4c/0x78
[   17.216130]  __kasan_slab_free+0x6c/0x98
[   17.216229]  kfree+0x214/0x3c8
[   17.216264]  kfree_sensitive+0x80/0xb0
[   17.216655]  kmalloc_double_kzfree+0x11c/0x308
[   17.216735]  kunit_try_run_case+0x170/0x3f0
[   17.216855]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.216944]  kthread+0x328/0x630
[   17.216999]  ret_from_fork+0x10/0x20
[   17.217036] 
[   17.217383] The buggy address belongs to the object at fff00000c56b6140
[   17.217383]  which belongs to the cache kmalloc-16 of size 16
[   17.217469] The buggy address is located 0 bytes inside of
[   17.217469]  16-byte region [fff00000c56b6140, fff00000c56b6150)
[   17.217548] 
[   17.217578] The buggy address belongs to the physical page:
[   17.217776] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056b6
[   17.218028] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.218126] page_type: f5(slab)
[   17.218444] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   17.218521] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   17.218827] page dumped because: kasan: bad access detected
[   17.218946] 
[   17.219017] Memory state around the buggy address:
[   17.219053]  fff00000c56b6000: fa fb fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   17.219420]  fff00000c56b6080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.219500] >fff00000c56b6100: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   17.219589]                                            ^
[   17.219626]  fff00000c56b6180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.219999]  fff00000c56b6200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.220099] ==================================================================

[   11.998006] ==================================================================
[   11.998510] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   11.999059] Free of addr ffff88810191e8c0 by task kunit_try_catch/209
[   11.999526] 
[   11.999945] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.000046] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.000059] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.000079] Call Trace:
[   12.000091]  <TASK>
[   12.000109]  dump_stack_lvl+0x73/0xb0
[   12.000138]  print_report+0xd1/0x650
[   12.000166]  ? __virt_addr_valid+0x1db/0x2d0
[   12.000189]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.000210]  ? kfree_sensitive+0x2e/0x90
[   12.000230]  kasan_report_invalid_free+0x10a/0x130
[   12.000253]  ? kfree_sensitive+0x2e/0x90
[   12.000274]  ? kfree_sensitive+0x2e/0x90
[   12.000292]  check_slab_allocation+0x101/0x130
[   12.000312]  __kasan_slab_pre_free+0x28/0x40
[   12.000332]  kfree+0xf0/0x3f0
[   12.000354]  ? kfree_sensitive+0x2e/0x90
[   12.000375]  kfree_sensitive+0x2e/0x90
[   12.000393]  kmalloc_double_kzfree+0x19c/0x350
[   12.000414]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   12.000437]  ? __schedule+0x10cc/0x2b60
[   12.000458]  ? __pfx_read_tsc+0x10/0x10
[   12.000478]  ? ktime_get_ts64+0x86/0x230
[   12.000501]  kunit_try_run_case+0x1a5/0x480
[   12.000523]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.000544]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.000567]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.000588]  ? __kthread_parkme+0x82/0x180
[   12.000608]  ? preempt_count_sub+0x50/0x80
[   12.000630]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.000652]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.000673]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.000695]  kthread+0x337/0x6f0
[   12.000713]  ? trace_preempt_on+0x20/0xc0
[   12.000735]  ? __pfx_kthread+0x10/0x10
[   12.000755]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.000774]  ? calculate_sigpending+0x7b/0xa0
[   12.000797]  ? __pfx_kthread+0x10/0x10
[   12.000817]  ret_from_fork+0x116/0x1d0
[   12.000850]  ? __pfx_kthread+0x10/0x10
[   12.000870]  ret_from_fork_asm+0x1a/0x30
[   12.000901]  </TASK>
[   12.000912] 
[   12.010217] Allocated by task 209:
[   12.010394]  kasan_save_stack+0x45/0x70
[   12.010547]  kasan_save_track+0x18/0x40
[   12.010895]  kasan_save_alloc_info+0x3b/0x50
[   12.011132]  __kasan_kmalloc+0xb7/0xc0
[   12.011425]  __kmalloc_cache_noprof+0x189/0x420
[   12.011631]  kmalloc_double_kzfree+0xa9/0x350
[   12.011910]  kunit_try_run_case+0x1a5/0x480
[   12.012265]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.012555]  kthread+0x337/0x6f0
[   12.012736]  ret_from_fork+0x116/0x1d0
[   12.012981]  ret_from_fork_asm+0x1a/0x30
[   12.013250] 
[   12.013369] Freed by task 209:
[   12.013527]  kasan_save_stack+0x45/0x70
[   12.013897]  kasan_save_track+0x18/0x40
[   12.014057]  kasan_save_free_info+0x3f/0x60
[   12.014199]  __kasan_slab_free+0x56/0x70
[   12.014329]  kfree+0x222/0x3f0
[   12.014492]  kfree_sensitive+0x67/0x90
[   12.014920]  kmalloc_double_kzfree+0x12b/0x350
[   12.015396]  kunit_try_run_case+0x1a5/0x480
[   12.015594]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.015896]  kthread+0x337/0x6f0
[   12.016012]  ret_from_fork+0x116/0x1d0
[   12.016155]  ret_from_fork_asm+0x1a/0x30
[   12.016505] 
[   12.016845] The buggy address belongs to the object at ffff88810191e8c0
[   12.016845]  which belongs to the cache kmalloc-16 of size 16
[   12.017435] The buggy address is located 0 bytes inside of
[   12.017435]  16-byte region [ffff88810191e8c0, ffff88810191e8d0)
[   12.018082] 
[   12.018159] The buggy address belongs to the physical page:
[   12.018343] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10191e
[   12.018923] flags: 0x200000000000000(node=0|zone=2)
[   12.019361] page_type: f5(slab)
[   12.019497] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.019861] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.020313] page dumped because: kasan: bad access detected
[   12.020597] 
[   12.020693] Memory state around the buggy address:
[   12.021037]  ffff88810191e780: 00 05 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   12.021633]  ffff88810191e800: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   12.022151] >ffff88810191e880: 00 05 fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   12.022419]                                            ^
[   12.023112]  ffff88810191e900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.023362]  ffff88810191e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.023679] ==================================================================