Hay
Date
July 24, 2025, 4:41 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.713735] ==================================================================
[   32.713849] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   32.714081] Read of size 1 at addr fff00000c8683500 by task kunit_try_catch/223
[   32.714272] 
[   32.714432] CPU: 0 UID: 0 PID: 223 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250724 #1 PREEMPT 
[   32.714614] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.714651] Hardware name: linux,dummy-virt (DT)
[   32.714685] Call trace:
[   32.714712]  show_stack+0x20/0x38 (C)
[   32.714774]  dump_stack_lvl+0x8c/0xd0
[   32.715069]  print_report+0x118/0x5e8
[   32.715265]  kasan_report+0xdc/0x128
[   32.715346]  __kasan_check_byte+0x54/0x70
[   32.715516]  kfree_sensitive+0x30/0xb0
[   32.715586]  kmalloc_double_kzfree+0x168/0x308
[   32.715784]  kunit_try_run_case+0x170/0x3f0
[   32.716016]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.716135]  kthread+0x328/0x630
[   32.716194]  ret_from_fork+0x10/0x20
[   32.716307] 
[   32.716532] Allocated by task 223:
[   32.716696]  kasan_save_stack+0x3c/0x68
[   32.716848]  kasan_save_track+0x20/0x40
[   32.716890]  kasan_save_alloc_info+0x40/0x58
[   32.716938]  __kasan_kmalloc+0xd4/0xd8
[   32.716979]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.717032]  kmalloc_double_kzfree+0xb8/0x308
[   32.717072]  kunit_try_run_case+0x170/0x3f0
[   32.717121]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.717165]  kthread+0x328/0x630
[   32.717205]  ret_from_fork+0x10/0x20
[   32.717253] 
[   32.717281] Freed by task 223:
[   32.717317]  kasan_save_stack+0x3c/0x68
[   32.717353]  kasan_save_track+0x20/0x40
[   32.717395]  kasan_save_free_info+0x4c/0x78
[   32.717433]  __kasan_slab_free+0x6c/0x98
[   32.717471]  kfree+0x214/0x3c8
[   32.717509]  kfree_sensitive+0x80/0xb0
[   32.717547]  kmalloc_double_kzfree+0x11c/0x308
[   32.717588]  kunit_try_run_case+0x170/0x3f0
[   32.717625]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.717668]  kthread+0x328/0x630
[   32.717700]  ret_from_fork+0x10/0x20
[   32.717736] 
[   32.718220] The buggy address belongs to the object at fff00000c8683500
[   32.718220]  which belongs to the cache kmalloc-16 of size 16
[   32.718690] The buggy address is located 0 bytes inside of
[   32.718690]  freed 16-byte region [fff00000c8683500, fff00000c8683510)
[   32.719010] 
[   32.719070] The buggy address belongs to the physical page:
[   32.719197] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x108683
[   32.719257] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.719464] page_type: f5(slab)
[   32.719684] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   32.719793] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   32.719938] page dumped because: kasan: bad access detected
[   32.720009] 
[   32.720125] Memory state around the buggy address:
[   32.720202]  fff00000c8683400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.720307]  fff00000c8683480: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.720352] >fff00000c8683500: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.720794]                    ^
[   32.720908]  fff00000c8683580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.721027]  fff00000c8683600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.721107] ==================================================================

