Hay
Date
July 20, 2025, 8:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   15.371979] ==================================================================
[   15.372051] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   15.372265] Free of addr fff00000c6086780 by task kunit_try_catch/193
[   15.372356] 
[   15.372392] CPU: 1 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.372585] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.372808] Hardware name: linux,dummy-virt (DT)
[   15.373003] Call trace:
[   15.373080]  show_stack+0x20/0x38 (C)
[   15.373261]  dump_stack_lvl+0x8c/0xd0
[   15.373343]  print_report+0x118/0x5d0
[   15.373490]  kasan_report_invalid_free+0xc0/0xe8
[   15.373725]  check_slab_allocation+0xd4/0x108
[   15.373903]  __kasan_slab_pre_free+0x2c/0x48
[   15.374084]  kfree+0xe8/0x3c8
[   15.374173]  kfree_sensitive+0x3c/0xb0
[   15.374265]  kmalloc_double_kzfree+0x168/0x308
[   15.374402]  kunit_try_run_case+0x170/0x3f0
[   15.374499]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.374622]  kthread+0x328/0x630
[   15.374698]  ret_from_fork+0x10/0x20
[   15.374929] 
[   15.374981] Allocated by task 193:
[   15.375222]  kasan_save_stack+0x3c/0x68
[   15.375347]  kasan_save_track+0x20/0x40
[   15.375388]  kasan_save_alloc_info+0x40/0x58
[   15.375470]  __kasan_kmalloc+0xd4/0xd8
[   15.375675]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.375874]  kmalloc_double_kzfree+0xb8/0x308
[   15.375959]  kunit_try_run_case+0x170/0x3f0
[   15.376139]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.376287]  kthread+0x328/0x630
[   15.376322]  ret_from_fork+0x10/0x20
[   15.376559] 
[   15.376687] Freed by task 193:
[   15.376748]  kasan_save_stack+0x3c/0x68
[   15.376924]  kasan_save_track+0x20/0x40
[   15.377020]  kasan_save_free_info+0x4c/0x78
[   15.377253]  __kasan_slab_free+0x6c/0x98
[   15.377294]  kfree+0x214/0x3c8
[   15.377335]  kfree_sensitive+0x80/0xb0
[   15.377370]  kmalloc_double_kzfree+0x11c/0x308
[   15.377734]  kunit_try_run_case+0x170/0x3f0
[   15.377914]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.378050]  kthread+0x328/0x630
[   15.378169]  ret_from_fork+0x10/0x20
[   15.378302] 
[   15.378326] The buggy address belongs to the object at fff00000c6086780
[   15.378326]  which belongs to the cache kmalloc-16 of size 16
[   15.378420] The buggy address is located 0 bytes inside of
[   15.378420]  16-byte region [fff00000c6086780, fff00000c6086790)
[   15.379211] 
[   15.379271] The buggy address belongs to the physical page:
[   15.379306] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106086
[   15.379585] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.379670] page_type: f5(slab)
[   15.379738] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   15.380444] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   15.380693] page dumped because: kasan: bad access detected
[   15.380742] 
[   15.380846] Memory state around the buggy address:
[   15.380894]  fff00000c6086680: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.380980]  fff00000c6086700: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   15.381102] >fff00000c6086780: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.381213]                    ^
[   15.381244]  fff00000c6086800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.381308]  fff00000c6086880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.381491] ==================================================================

