Hay
Date
May 13, 2025, 12:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.500740] ==================================================================
[   19.500868] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   19.501037] Free of addr fff00000c4035120 by task kunit_try_catch/192
[   19.501090] 
[   19.501134] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT 
[   19.501232] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.501263] Hardware name: linux,dummy-virt (DT)
[   19.501300] Call trace:
[   19.501328]  show_stack+0x20/0x38 (C)
[   19.501388]  dump_stack_lvl+0x8c/0xd0
[   19.501442]  print_report+0x118/0x608
[   19.501493]  kasan_report_invalid_free+0xc0/0xe8
[   19.501547]  check_slab_allocation+0xd4/0x108
[   19.501601]  __kasan_slab_pre_free+0x2c/0x48
[   19.501656]  kfree+0xe8/0x3c8
[   19.501702]  kfree_sensitive+0x3c/0xb0
[   19.501753]  kmalloc_double_kzfree+0x168/0x308
[   19.501814]  kunit_try_run_case+0x170/0x3f0
[   19.501877]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.501938]  kthread+0x328/0x630
[   19.502419]  ret_from_fork+0x10/0x20
[   19.502758] 
[   19.502796] Allocated by task 192:
[   19.502838]  kasan_save_stack+0x3c/0x68
[   19.502890]  kasan_save_track+0x20/0x40
[   19.502935]  kasan_save_alloc_info+0x40/0x58
[   19.503046]  __kasan_kmalloc+0xd4/0xd8
[   19.503129]  __kmalloc_cache_noprof+0x15c/0x3c0
[   19.503177]  kmalloc_double_kzfree+0xb8/0x308
[   19.503220]  kunit_try_run_case+0x170/0x3f0
[   19.503286]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.503371]  kthread+0x328/0x630
[   19.503412]  ret_from_fork+0x10/0x20
[   19.503454] 
[   19.503478] Freed by task 192:
[   19.503513]  kasan_save_stack+0x3c/0x68
[   19.503554]  kasan_save_track+0x20/0x40
[   19.503596]  kasan_save_free_info+0x4c/0x78
[   19.503639]  __kasan_slab_free+0x6c/0x98
[   19.503679]  kfree+0x214/0x3c8
[   19.503717]  kfree_sensitive+0x80/0xb0
[   19.503756]  kmalloc_double_kzfree+0x11c/0x308
[   19.503798]  kunit_try_run_case+0x170/0x3f0
[   19.503837]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.503882]  kthread+0x328/0x630
[   19.503919]  ret_from_fork+0x10/0x20
[   19.503958] 
[   19.503991] The buggy address belongs to the object at fff00000c4035120
[   19.503991]  which belongs to the cache kmalloc-16 of size 16
[   19.504075] The buggy address is located 0 bytes inside of
[   19.504075]  16-byte region [fff00000c4035120, fff00000c4035130)
[   19.504197] 
[   19.504259] The buggy address belongs to the physical page:
[   19.504317] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104035
[   19.504380] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.504433] page_type: f5(slab)
[   19.504480] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.504535] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.504580] page dumped because: kasan: bad access detected
[   19.504613] 
[   19.504634] Memory state around the buggy address:
[   19.504671]  fff00000c4035000: 00 02 fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   19.504718]  fff00000c4035080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.504764] >fff00000c4035100: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   19.504804]                                ^
[   19.504848]  fff00000c4035180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.504941]  fff00000c4035200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.505238] ==================================================================

