Hay
Date
July 1, 2025, 12:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.605868] ==================================================================
[   17.605938] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   17.606196] Read of size 1 at addr fff00000c45518c0 by task kunit_try_catch/192
[   17.606247] 
[   17.606284] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   17.606386] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.606425] Hardware name: linux,dummy-virt (DT)
[   17.606468] Call trace:
[   17.606490]  show_stack+0x20/0x38 (C)
[   17.606541]  dump_stack_lvl+0x8c/0xd0
[   17.606588]  print_report+0x118/0x608
[   17.606634]  kasan_report+0xdc/0x128
[   17.606679]  __kasan_check_byte+0x54/0x70
[   17.606726]  kfree_sensitive+0x30/0xb0
[   17.606780]  kmalloc_double_kzfree+0x168/0x308
[   17.606834]  kunit_try_run_case+0x170/0x3f0
[   17.606883]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.606949]  kthread+0x328/0x630
[   17.607387]  ret_from_fork+0x10/0x20
[   17.607617] 
[   17.607639] Allocated by task 192:
[   17.607672]  kasan_save_stack+0x3c/0x68
[   17.607723]  kasan_save_track+0x20/0x40
[   17.608122]  kasan_save_alloc_info+0x40/0x58
[   17.608316]  __kasan_kmalloc+0xd4/0xd8
[   17.608413]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.608582]  kmalloc_double_kzfree+0xb8/0x308
[   17.608745]  kunit_try_run_case+0x170/0x3f0
[   17.609004]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.609194]  kthread+0x328/0x630
[   17.609243]  ret_from_fork+0x10/0x20
[   17.609492] 
[   17.609665] Freed by task 192:
[   17.609829]  kasan_save_stack+0x3c/0x68
[   17.609948]  kasan_save_track+0x20/0x40
[   17.609987]  kasan_save_free_info+0x4c/0x78
[   17.610301]  __kasan_slab_free+0x6c/0x98
[   17.610610]  kfree+0x214/0x3c8
[   17.610774]  kfree_sensitive+0x80/0xb0
[   17.610930]  kmalloc_double_kzfree+0x11c/0x308
[   17.611149]  kunit_try_run_case+0x170/0x3f0
[   17.611196]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.611424]  kthread+0x328/0x630
[   17.611580]  ret_from_fork+0x10/0x20
[   17.611831] 
[   17.611909] The buggy address belongs to the object at fff00000c45518c0
[   17.611909]  which belongs to the cache kmalloc-16 of size 16
[   17.612080] The buggy address is located 0 bytes inside of
[   17.612080]  freed 16-byte region [fff00000c45518c0, fff00000c45518d0)
[   17.612168] 
[   17.612287] The buggy address belongs to the physical page:
[   17.612321] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104551
[   17.612549] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.612741] page_type: f5(slab)
[   17.612956] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   17.613161] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   17.613299] page dumped because: kasan: bad access detected
[   17.613367] 
[   17.613387] Memory state around the buggy address:
[   17.613422]  fff00000c4551780: fa fb fc fc fa fb fc fc 00 05 fc fc fa fb fc fc
[   17.613493]  fff00000c4551800: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.613804] >fff00000c4551880: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   17.613917]                                            ^
[   17.613964]  fff00000c4551900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.614020]  fff00000c4551980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.614060] ==================================================================

