Hay
Date
July 2, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.343930] ==================================================================
[   18.344003] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   18.344051] Free of addr fff00000c3f3ec80 by task kunit_try_catch/192
[   18.344094] 
[   18.344168] CPU: 0 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.344256] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.344282] Hardware name: linux,dummy-virt (DT)
[   18.344333] Call trace:
[   18.344356]  show_stack+0x20/0x38 (C)
[   18.344415]  dump_stack_lvl+0x8c/0xd0
[   18.344471]  print_report+0x118/0x608
[   18.344517]  kasan_report_invalid_free+0xc0/0xe8
[   18.344567]  check_slab_allocation+0xd4/0x108
[   18.345568]  __kasan_slab_pre_free+0x2c/0x48
[   18.345753]  kfree+0xe8/0x3c8
[   18.345872]  kfree_sensitive+0x3c/0xb0
[   18.345924]  kmalloc_double_kzfree+0x168/0x308
[   18.346012]  kunit_try_run_case+0x170/0x3f0
[   18.346350]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.346421]  kthread+0x328/0x630
[   18.346494]  ret_from_fork+0x10/0x20
[   18.346592] 
[   18.346635] Allocated by task 192:
[   18.346693]  kasan_save_stack+0x3c/0x68
[   18.346767]  kasan_save_track+0x20/0x40
[   18.347065]  kasan_save_alloc_info+0x40/0x58
[   18.347142]  __kasan_kmalloc+0xd4/0xd8
[   18.347208]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.347274]  kmalloc_double_kzfree+0xb8/0x308
[   18.347314]  kunit_try_run_case+0x170/0x3f0
[   18.347607]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.347694]  kthread+0x328/0x630
[   18.347770]  ret_from_fork+0x10/0x20
[   18.347809] 
[   18.348114] Freed by task 192:
[   18.348183]  kasan_save_stack+0x3c/0x68
[   18.348275]  kasan_save_track+0x20/0x40
[   18.348565]  kasan_save_free_info+0x4c/0x78
[   18.348869]  __kasan_slab_free+0x6c/0x98
[   18.348949]  kfree+0x214/0x3c8
[   18.349012]  kfree_sensitive+0x80/0xb0
[   18.349175]  kmalloc_double_kzfree+0x11c/0x308
[   18.349318]  kunit_try_run_case+0x170/0x3f0
[   18.349359]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.349403]  kthread+0x328/0x630
[   18.349437]  ret_from_fork+0x10/0x20
[   18.349792] 
[   18.349888] The buggy address belongs to the object at fff00000c3f3ec80
[   18.349888]  which belongs to the cache kmalloc-16 of size 16
[   18.350079] The buggy address is located 0 bytes inside of
[   18.350079]  16-byte region [fff00000c3f3ec80, fff00000c3f3ec90)
[   18.350243] 
[   18.350386] The buggy address belongs to the physical page:
[   18.350436] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f3e
[   18.350664] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.350847] page_type: f5(slab)
[   18.350910] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.351131] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.351304] page dumped because: kasan: bad access detected
[   18.351642] 
[   18.351779] Memory state around the buggy address:
[   18.351918]  fff00000c3f3eb80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.351994]  fff00000c3f3ec00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.352169] >fff00000c3f3ec80: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.352268]                    ^
[   18.352300]  fff00000c3f3ed00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.352703]  fff00000c3f3ed80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.352835] ==================================================================

