Hay
Date
July 5, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.215615] ==================================================================
[   18.215695] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   18.216057] Free of addr fff00000c59fcc20 by task kunit_try_catch/192
[   18.216168] 
[   18.216221] CPU: 0 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.216303] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.216638] Hardware name: linux,dummy-virt (DT)
[   18.216790] Call trace:
[   18.216924]  show_stack+0x20/0x38 (C)
[   18.217204]  dump_stack_lvl+0x8c/0xd0
[   18.217282]  print_report+0x118/0x608
[   18.217500]  kasan_report_invalid_free+0xc0/0xe8
[   18.217755]  check_slab_allocation+0xd4/0x108
[   18.217902]  __kasan_slab_pre_free+0x2c/0x48
[   18.218102]  kfree+0xe8/0x3c8
[   18.218576]  kfree_sensitive+0x3c/0xb0
[   18.218718]  kmalloc_double_kzfree+0x168/0x308
[   18.218901]  kunit_try_run_case+0x170/0x3f0
[   18.219092]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.219162]  kthread+0x328/0x630
[   18.219363]  ret_from_fork+0x10/0x20
[   18.219563] 
[   18.219611] Allocated by task 192:
[   18.219657]  kasan_save_stack+0x3c/0x68
[   18.220063]  kasan_save_track+0x20/0x40
[   18.220470]  kasan_save_alloc_info+0x40/0x58
[   18.220677]  __kasan_kmalloc+0xd4/0xd8
[   18.220778]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.220861]  kmalloc_double_kzfree+0xb8/0x308
[   18.220902]  kunit_try_run_case+0x170/0x3f0
[   18.221247]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.221361]  kthread+0x328/0x630
[   18.221458]  ret_from_fork+0x10/0x20
[   18.221633] 
[   18.221929] Freed by task 192:
[   18.221958]  kasan_save_stack+0x3c/0x68
[   18.222379]  kasan_save_track+0x20/0x40
[   18.222456]  kasan_save_free_info+0x4c/0x78
[   18.222612]  __kasan_slab_free+0x6c/0x98
[   18.222662]  kfree+0x214/0x3c8
[   18.222696]  kfree_sensitive+0x80/0xb0
[   18.222901]  kmalloc_double_kzfree+0x11c/0x308
[   18.222951]  kunit_try_run_case+0x170/0x3f0
[   18.222996]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.223039]  kthread+0x328/0x630
[   18.223070]  ret_from_fork+0x10/0x20
[   18.223107] 
[   18.223127] The buggy address belongs to the object at fff00000c59fcc20
[   18.223127]  which belongs to the cache kmalloc-16 of size 16
[   18.223202] The buggy address is located 0 bytes inside of
[   18.223202]  16-byte region [fff00000c59fcc20, fff00000c59fcc30)
[   18.223599] 
[   18.223885] The buggy address belongs to the physical page:
[   18.224043] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059fc
[   18.224122] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.224349] page_type: f5(slab)
[   18.224484] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.224579] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.224736] page dumped because: kasan: bad access detected
[   18.224788] 
[   18.224807] Memory state around the buggy address:
[   18.225028]  fff00000c59fcb00: fa fb fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   18.225199]  fff00000c59fcb80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.225384] >fff00000c59fcc00: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   18.225717]                                ^
[   18.225780]  fff00000c59fcc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.225902]  fff00000c59fcd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.226001] ==================================================================

