Hay
Date
July 24, 2025, 4:41 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.722788] ==================================================================
[   32.722883] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   32.723115] Free of addr fff00000c8683500 by task kunit_try_catch/223
[   32.723236] 
[   32.723399] CPU: 0 UID: 0 PID: 223 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250724 #1 PREEMPT 
[   32.723569] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.723659] Hardware name: linux,dummy-virt (DT)
[   32.723716] Call trace:
[   32.723828]  show_stack+0x20/0x38 (C)
[   32.723882]  dump_stack_lvl+0x8c/0xd0
[   32.723929]  print_report+0x118/0x5e8
[   32.723981]  kasan_report_invalid_free+0xc0/0xe8
[   32.724513]  check_slab_allocation+0xd4/0x108
[   32.724610]  __kasan_slab_pre_free+0x2c/0x48
[   32.724783]  kfree+0xe8/0x3c8
[   32.724898]  kfree_sensitive+0x3c/0xb0
[   32.725112]  kmalloc_double_kzfree+0x168/0x308
[   32.725439]  kunit_try_run_case+0x170/0x3f0
[   32.725537]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.725679]  kthread+0x328/0x630
[   32.725797]  ret_from_fork+0x10/0x20
[   32.726239] 
[   32.726284] Allocated by task 223:
[   32.726394]  kasan_save_stack+0x3c/0x68
[   32.726485]  kasan_save_track+0x20/0x40
[   32.726785]  kasan_save_alloc_info+0x40/0x58
[   32.727017]  __kasan_kmalloc+0xd4/0xd8
[   32.727196]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.727266]  kmalloc_double_kzfree+0xb8/0x308
[   32.727419]  kunit_try_run_case+0x170/0x3f0
[   32.727495]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.727687]  kthread+0x328/0x630
[   32.727736]  ret_from_fork+0x10/0x20
[   32.727787] 
[   32.727807] Freed by task 223:
[   32.728192]  kasan_save_stack+0x3c/0x68
[   32.728319]  kasan_save_track+0x20/0x40
[   32.728397]  kasan_save_free_info+0x4c/0x78
[   32.728532]  __kasan_slab_free+0x6c/0x98
[   32.728567]  kfree+0x214/0x3c8
[   32.728603]  kfree_sensitive+0x80/0xb0
[   32.728648]  kmalloc_double_kzfree+0x11c/0x308
[   32.728688]  kunit_try_run_case+0x170/0x3f0
[   32.728726]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.728779]  kthread+0x328/0x630
[   32.728811]  ret_from_fork+0x10/0x20
[   32.728847] 
[   32.728918] The buggy address belongs to the object at fff00000c8683500
[   32.728918]  which belongs to the cache kmalloc-16 of size 16
[   32.729015] The buggy address is located 0 bytes inside of
[   32.729015]  16-byte region [fff00000c8683500, fff00000c8683510)
[   32.729077] 
[   32.729098] The buggy address belongs to the physical page:
[   32.729143] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x108683
[   32.729208] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.729259] page_type: f5(slab)
[   32.729298] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   32.729360] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   32.729402] page dumped because: kasan: bad access detected
[   32.729433] 
[   32.729463] Memory state around the buggy address:
[   32.729496]  fff00000c8683400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.729541]  fff00000c8683480: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.729585] >fff00000c8683500: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.729634]                    ^
[   32.729668]  fff00000c8683580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.729711]  fff00000c8683600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.729762] ==================================================================