[   13.325013] ==================================================================
[   13.325406] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   13.325883] Free of addr ffff888102641a80 by task kunit_try_catch/210
[   13.326599] 
[   13.326795] CPU: 1 UID: 0 PID: 210 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.326853] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.326864] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.326886] Call Trace:
[   13.326898]  <TASK>
[   13.326913]  dump_stack_lvl+0x73/0xb0
[   13.326945]  print_report+0xd1/0x610
[   13.326969]  ? __virt_addr_valid+0x1db/0x2d0
[   13.326991]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.327013]  ? kfree_sensitive+0x2e/0x90
[   13.327046]  kasan_report_invalid_free+0x10a/0x130
[   13.327070]  ? kfree_sensitive+0x2e/0x90
[   13.327103]  ? kfree_sensitive+0x2e/0x90
[   13.327123]  check_slab_allocation+0x101/0x130
[   13.327145]  __kasan_slab_pre_free+0x28/0x40
[   13.327166]  kfree+0xf0/0x3f0
[   13.327189]  ? kfree_sensitive+0x2e/0x90
[   13.327212]  kfree_sensitive+0x2e/0x90
[   13.327232]  kmalloc_double_kzfree+0x19c/0x350
[   13.327255]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   13.327290]  ? __schedule+0x10c6/0x2b60
[   13.327313]  ? __pfx_read_tsc+0x10/0x10
[   13.327335]  ? ktime_get_ts64+0x86/0x230
[   13.327359]  kunit_try_run_case+0x1a5/0x480
[   13.327383]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.327405]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.327439]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.327463]  ? __kthread_parkme+0x82/0x180
[   13.327493]  ? preempt_count_sub+0x50/0x80
[   13.327516]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.327542]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.327567]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.327591]  kthread+0x337/0x6f0
[   13.327611]  ? trace_preempt_on+0x20/0xc0
[   13.327634]  ? __pfx_kthread+0x10/0x10
[   13.327654]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.327676]  ? calculate_sigpending+0x7b/0xa0
[   13.327701]  ? __pfx_kthread+0x10/0x10
[   13.327722]  ret_from_fork+0x116/0x1d0
[   13.327740]  ? __pfx_kthread+0x10/0x10
[   13.327761]  ret_from_fork_asm+0x1a/0x30
[   13.327792]  </TASK>
[   13.327803] 
[   13.342798] Allocated by task 210:
[   13.343049]  kasan_save_stack+0x45/0x70
[   13.343519]  kasan_save_track+0x18/0x40
[   13.343940]  kasan_save_alloc_info+0x3b/0x50
[   13.344315]  __kasan_kmalloc+0xb7/0xc0
[   13.344558]  __kmalloc_cache_noprof+0x189/0x420
[   13.345007]  kmalloc_double_kzfree+0xa9/0x350
[   13.345402]  kunit_try_run_case+0x1a5/0x480
[   13.345712]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.346130]  kthread+0x337/0x6f0
[   13.346395]  ret_from_fork+0x116/0x1d0
[   13.346549]  ret_from_fork_asm+0x1a/0x30
[   13.346969] 
[   13.347167] Freed by task 210:
[   13.347525]  kasan_save_stack+0x45/0x70
[   13.347949]  kasan_save_track+0x18/0x40
[   13.348216]  kasan_save_free_info+0x3f/0x60
[   13.348709]  __kasan_slab_free+0x56/0x70
[   13.349002]  kfree+0x222/0x3f0
[   13.349126]  kfree_sensitive+0x67/0x90
[   13.349266]  kmalloc_double_kzfree+0x12b/0x350
[   13.349801]  kunit_try_run_case+0x1a5/0x480
[   13.350277]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.350823]  kthread+0x337/0x6f0
[   13.351236]  ret_from_fork+0x116/0x1d0
[   13.351733]  ret_from_fork_asm+0x1a/0x30
[   13.352190] 
[   13.352353] The buggy address belongs to the object at ffff888102641a80
[   13.352353]  which belongs to the cache kmalloc-16 of size 16
[   13.353333] The buggy address is located 0 bytes inside of
[   13.353333]  16-byte region [ffff888102641a80, ffff888102641a90)
[   13.354076] 
[   13.354251] The buggy address belongs to the physical page:
[   13.354902] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102641
[   13.355357] flags: 0x200000000000000(node=0|zone=2)
[   13.355570] page_type: f5(slab)
[   13.355908] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.356832] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.357379] page dumped because: kasan: bad access detected
[   13.357931] 
[   13.358082] Memory state around the buggy address:
[   13.358489]  ffff888102641980: fa fb fc fc 00 02 fc fc 00 05 fc fc 00 02 fc fc
[   13.359153]  ffff888102641a00: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   13.359723] >ffff888102641a80: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.360163]                    ^
[   13.360509]  ffff888102641b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.361177]  ffff888102641b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.361707] ==================================================================