[   13.986195] ==================================================================
[   13.987278] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   13.988157] Free of addr ffff888102509f00 by task kunit_try_catch/210
[   13.988495] 
[   13.988600] CPU: 1 UID: 0 PID: 210 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.988650] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.988663] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.988688] Call Trace:
[   13.988704]  <TASK>
[   13.988725]  dump_stack_lvl+0x73/0xb0
[   13.988764]  print_report+0xd1/0x650
[   13.988806]  ? __virt_addr_valid+0x1db/0x2d0
[   13.988833]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.988857]  ? kfree_sensitive+0x2e/0x90
[   13.988882]  kasan_report_invalid_free+0x10a/0x130
[   13.988910]  ? kfree_sensitive+0x2e/0x90
[   13.988935]  ? kfree_sensitive+0x2e/0x90
[   13.988957]  check_slab_allocation+0x101/0x130
[   13.988982]  __kasan_slab_pre_free+0x28/0x40
[   13.989008]  kfree+0xf0/0x3f0
[   13.989034]  ? add_taint+0x2e/0xa0
[   13.989055]  ? kfree_sensitive+0x2e/0x90
[   13.989080]  kfree_sensitive+0x2e/0x90
[   13.989102]  kmalloc_double_kzfree+0x19c/0x350
[   13.989128]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   13.989154]  ? __schedule+0x10cc/0x2b60
[   13.989179]  ? __pfx_read_tsc+0x10/0x10
[   13.989203]  ? ktime_get_ts64+0x86/0x230
[   13.989231]  kunit_try_run_case+0x1a5/0x480
[   13.989257]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.989281]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.989308]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.989339]  ? __kthread_parkme+0x82/0x180
[   13.989362]  ? preempt_count_sub+0x50/0x80
[   13.989388]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.989414]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.989439]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.989464]  kthread+0x337/0x6f0
[   13.989485]  ? trace_preempt_on+0x20/0xc0
[   13.989510]  ? __pfx_kthread+0x10/0x10
[   13.989533]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.989556]  ? calculate_sigpending+0x7b/0xa0
[   13.989583]  ? __pfx_kthread+0x10/0x10
[   13.989606]  ret_from_fork+0x116/0x1d0
[   13.989628]  ? __pfx_kthread+0x10/0x10
[   13.989652]  ret_from_fork_asm+0x1a/0x30
[   13.989686]  </TASK>
[   13.989699] 
[   14.005052] Allocated by task 210:
[   14.005455]  kasan_save_stack+0x45/0x70
[   14.005909]  kasan_save_track+0x18/0x40
[   14.006391]  kasan_save_alloc_info+0x3b/0x50
[   14.006898]  __kasan_kmalloc+0xb7/0xc0
[   14.007511]  __kmalloc_cache_noprof+0x189/0x420
[   14.007996]  kmalloc_double_kzfree+0xa9/0x350
[   14.008560]  kunit_try_run_case+0x1a5/0x480
[   14.009024]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.009296]  kthread+0x337/0x6f0
[   14.009653]  ret_from_fork+0x116/0x1d0
[   14.010051]  ret_from_fork_asm+0x1a/0x30
[   14.010347] 
[   14.010531] Freed by task 210:
[   14.010864]  kasan_save_stack+0x45/0x70
[   14.011417]  kasan_save_track+0x18/0x40
[   14.011644]  kasan_save_free_info+0x3f/0x60
[   14.011826]  __kasan_slab_free+0x56/0x70
[   14.011981]  kfree+0x222/0x3f0
[   14.012417]  kfree_sensitive+0x67/0x90
[   14.012625]  kmalloc_double_kzfree+0x12b/0x350
[   14.012869]  kunit_try_run_case+0x1a5/0x480
[   14.013323]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.013720]  kthread+0x337/0x6f0
[   14.013925]  ret_from_fork+0x116/0x1d0
[   14.014322]  ret_from_fork_asm+0x1a/0x30
[   14.014858] 
[   14.014994] The buggy address belongs to the object at ffff888102509f00
[   14.014994]  which belongs to the cache kmalloc-16 of size 16
[   14.015679] The buggy address is located 0 bytes inside of
[   14.015679]  16-byte region [ffff888102509f00, ffff888102509f10)
[   14.016589] 
[   14.016875] The buggy address belongs to the physical page:
[   14.017461] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102509
[   14.018418] flags: 0x200000000000000(node=0|zone=2)
[   14.018685] page_type: f5(slab)
[   14.018878] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   14.019605] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   14.020368] page dumped because: kasan: bad access detected
[   14.020653] 
[   14.020761] Memory state around the buggy address:
[   14.021023]  ffff888102509e00: 00 02 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   14.022329]  ffff888102509e80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   14.022696] >ffff888102509f00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.023041]                    ^
[   14.023676]  ffff888102509f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.024433]  ffff88810250a000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.024805] ==================================================================