[   11.763668] ==================================================================
[   11.763961] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   11.764314] Free of addr ffff8881027960c0 by task kunit_try_catch/211
[   11.764570] 
[   11.764693] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.764732] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.764743] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.764762] Call Trace:
[   11.764778]  <TASK>
[   11.764796]  dump_stack_lvl+0x73/0xb0
[   11.764822]  print_report+0xd1/0x650
[   11.764844]  ? __virt_addr_valid+0x1db/0x2d0
[   11.764867]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.764887]  ? kfree_sensitive+0x2e/0x90
[   11.764907]  kasan_report_invalid_free+0x10a/0x130
[   11.764993]  ? kfree_sensitive+0x2e/0x90
[   11.765014]  ? kfree_sensitive+0x2e/0x90
[   11.765032]  check_slab_allocation+0x101/0x130
[   11.765053]  __kasan_slab_pre_free+0x28/0x40
[   11.765072]  kfree+0xf0/0x3f0
[   11.765094]  ? kfree_sensitive+0x2e/0x90
[   11.765115]  kfree_sensitive+0x2e/0x90
[   11.765133]  kmalloc_double_kzfree+0x19c/0x350
[   11.765155]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.765177]  ? __schedule+0x10cc/0x2b60
[   11.765199]  ? __pfx_read_tsc+0x10/0x10
[   11.765220]  ? ktime_get_ts64+0x86/0x230
[   11.765243]  kunit_try_run_case+0x1a5/0x480
[   11.765265]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.765286]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.765308]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.765329]  ? __kthread_parkme+0x82/0x180
[   11.765350]  ? preempt_count_sub+0x50/0x80
[   11.765383]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.765405]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.765427]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.765448]  kthread+0x337/0x6f0
[   11.765466]  ? trace_preempt_on+0x20/0xc0
[   11.765488]  ? __pfx_kthread+0x10/0x10
[   11.765507]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.765527]  ? calculate_sigpending+0x7b/0xa0
[   11.765549]  ? __pfx_kthread+0x10/0x10
[   11.765569]  ret_from_fork+0x116/0x1d0
[   11.765587]  ? __pfx_kthread+0x10/0x10
[   11.765606]  ret_from_fork_asm+0x1a/0x30
[   11.765635]  </TASK>
[   11.765645] 
[   11.773587] Allocated by task 211:
[   11.773912]  kasan_save_stack+0x45/0x70
[   11.774388]  kasan_save_track+0x18/0x40
[   11.774664]  kasan_save_alloc_info+0x3b/0x50
[   11.774880]  __kasan_kmalloc+0xb7/0xc0
[   11.775012]  __kmalloc_cache_noprof+0x189/0x420
[   11.775166]  kmalloc_double_kzfree+0xa9/0x350
[   11.775389]  kunit_try_run_case+0x1a5/0x480
[   11.775665]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.776038]  kthread+0x337/0x6f0
[   11.776218]  ret_from_fork+0x116/0x1d0
[   11.776352]  ret_from_fork_asm+0x1a/0x30
[   11.776500] 
[   11.776570] Freed by task 211:
[   11.776679]  kasan_save_stack+0x45/0x70
[   11.776812]  kasan_save_track+0x18/0x40
[   11.776943]  kasan_save_free_info+0x3f/0x60
[   11.777149]  __kasan_slab_free+0x56/0x70
[   11.777344]  kfree+0x222/0x3f0
[   11.777522]  kfree_sensitive+0x67/0x90
[   11.777713]  kmalloc_double_kzfree+0x12b/0x350
[   11.778130]  kunit_try_run_case+0x1a5/0x480
[   11.778408]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.778850]  kthread+0x337/0x6f0
[   11.779007]  ret_from_fork+0x116/0x1d0
[   11.779174]  ret_from_fork_asm+0x1a/0x30
[   11.779325] 
[   11.779407] The buggy address belongs to the object at ffff8881027960c0
[   11.779407]  which belongs to the cache kmalloc-16 of size 16
[   11.780256] The buggy address is located 0 bytes inside of
[   11.780256]  16-byte region [ffff8881027960c0, ffff8881027960d0)
[   11.780599] 
[   11.780672] The buggy address belongs to the physical page:
[   11.781033] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102796
[   11.781750] flags: 0x200000000000000(node=0|zone=2)
[   11.782006] page_type: f5(slab)
[   11.782177] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.782521] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.782957] page dumped because: kasan: bad access detected
[   11.783164] 
[   11.783233] Memory state around the buggy address:
[   11.783400]  ffff888102795f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.783922]  ffff888102796000: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.784249] >ffff888102796080: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   11.784537]                                            ^
[   11.785004]  ffff888102796100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.785292]  ffff888102796180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.785555] ==================================================================