[   11.786980] ==================================================================
[   11.787881] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   11.788286] Read of size 1 at addr ffff8881027a10e0 by task kunit_try_catch/209
[   11.788772] 
[   11.788897] CPU: 0 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.788958] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.788970] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.789003] Call Trace:
[   11.789017]  <TASK>
[   11.789092]  dump_stack_lvl+0x73/0xb0
[   11.789124]  print_report+0xd1/0x650
[   11.789164]  ? __virt_addr_valid+0x1db/0x2d0
[   11.789186]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.789208]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.789228]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.789250]  kasan_report+0x141/0x180
[   11.789270]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.789294]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.789316]  __kasan_check_byte+0x3d/0x50
[   11.789336]  kfree_sensitive+0x22/0x90
[   11.789358]  kmalloc_double_kzfree+0x19c/0x350
[   11.789379]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.789401]  ? __schedule+0x10cc/0x2b60
[   11.789421]  ? __pfx_read_tsc+0x10/0x10
[   11.789461]  ? ktime_get_ts64+0x86/0x230
[   11.789497]  kunit_try_run_case+0x1a5/0x480
[   11.789521]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.789555]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.789590]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.789612]  ? __kthread_parkme+0x82/0x180
[   11.789630]  ? preempt_count_sub+0x50/0x80
[   11.789652]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.789674]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.789695]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.789716]  kthread+0x337/0x6f0
[   11.789734]  ? trace_preempt_on+0x20/0xc0
[   11.789756]  ? __pfx_kthread+0x10/0x10
[   11.789775]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.789794]  ? calculate_sigpending+0x7b/0xa0
[   11.789816]  ? __pfx_kthread+0x10/0x10
[   11.789835]  ret_from_fork+0x116/0x1d0
[   11.789852]  ? __pfx_kthread+0x10/0x10
[   11.789871]  ret_from_fork_asm+0x1a/0x30
[   11.789900]  </TASK>
[   11.789911] 
[   11.798409] Allocated by task 209:
[   11.798574]  kasan_save_stack+0x45/0x70
[   11.798774]  kasan_save_track+0x18/0x40
[   11.798985]  kasan_save_alloc_info+0x3b/0x50
[   11.799302]  __kasan_kmalloc+0xb7/0xc0
[   11.799499]  __kmalloc_cache_noprof+0x189/0x420
[   11.799728]  kmalloc_double_kzfree+0xa9/0x350
[   11.799939]  kunit_try_run_case+0x1a5/0x480
[   11.800131]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.800303]  kthread+0x337/0x6f0
[   11.800459]  ret_from_fork+0x116/0x1d0
[   11.800638]  ret_from_fork_asm+0x1a/0x30
[   11.800832] 
[   11.800904] Freed by task 209:
[   11.801015]  kasan_save_stack+0x45/0x70
[   11.801321]  kasan_save_track+0x18/0x40
[   11.801541]  kasan_save_free_info+0x3f/0x60
[   11.801747]  __kasan_slab_free+0x56/0x70
[   11.801883]  kfree+0x222/0x3f0
[   11.802004]  kfree_sensitive+0x67/0x90
[   11.802440]  kmalloc_double_kzfree+0x12b/0x350
[   11.802721]  kunit_try_run_case+0x1a5/0x480
[   11.802960]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.803337]  kthread+0x337/0x6f0
[   11.803506]  ret_from_fork+0x116/0x1d0
[   11.803637]  ret_from_fork_asm+0x1a/0x30
[   11.803775] 
[   11.803847] The buggy address belongs to the object at ffff8881027a10e0
[   11.803847]  which belongs to the cache kmalloc-16 of size 16
[   11.804531] The buggy address is located 0 bytes inside of
[   11.804531]  freed 16-byte region [ffff8881027a10e0, ffff8881027a10f0)
[   11.805199] 
[   11.805319] The buggy address belongs to the physical page:
[   11.805524] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027a1
[   11.805819] flags: 0x200000000000000(node=0|zone=2)
[   11.806184] page_type: f5(slab)
[   11.806359] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.806697] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.807244] page dumped because: kasan: bad access detected
[   11.807539] 
[   11.807636] Memory state around the buggy address:
[   11.807862]  ffff8881027a0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.808296]  ffff8881027a1000: fa fb fc fc fa fb fc fc 00 05 fc fc fa fb fc fc
[   11.808619] >ffff8881027a1080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.808929]                                                        ^
[   11.809304]  ffff8881027a1100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.809619]  ffff8881027a1180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.809872] ==================================================================