Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.236181] ==================================================================
[   18.236252] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0
[   18.236301] Free of addr fff00000c5ccd320 by task kunit_try_catch/192
[   18.236678] 
[   18.236743] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   18.236842] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.236870] Hardware name: linux,dummy-virt (DT)
[   18.236900] Call trace:
[   18.236923]  show_stack+0x20/0x38 (C)
[   18.236979]  dump_stack_lvl+0x8c/0xd0
[   18.237036]  print_report+0x118/0x608
[   18.237082]  kasan_report_invalid_free+0xc0/0xe8
[   18.237133]  check_slab_allocation+0xd4/0x108
[   18.237199]  __kasan_slab_pre_free+0x2c/0x48
[   18.237247]  kfree+0xe8/0x3c8
[   18.237289]  kfree_sensitive+0x3c/0xb0
[   18.237337]  kmalloc_double_kzfree+0x168/0x308
[   18.237383]  kunit_try_run_case+0x170/0x3f0
[   18.237434]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.237490]  kthread+0x328/0x630
[   18.237535]  ret_from_fork+0x10/0x20
[   18.237581] 
[   18.237599] Allocated by task 192:
[   18.237634]  kasan_save_stack+0x3c/0x68
[   18.237677]  kasan_save_track+0x20/0x40
[   18.237714]  kasan_save_alloc_info+0x40/0x58
[   18.238305]  __kasan_kmalloc+0xd4/0xd8
[   18.238679]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.238830]  kmalloc_double_kzfree+0xb8/0x308
[   18.239012]  kunit_try_run_case+0x170/0x3f0
[   18.239088]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.239209]  kthread+0x328/0x630
[   18.239341]  ret_from_fork+0x10/0x20
[   18.239380] 
[   18.239400] Freed by task 192:
[   18.239722]  kasan_save_stack+0x3c/0x68
[   18.239835]  kasan_save_track+0x20/0x40
[   18.239921]  kasan_save_free_info+0x4c/0x78
[   18.240100]  __kasan_slab_free+0x6c/0x98
[   18.240288]  kfree+0x214/0x3c8
[   18.240356]  kfree_sensitive+0x80/0xb0
[   18.240415]  kmalloc_double_kzfree+0x11c/0x308
[   18.240735]  kunit_try_run_case+0x170/0x3f0
[   18.240865]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.241033]  kthread+0x328/0x630
[   18.241225]  ret_from_fork+0x10/0x20
[   18.241303] 
[   18.241351] The buggy address belongs to the object at fff00000c5ccd320
[   18.241351]  which belongs to the cache kmalloc-16 of size 16
[   18.241706] The buggy address is located 0 bytes inside of
[   18.241706]  16-byte region [fff00000c5ccd320, fff00000c5ccd330)
[   18.241925] 
[   18.242041] The buggy address belongs to the physical page:
[   18.242139] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105ccd
[   18.242285] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.242343] page_type: f5(slab)
[   18.242386] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.242706] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.242794] page dumped because: kasan: bad access detected
[   18.242882] 
[   18.243074] Memory state around the buggy address:
[   18.243182]  fff00000c5ccd200: fa fb fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   18.243309]  fff00000c5ccd280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.243402] >fff00000c5ccd300: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   18.243443]                                ^
[   18.243810]  fff00000c5ccd380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.243955]  fff00000c5ccd400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.244125] ==================================================================