[   27.231132] ==================================================================
[   27.232001] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   27.232957] Free of addr ffff888105424ae0 by task kunit_try_catch/240
[   27.233759] 
[   27.233962] CPU: 0 UID: 0 PID: 240 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250724 #1 PREEMPT(voluntary) 
[   27.234033] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   27.234046] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.234068] Call Trace:
[   27.234081]  <TASK>
[   27.234099]  dump_stack_lvl+0x73/0xb0
[   27.234127]  print_report+0xd1/0x640
[   27.234151]  ? __virt_addr_valid+0x1db/0x2d0
[   27.234176]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.234203]  ? kfree_sensitive+0x2e/0x90
[   27.234225]  kasan_report_invalid_free+0x10a/0x130
[   27.234249]  ? kfree_sensitive+0x2e/0x90
[   27.234270]  ? kfree_sensitive+0x2e/0x90
[   27.234289]  check_slab_allocation+0x101/0x130
[   27.234312]  __kasan_slab_pre_free+0x28/0x40
[   27.234332]  kfree+0xf0/0x3f0
[   27.234355]  ? kfree_sensitive+0x2e/0x90
[   27.234376]  kfree_sensitive+0x2e/0x90
[   27.234395]  kmalloc_double_kzfree+0x19c/0x350
[   27.234418]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   27.234441]  ? __schedule+0x10da/0x2b60
[   27.234465]  ? __pfx_read_tsc+0x10/0x10
[   27.234486]  ? ktime_get_ts64+0x86/0x230
[   27.234510]  kunit_try_run_case+0x1a5/0x480
[   27.234533]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.234555]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.234591]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.234628]  ? __kthread_parkme+0x82/0x180
[   27.234664]  ? preempt_count_sub+0x50/0x80
[   27.234705]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.234728]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.234751]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.234773]  kthread+0x337/0x6f0
[   27.234802]  ? trace_preempt_on+0x20/0xc0
[   27.234825]  ? __pfx_kthread+0x10/0x10
[   27.234845]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.234867]  ? calculate_sigpending+0x7b/0xa0
[   27.234891]  ? __pfx_kthread+0x10/0x10
[   27.234911]  ret_from_fork+0x116/0x1d0
[   27.234930]  ? __pfx_kthread+0x10/0x10
[   27.234958]  ret_from_fork_asm+0x1a/0x30
[   27.234989]  </TASK>
[   27.235000] 
[   27.248426] Allocated by task 240:
[   27.248860]  kasan_save_stack+0x45/0x70
[   27.249365]  kasan_save_track+0x18/0x40
[   27.249757]  kasan_save_alloc_info+0x3b/0x50
[   27.250068]  __kasan_kmalloc+0xb7/0xc0
[   27.250313]  __kmalloc_cache_noprof+0x189/0x420
[   27.250708]  kmalloc_double_kzfree+0xa9/0x350
[   27.251171]  kunit_try_run_case+0x1a5/0x480
[   27.251551]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.251733]  kthread+0x337/0x6f0
[   27.252060]  ret_from_fork+0x116/0x1d0
[   27.252422]  ret_from_fork_asm+0x1a/0x30
[   27.252807] 
[   27.253018] Freed by task 240:
[   27.253250]  kasan_save_stack+0x45/0x70
[   27.253561]  kasan_save_track+0x18/0x40
[   27.253703]  kasan_save_free_info+0x3f/0x60
[   27.253910]  __kasan_slab_free+0x56/0x70
[   27.254333]  kfree+0x222/0x3f0
[   27.254696]  kfree_sensitive+0x67/0x90
[   27.255119]  kmalloc_double_kzfree+0x12b/0x350
[   27.255666]  kunit_try_run_case+0x1a5/0x480
[   27.256007]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.256186]  kthread+0x337/0x6f0
[   27.256300]  ret_from_fork+0x116/0x1d0
[   27.256425]  ret_from_fork_asm+0x1a/0x30
[   27.256557] 
[   27.256637] The buggy address belongs to the object at ffff888105424ae0
[   27.256637]  which belongs to the cache kmalloc-16 of size 16
[   27.257052] The buggy address is located 0 bytes inside of
[   27.257052]  16-byte region [ffff888105424ae0, ffff888105424af0)
[   27.257643] 
[   27.257718] The buggy address belongs to the physical page:
[   27.258052] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105424
[   27.258433] flags: 0x200000000000000(node=0|zone=2)
[   27.258641] page_type: f5(slab)
[   27.258893] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   27.259229] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   27.259516] page dumped because: kasan: bad access detected
[   27.259739] 
[   27.259803] Memory state around the buggy address:
[   27.260179]  ffff888105424980: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.260497]  ffff888105424a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.260884] >ffff888105424a80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.261256]                                                        ^
[   27.261447]  ffff888105424b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.261794]  ffff888105424b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.262120] ==================================================================