Hay
Date
July 1, 2025, 3:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.203416] ==================================================================
[   17.203500] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   17.203582] Read of size 1 at addr fff00000c56b6140 by task kunit_try_catch/193
[   17.203633] 
[   17.203671] CPU: 1 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   17.203758] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.203786] Hardware name: linux,dummy-virt (DT)
[   17.203819] Call trace:
[   17.203842]  show_stack+0x20/0x38 (C)
[   17.203893]  dump_stack_lvl+0x8c/0xd0
[   17.204344]  print_report+0x118/0x608
[   17.204398]  kasan_report+0xdc/0x128
[   17.204443]  __kasan_check_byte+0x54/0x70
[   17.204583]  kfree_sensitive+0x30/0xb0
[   17.204669]  kmalloc_double_kzfree+0x168/0x308
[   17.204788]  kunit_try_run_case+0x170/0x3f0
[   17.204843]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.204897]  kthread+0x328/0x630
[   17.205157]  ret_from_fork+0x10/0x20
[   17.205231] 
[   17.205304] Allocated by task 193:
[   17.205341]  kasan_save_stack+0x3c/0x68
[   17.205514]  kasan_save_track+0x20/0x40
[   17.205669]  kasan_save_alloc_info+0x40/0x58
[   17.205741]  __kasan_kmalloc+0xd4/0xd8
[   17.205879]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.205940]  kmalloc_double_kzfree+0xb8/0x308
[   17.205979]  kunit_try_run_case+0x170/0x3f0
[   17.206023]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.206067]  kthread+0x328/0x630
[   17.206100]  ret_from_fork+0x10/0x20
[   17.206403] 
[   17.207018] Freed by task 193:
[   17.207064]  kasan_save_stack+0x3c/0x68
[   17.207152]  kasan_save_track+0x20/0x40
[   17.207194]  kasan_save_free_info+0x4c/0x78
[   17.207234]  __kasan_slab_free+0x6c/0x98
[   17.207302]  kfree+0x214/0x3c8
[   17.207354]  kfree_sensitive+0x80/0xb0
[   17.207642]  kmalloc_double_kzfree+0x11c/0x308
[   17.207819]  kunit_try_run_case+0x170/0x3f0
[   17.207903]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.208248]  kthread+0x328/0x630
[   17.208307]  ret_from_fork+0x10/0x20
[   17.208346] 
[   17.208624] The buggy address belongs to the object at fff00000c56b6140
[   17.208624]  which belongs to the cache kmalloc-16 of size 16
[   17.208743] The buggy address is located 0 bytes inside of
[   17.208743]  freed 16-byte region [fff00000c56b6140, fff00000c56b6150)
[   17.208849] 
[   17.208996] The buggy address belongs to the physical page:
[   17.209052] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056b6
[   17.209183] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.209270] page_type: f5(slab)
[   17.209320] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   17.209758] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   17.209935] page dumped because: kasan: bad access detected
[   17.209990] 
[   17.210112] Memory state around the buggy address:
[   17.210170]  fff00000c56b6000: fa fb fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   17.210260]  fff00000c56b6080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.210309] >fff00000c56b6100: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   17.210357]                                            ^
[   17.210401]  fff00000c56b6180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.210446]  fff00000c56b6200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.210488] ==================================================================

[   11.967162] ==================================================================
[   11.967920] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   11.968195] Read of size 1 at addr ffff88810191e8c0 by task kunit_try_catch/209
[   11.968418] 
[   11.968512] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.968558] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.968570] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.968590] Call Trace:
[   11.968602]  <TASK>
[   11.968619]  dump_stack_lvl+0x73/0xb0
[   11.968659]  print_report+0xd1/0x650
[   11.968681]  ? __virt_addr_valid+0x1db/0x2d0
[   11.968704]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.968725]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.968746]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.968768]  kasan_report+0x141/0x180
[   11.968788]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.968813]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.968835]  __kasan_check_byte+0x3d/0x50
[   11.968855]  kfree_sensitive+0x22/0x90
[   11.968877]  kmalloc_double_kzfree+0x19c/0x350
[   11.968898]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.968920]  ? __schedule+0x10cc/0x2b60
[   11.968941]  ? __pfx_read_tsc+0x10/0x10
[   11.968961]  ? ktime_get_ts64+0x86/0x230
[   11.968985]  kunit_try_run_case+0x1a5/0x480
[   11.969008]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.969041]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.969063]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.969084]  ? __kthread_parkme+0x82/0x180
[   11.969103]  ? preempt_count_sub+0x50/0x80
[   11.969127]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.969149]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.969171]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.969193]  kthread+0x337/0x6f0
[   11.969213]  ? trace_preempt_on+0x20/0xc0
[   11.969236]  ? __pfx_kthread+0x10/0x10
[   11.969256]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.969275]  ? calculate_sigpending+0x7b/0xa0
[   11.969298]  ? __pfx_kthread+0x10/0x10
[   11.969318]  ret_from_fork+0x116/0x1d0
[   11.969335]  ? __pfx_kthread+0x10/0x10
[   11.969353]  ret_from_fork_asm+0x1a/0x30
[   11.969384]  </TASK>
[   11.969395] 
[   11.983325] Allocated by task 209:
[   11.983759]  kasan_save_stack+0x45/0x70
[   11.984166]  kasan_save_track+0x18/0x40
[   11.984551]  kasan_save_alloc_info+0x3b/0x50
[   11.985065]  __kasan_kmalloc+0xb7/0xc0
[   11.985201]  __kmalloc_cache_noprof+0x189/0x420
[   11.985352]  kmalloc_double_kzfree+0xa9/0x350
[   11.985495]  kunit_try_run_case+0x1a5/0x480
[   11.985702]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.986232]  kthread+0x337/0x6f0
[   11.986541]  ret_from_fork+0x116/0x1d0
[   11.986977]  ret_from_fork_asm+0x1a/0x30
[   11.987410] 
[   11.987567] Freed by task 209:
[   11.987956]  kasan_save_stack+0x45/0x70
[   11.988349]  kasan_save_track+0x18/0x40
[   11.988794]  kasan_save_free_info+0x3f/0x60
[   11.989151]  __kasan_slab_free+0x56/0x70
[   11.989287]  kfree+0x222/0x3f0
[   11.989401]  kfree_sensitive+0x67/0x90
[   11.989531]  kmalloc_double_kzfree+0x12b/0x350
[   11.989728]  kunit_try_run_case+0x1a5/0x480
[   11.990032]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.990273]  kthread+0x337/0x6f0
[   11.990445]  ret_from_fork+0x116/0x1d0
[   11.990608]  ret_from_fork_asm+0x1a/0x30
[   11.990898] 
[   11.990983] The buggy address belongs to the object at ffff88810191e8c0
[   11.990983]  which belongs to the cache kmalloc-16 of size 16
[   11.991529] The buggy address is located 0 bytes inside of
[   11.991529]  freed 16-byte region [ffff88810191e8c0, ffff88810191e8d0)
[   11.991969] 
[   11.992054] The buggy address belongs to the physical page:
[   11.992227] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10191e
[   11.992728] flags: 0x200000000000000(node=0|zone=2)
[   11.992945] page_type: f5(slab)
[   11.993074] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.993506] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.993962] page dumped because: kasan: bad access detected
[   11.994194] 
[   11.994284] Memory state around the buggy address:
[   11.994466]  ffff88810191e780: 00 05 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   11.994921]  ffff88810191e800: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.995145] >ffff88810191e880: 00 05 fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   11.995349]                                            ^
[   11.995592]  ffff88810191e900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.996406]  ffff88810191e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.996680] ==================================================================