Hay
Date
May 23, 2025, 11:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   27.978567] ==================================================================
[   27.978772] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   27.978916] Free of addr fff00000c5a2a700 by task kunit_try_catch/194
[   27.979254] 
[   27.979364] CPU: 0 UID: 0 PID: 194 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT 
[   27.979812] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.979960] Hardware name: linux,dummy-virt (DT)
[   27.980014] Call trace:
[   27.980063]  show_stack+0x20/0x38 (C)
[   27.980253]  dump_stack_lvl+0x8c/0xd0
[   27.980409]  print_report+0x118/0x608
[   27.980540]  kasan_report_invalid_free+0xc0/0xe8
[   27.980657]  check_slab_allocation+0xd4/0x108
[   27.980786]  __kasan_slab_pre_free+0x2c/0x48
[   27.980927]  kfree+0xe8/0x3c8
[   27.981059]  kfree_sensitive+0x3c/0xb0
[   27.981190]  kmalloc_double_kzfree+0x168/0x308
[   27.981358]  kunit_try_run_case+0x170/0x3f0
[   27.981526]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.981673]  kthread+0x328/0x630
[   27.981831]  ret_from_fork+0x10/0x20
[   27.982153] 
[   27.982262] Allocated by task 194:
[   27.982618]  kasan_save_stack+0x3c/0x68
[   27.982777]  kasan_save_track+0x20/0x40
[   27.982893]  kasan_save_alloc_info+0x40/0x58
[   27.983003]  __kasan_kmalloc+0xd4/0xd8
[   27.983111]  __kmalloc_cache_noprof+0x15c/0x3c0
[   27.983248]  kmalloc_double_kzfree+0xb8/0x308
[   27.983432]  kunit_try_run_case+0x170/0x3f0
[   27.983623]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.983812]  kthread+0x328/0x630
[   27.984019]  ret_from_fork+0x10/0x20
[   27.984480] 
[   27.984547] Freed by task 194:
[   27.984662]  kasan_save_stack+0x3c/0x68
[   27.984835]  kasan_save_track+0x20/0x40
[   27.985099]  kasan_save_free_info+0x4c/0x78
[   27.985241]  __kasan_slab_free+0x6c/0x98
[   27.985776]  kfree+0x214/0x3c8
[   27.985917]  kfree_sensitive+0x80/0xb0
[   27.986032]  kmalloc_double_kzfree+0x11c/0x308
[   27.986275]  kunit_try_run_case+0x170/0x3f0
[   27.986818]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.987193]  kthread+0x328/0x630
[   27.987598]  ret_from_fork+0x10/0x20
[   27.987736] 
[   27.987794] The buggy address belongs to the object at fff00000c5a2a700
[   27.987794]  which belongs to the cache kmalloc-16 of size 16
[   27.988023] The buggy address is located 0 bytes inside of
[   27.988023]  16-byte region [fff00000c5a2a700, fff00000c5a2a710)
[   27.988422] 
[   27.988506] The buggy address belongs to the physical page:
[   27.988771] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a2a
[   27.989101] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   27.989409] page_type: f5(slab)
[   27.989666] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   27.989892] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   27.990392] page dumped because: kasan: bad access detected
[   27.990640] 
[   27.990703] Memory state around the buggy address:
[   27.990920]  fff00000c5a2a600: 00 01 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.991137]  fff00000c5a2a680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.991274] >fff00000c5a2a700: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.991404]                    ^
[   27.991501]  fff00000c5a2a780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.991917]  fff00000c5a2a800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.992150] ==================================================================