[   27.194659] ==================================================================
[   27.196328] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   27.197137] Read of size 1 at addr ffff888105424ae0 by task kunit_try_catch/240
[   27.197993] 
[   27.198185] CPU: 0 UID: 0 PID: 240 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250724 #1 PREEMPT(voluntary) 
[   27.198264] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   27.198277] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.198299] Call Trace:
[   27.198313]  <TASK>
[   27.198333]  dump_stack_lvl+0x73/0xb0
[   27.198374]  print_report+0xd1/0x640
[   27.198399]  ? __virt_addr_valid+0x1db/0x2d0
[   27.198425]  ? kmalloc_double_kzfree+0x19c/0x350
[   27.198447]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.198472]  ? kmalloc_double_kzfree+0x19c/0x350
[   27.198526]  kasan_report+0x141/0x180
[   27.198549]  ? kmalloc_double_kzfree+0x19c/0x350
[   27.198584]  ? kmalloc_double_kzfree+0x19c/0x350
[   27.198607]  __kasan_check_byte+0x3d/0x50
[   27.198629]  kfree_sensitive+0x22/0x90
[   27.198651]  kmalloc_double_kzfree+0x19c/0x350
[   27.198674]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   27.198699]  ? __schedule+0x10da/0x2b60
[   27.198724]  ? __pfx_read_tsc+0x10/0x10
[   27.198746]  ? ktime_get_ts64+0x86/0x230
[   27.198772]  kunit_try_run_case+0x1a5/0x480
[   27.198823]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.198845]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.198890]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.198915]  ? __kthread_parkme+0x82/0x180
[   27.198937]  ? preempt_count_sub+0x50/0x80
[   27.198971]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.198995]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.199018]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.199041]  kthread+0x337/0x6f0
[   27.199061]  ? trace_preempt_on+0x20/0xc0
[   27.199086]  ? __pfx_kthread+0x10/0x10
[   27.199106]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.199128]  ? calculate_sigpending+0x7b/0xa0
[   27.199152]  ? __pfx_kthread+0x10/0x10
[   27.199173]  ret_from_fork+0x116/0x1d0
[   27.199192]  ? __pfx_kthread+0x10/0x10
[   27.199212]  ret_from_fork_asm+0x1a/0x30
[   27.199243]  </TASK>
[   27.199259] 
[   27.213063] Allocated by task 240:
[   27.213206]  kasan_save_stack+0x45/0x70
[   27.213353]  kasan_save_track+0x18/0x40
[   27.213480]  kasan_save_alloc_info+0x3b/0x50
[   27.213803]  __kasan_kmalloc+0xb7/0xc0
[   27.214363]  __kmalloc_cache_noprof+0x189/0x420
[   27.214534]  kmalloc_double_kzfree+0xa9/0x350
[   27.214696]  kunit_try_run_case+0x1a5/0x480
[   27.215352]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.216140]  kthread+0x337/0x6f0
[   27.216472]  ret_from_fork+0x116/0x1d0
[   27.216618]  ret_from_fork_asm+0x1a/0x30
[   27.216755] 
[   27.216972] Freed by task 240:
[   27.217316]  kasan_save_stack+0x45/0x70
[   27.217712]  kasan_save_track+0x18/0x40
[   27.218217]  kasan_save_free_info+0x3f/0x60
[   27.218560]  __kasan_slab_free+0x56/0x70
[   27.218715]  kfree+0x222/0x3f0
[   27.218855]  kfree_sensitive+0x67/0x90
[   27.219365]  kmalloc_double_kzfree+0x12b/0x350
[   27.219837]  kunit_try_run_case+0x1a5/0x480
[   27.220269]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.220846]  kthread+0x337/0x6f0
[   27.221041]  ret_from_fork+0x116/0x1d0
[   27.221424]  ret_from_fork_asm+0x1a/0x30
[   27.221613] 
[   27.221681] The buggy address belongs to the object at ffff888105424ae0
[   27.221681]  which belongs to the cache kmalloc-16 of size 16
[   27.222927] The buggy address is located 0 bytes inside of
[   27.222927]  freed 16-byte region [ffff888105424ae0, ffff888105424af0)
[   27.223656] 
[   27.223846] The buggy address belongs to the physical page:
[   27.224522] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105424
[   27.224964] flags: 0x200000000000000(node=0|zone=2)
[   27.225133] page_type: f5(slab)
[   27.225254] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   27.225478] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   27.225978] page dumped because: kasan: bad access detected
[   27.226560] 
[   27.226717] Memory state around the buggy address:
[   27.227401]  ffff888105424980: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.228079]  ffff888105424a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.228769] >ffff888105424a80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.229512]                                                        ^
[   27.229993]  ffff888105424b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.230470]  ffff888105424b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.230688] ==================================================================