[   14.480234] ==================================================================
[   14.480850] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90
[   14.481333] Free of addr ffff888102817b60 by task kunit_try_catch/210
[   14.481732] 
[   14.481904] CPU: 0 UID: 0 PID: 210 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   14.481998] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.482020] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.482057] Call Trace:
[   14.482083]  <TASK>
[   14.482119]  dump_stack_lvl+0x73/0xb0
[   14.482183]  print_report+0xd1/0x650
[   14.482466]  ? __virt_addr_valid+0x1db/0x2d0
[   14.482547]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.482612]  ? kfree_sensitive+0x2e/0x90
[   14.482661]  kasan_report_invalid_free+0x10a/0x130
[   14.482718]  ? kfree_sensitive+0x2e/0x90
[   14.482769]  ? kfree_sensitive+0x2e/0x90
[   14.482812]  check_slab_allocation+0x101/0x130
[   14.482861]  __kasan_slab_pre_free+0x28/0x40
[   14.482903]  kfree+0xf0/0x3f0
[   14.482936]  ? kfree_sensitive+0x2e/0x90
[   14.482982]  kfree_sensitive+0x2e/0x90
[   14.483021]  kmalloc_double_kzfree+0x19c/0x350
[   14.483115]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   14.483166]  ? __schedule+0x10cc/0x2b60
[   14.483210]  ? __pfx_read_tsc+0x10/0x10
[   14.483291]  ? ktime_get_ts64+0x86/0x230
[   14.483335]  kunit_try_run_case+0x1a5/0x480
[   14.483379]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.483423]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.483471]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.483513]  ? __kthread_parkme+0x82/0x180
[   14.483551]  ? preempt_count_sub+0x50/0x80
[   14.483586]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.483612]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.483636]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.483661]  kthread+0x337/0x6f0
[   14.483681]  ? trace_preempt_on+0x20/0xc0
[   14.483706]  ? __pfx_kthread+0x10/0x10
[   14.483727]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.483750]  ? calculate_sigpending+0x7b/0xa0
[   14.483775]  ? __pfx_kthread+0x10/0x10
[   14.483797]  ret_from_fork+0x116/0x1d0
[   14.483816]  ? __pfx_kthread+0x10/0x10
[   14.483837]  ret_from_fork_asm+0x1a/0x30
[   14.483872]  </TASK>
[   14.483886] 
[   14.492419] Allocated by task 210:
[   14.492684]  kasan_save_stack+0x45/0x70
[   14.493019]  kasan_save_track+0x18/0x40
[   14.493328]  kasan_save_alloc_info+0x3b/0x50
[   14.493645]  __kasan_kmalloc+0xb7/0xc0
[   14.493852]  __kmalloc_cache_noprof+0x189/0x420
[   14.494196]  kmalloc_double_kzfree+0xa9/0x350
[   14.494406]  kunit_try_run_case+0x1a5/0x480
[   14.494747]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.495023]  kthread+0x337/0x6f0
[   14.495290]  ret_from_fork+0x116/0x1d0
[   14.495501]  ret_from_fork_asm+0x1a/0x30
[   14.495686] 
[   14.495793] Freed by task 210:
[   14.495940]  kasan_save_stack+0x45/0x70
[   14.496112]  kasan_save_track+0x18/0x40
[   14.496292]  kasan_save_free_info+0x3f/0x60
[   14.496506]  __kasan_slab_free+0x56/0x70
[   14.496806]  kfree+0x222/0x3f0
[   14.497101]  kfree_sensitive+0x67/0x90
[   14.497412]  kmalloc_double_kzfree+0x12b/0x350
[   14.497760]  kunit_try_run_case+0x1a5/0x480
[   14.498091]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.498513]  kthread+0x337/0x6f0
[   14.498798]  ret_from_fork+0x116/0x1d0
[   14.499025]  ret_from_fork_asm+0x1a/0x30
[   14.499213] 
[   14.499385] The buggy address belongs to the object at ffff888102817b60
[   14.499385]  which belongs to the cache kmalloc-16 of size 16
[   14.500054] The buggy address is located 0 bytes inside of
[   14.500054]  16-byte region [ffff888102817b60, ffff888102817b70)
[   14.500600] 
[   14.500736] The buggy address belongs to the physical page:
[   14.500966] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102817
[   14.501247] flags: 0x200000000000000(node=0|zone=2)
[   14.501448] page_type: f5(slab)
[   14.501611] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   14.501863] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   14.502104] page dumped because: kasan: bad access detected
[   14.502371] 
[   14.502535] Memory state around the buggy address:
[   14.502903]  ffff888102817a00: 00 02 fc fc 00 05 fc fc 00 02 fc fc 00 02 fc fc
[   14.503419]  ffff888102817a80: 00 02 fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   14.503873] >ffff888102817b00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   14.504332]                                                        ^
[   14.504760]  ffff888102817b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.505236]  ffff888102817c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.505709] ==================================================================