[   12.974324] ==================================================================
[   12.974905] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   12.975717] Free of addr ffff8881020cbe80 by task kunit_try_catch/211
[   12.976319] 
[   12.976492] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT(voluntary) 
[   12.976536] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.976558] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.976578] Call Trace:
[   12.976589]  <TASK>
[   12.976604]  dump_stack_lvl+0x73/0xb0
[   12.976641]  print_report+0xd1/0x650
[   12.976663]  ? __virt_addr_valid+0x1db/0x2d0
[   12.976685]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.976706]  ? kfree_sensitive+0x2e/0x90
[   12.976727]  kasan_report_invalid_free+0x10a/0x130
[   12.976751]  ? kfree_sensitive+0x2e/0x90
[   12.976773]  ? kfree_sensitive+0x2e/0x90
[   12.976793]  check_slab_allocation+0x101/0x130
[   12.976814]  __kasan_slab_pre_free+0x28/0x40
[   12.976835]  kfree+0xf0/0x3f0
[   12.976853]  ? kfree_sensitive+0x2e/0x90
[   12.976875]  kfree_sensitive+0x2e/0x90
[   12.976895]  kmalloc_double_kzfree+0x19c/0x350
[   12.976917]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   12.976941]  ? __schedule+0x10cc/0x2b30
[   12.976963]  ? __pfx_read_tsc+0x10/0x10
[   12.976982]  ? ktime_get_ts64+0x86/0x230
[   12.977005]  kunit_try_run_case+0x1a5/0x480
[   12.977028]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.977049]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.977071]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.977093]  ? __kthread_parkme+0x82/0x180
[   12.977113]  ? preempt_count_sub+0x50/0x80
[   12.977138]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.977160]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.977181]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.977203]  kthread+0x337/0x6f0
[   12.977220]  ? trace_preempt_on+0x20/0xc0
[   12.977242]  ? __pfx_kthread+0x10/0x10
[   12.977260]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.977280]  ? calculate_sigpending+0x7b/0xa0
[   12.977310]  ? __pfx_kthread+0x10/0x10
[   12.977328]  ret_from_fork+0x41/0x80
[   12.977348]  ? __pfx_kthread+0x10/0x10
[   12.977365]  ret_from_fork_asm+0x1a/0x30
[   12.977396]  </TASK>
[   12.977407] 
[   12.991645] Allocated by task 211:
[   12.991916]  kasan_save_stack+0x45/0x70
[   12.992198]  kasan_save_track+0x18/0x40
[   12.992635]  kasan_save_alloc_info+0x3b/0x50
[   12.992810]  __kasan_kmalloc+0xb7/0xc0
[   12.993214]  __kmalloc_cache_noprof+0x189/0x420
[   12.993748]  kmalloc_double_kzfree+0xa9/0x350
[   12.994222]  kunit_try_run_case+0x1a5/0x480
[   12.994543]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.994978]  kthread+0x337/0x6f0
[   12.995125]  ret_from_fork+0x41/0x80
[   12.995401]  ret_from_fork_asm+0x1a/0x30
[   12.995689] 
[   12.995761] Freed by task 211:
[   12.996115]  kasan_save_stack+0x45/0x70
[   12.996540]  kasan_save_track+0x18/0x40
[   12.996961]  kasan_save_free_info+0x3f/0x60
[   12.997210]  __kasan_slab_free+0x56/0x70
[   12.997489]  kfree+0x222/0x3f0
[   12.997789]  kfree_sensitive+0x67/0x90
[   12.998206]  kmalloc_double_kzfree+0x12b/0x350
[   12.998710]  kunit_try_run_case+0x1a5/0x480
[   12.999100]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.999316]  kthread+0x337/0x6f0
[   12.999648]  ret_from_fork+0x41/0x80
[   13.000097]  ret_from_fork_asm+0x1a/0x30
[   13.000448] 
[   13.000643] The buggy address belongs to the object at ffff8881020cbe80
[   13.000643]  which belongs to the cache kmalloc-16 of size 16
[   13.001376] The buggy address is located 0 bytes inside of
[   13.001376]  16-byte region [ffff8881020cbe80, ffff8881020cbe90)
[   13.001783] 
[   13.001972] The buggy address belongs to the physical page:
[   13.002525] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1020cb
[   13.003361] flags: 0x200000000000000(node=0|zone=2)
[   13.003756] page_type: f5(slab)
[   13.004050] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.004640] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.005463] page dumped because: kasan: bad access detected
[   13.005699] 
[   13.005830] Memory state around the buggy address:
[   13.006388]  ffff8881020cbd80: fa fb fc fc fa fb fc fc fa fb fc fc 00 05 fc fc
[   13.007067]  ffff8881020cbe00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   13.007320] >ffff8881020cbe80: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.008039]                    ^
[   13.008359]  ffff8881020cbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.009075]  ffff8881020cbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.009614] ==================================================================