[   11.495308] ==================================================================
[   11.495676] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   11.495994] Free of addr ffff888101c869a0 by task kunit_try_catch/209
[   11.496262] 
[   11.496383] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT(voluntary) 
[   11.496444] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.496458] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.496489] Call Trace:
[   11.496501]  <TASK>
[   11.496516]  dump_stack_lvl+0x73/0xb0
[   11.496544]  print_report+0xd1/0x650
[   11.496567]  ? __virt_addr_valid+0x1db/0x2d0
[   11.496594]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.496633]  ? kfree_sensitive+0x2e/0x90
[   11.496705]  kasan_report_invalid_free+0x10a/0x130
[   11.496737]  ? kfree_sensitive+0x2e/0x90
[   11.496763]  ? kfree_sensitive+0x2e/0x90
[   11.496786]  check_slab_allocation+0x101/0x130
[   11.496812]  __kasan_slab_pre_free+0x28/0x40
[   11.496835]  kfree+0xf0/0x3f0
[   11.496854]  ? kfree_sensitive+0x2e/0x90
[   11.496880]  kfree_sensitive+0x2e/0x90
[   11.496902]  kmalloc_double_kzfree+0x19c/0x350
[   11.496928]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.496957]  ? __pfx_queued_spin_lock_slowpath+0x10/0x10
[   11.496985]  ? __pfx_read_tsc+0x10/0x10
[   11.497007]  ? ktime_get_ts64+0x86/0x230
[   11.497034]  kunit_try_run_case+0x1a5/0x480
[   11.497060]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.497084]  ? _raw_spin_lock_irqsave+0xf9/0x100
[   11.497109]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.497134]  ? __kthread_parkme+0x82/0x180
[   11.497157]  ? preempt_count_sub+0x50/0x80
[   11.497196]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.497224]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.497251]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.497279]  kthread+0x337/0x6f0
[   11.497299]  ? trace_preempt_on+0x20/0xc0
[   11.497324]  ? __pfx_kthread+0x10/0x10
[   11.497347]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.497369]  ? calculate_sigpending+0x7b/0xa0
[   11.497395]  ? __pfx_kthread+0x10/0x10
[   11.497419]  ret_from_fork+0x116/0x1d0
[   11.497438]  ? __pfx_kthread+0x10/0x10
[   11.497461]  ret_from_fork_asm+0x1a/0x30
[   11.497498]  </TASK>
[   11.497508] 
[   11.505684] Allocated by task 209:
[   11.505848]  kasan_save_stack+0x45/0x70
[   11.506109]  kasan_save_track+0x18/0x40
[   11.506303]  kasan_save_alloc_info+0x3b/0x50
[   11.506521]  __kasan_kmalloc+0xb7/0xc0
[   11.506774]  __kmalloc_cache_noprof+0x189/0x420
[   11.506952]  kmalloc_double_kzfree+0xa9/0x350
[   11.507158]  kunit_try_run_case+0x1a5/0x480
[   11.507364]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.507681]  kthread+0x337/0x6f0
[   11.507849]  ret_from_fork+0x116/0x1d0
[   11.508018]  ret_from_fork_asm+0x1a/0x30
[   11.508198] 
[   11.508285] Freed by task 209:
[   11.508422]  kasan_save_stack+0x45/0x70
[   11.508752]  kasan_save_track+0x18/0x40
[   11.508944]  kasan_save_free_info+0x3f/0x60
[   11.509149]  __kasan_slab_free+0x56/0x70
[   11.509330]  kfree+0x222/0x3f0
[   11.509487]  kfree_sensitive+0x67/0x90
[   11.509722]  kmalloc_double_kzfree+0x12b/0x350
[   11.509938]  kunit_try_run_case+0x1a5/0x480
[   11.510111]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.510310]  kthread+0x337/0x6f0
[   11.510528]  ret_from_fork+0x116/0x1d0
[   11.510741]  ret_from_fork_asm+0x1a/0x30
[   11.510999] 
[   11.511079] The buggy address belongs to the object at ffff888101c869a0
[   11.511079]  which belongs to the cache kmalloc-16 of size 16
[   11.511632] The buggy address is located 0 bytes inside of
[   11.511632]  16-byte region [ffff888101c869a0, ffff888101c869b0)
[   11.511958] 
[   11.512029] The buggy address belongs to the physical page:
[   11.512376] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101c86
[   11.513156] flags: 0x200000000000000(node=0|zone=2)
[   11.513401] page_type: f5(slab)
[   11.513572] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.513887] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.514111] page dumped because: kasan: bad access detected
[   11.514279] 
[   11.514348] Memory state around the buggy address:
[   11.514506]  ffff888101c86880: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.515049]  ffff888101c86900: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.515369] >ffff888101c86980: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   11.515807]                                ^
[   11.515975]  ffff888101c86a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.516410]  ffff888101c86a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.516641] ==================================================================