Hay
Date
July 9, 2025, 12:11 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.868336] ==================================================================
[   19.868411] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   19.868469] Read of size 1 at addr fff00000c63901a0 by task kunit_try_catch/193
[   19.868519] 
[   19.868552] CPU: 1 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.868637] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.868664] Hardware name: linux,dummy-virt (DT)
[   19.868695] Call trace:
[   19.868716]  show_stack+0x20/0x38 (C)
[   19.868767]  dump_stack_lvl+0x8c/0xd0
[   19.868814]  print_report+0x118/0x608
[   19.868928]  kasan_report+0xdc/0x128
[   19.868989]  __kasan_check_byte+0x54/0x70
[   19.869036]  kfree_sensitive+0x30/0xb0
[   19.869097]  kmalloc_double_kzfree+0x168/0x308
[   19.869145]  kunit_try_run_case+0x170/0x3f0
[   19.869195]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.869248]  kthread+0x328/0x630
[   19.869290]  ret_from_fork+0x10/0x20
[   19.869340] 
[   19.869359] Allocated by task 193:
[   19.869388]  kasan_save_stack+0x3c/0x68
[   19.870143]  kasan_save_track+0x20/0x40
[   19.870525]  kasan_save_alloc_info+0x40/0x58
[   19.870624]  __kasan_kmalloc+0xd4/0xd8
[   19.870755]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.870824]  kmalloc_double_kzfree+0xb8/0x308
[   19.870949]  kunit_try_run_case+0x170/0x3f0
[   19.871002]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.871065]  kthread+0x328/0x630
[   19.871599]  ret_from_fork+0x10/0x20
[   19.871851] 
[   19.871914] Freed by task 193:
[   19.872066]  kasan_save_stack+0x3c/0x68
[   19.872128]  kasan_save_track+0x20/0x40
[   19.872241]  kasan_save_free_info+0x4c/0x78
[   19.872311]  __kasan_slab_free+0x6c/0x98
[   19.872412]  kfree+0x214/0x3c8
[   19.872590]  kfree_sensitive+0x80/0xb0
[   19.872871]  kmalloc_double_kzfree+0x11c/0x308
[   19.873012]  kunit_try_run_case+0x170/0x3f0
[   19.873097]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.873176]  kthread+0x328/0x630
[   19.873282]  ret_from_fork+0x10/0x20
[   19.873372] 
[   19.873490] The buggy address belongs to the object at fff00000c63901a0
[   19.873490]  which belongs to the cache kmalloc-16 of size 16
[   19.873587] The buggy address is located 0 bytes inside of
[   19.873587]  freed 16-byte region [fff00000c63901a0, fff00000c63901b0)
[   19.873924] 
[   19.874007] The buggy address belongs to the physical page:
[   19.874108] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106390
[   19.874214] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.874371] page_type: f5(slab)
[   19.874440] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.874562] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.874607] page dumped because: kasan: bad access detected
[   19.874639] 
[   19.874922] Memory state around the buggy address:
[   19.875005]  fff00000c6390080: fa fb fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   19.875164]  fff00000c6390100: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.875234] >fff00000c6390180: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   19.875292]                                ^
[   19.875423]  fff00000c6390200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.875491]  fff00000c6390280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.875547] ==================================================================

[   12.988264] ==================================================================
[   12.988833] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   12.989401] Read of size 1 at addr ffff888101e0ed00 by task kunit_try_catch/209
[   12.989681] 
[   12.989800] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.989847] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.989858] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.989879] Call Trace:
[   12.989891]  <TASK>
[   12.989908]  dump_stack_lvl+0x73/0xb0
[   12.989954]  print_report+0xd1/0x650
[   12.989977]  ? __virt_addr_valid+0x1db/0x2d0
[   12.989999]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.990022]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.990316]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.990340]  kasan_report+0x141/0x180
[   12.990361]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.990387]  ? kmalloc_double_kzfree+0x19c/0x350
[   12.990409]  __kasan_check_byte+0x3d/0x50
[   12.990431]  kfree_sensitive+0x22/0x90
[   12.990454]  kmalloc_double_kzfree+0x19c/0x350
[   12.990476]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   12.990499]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   12.990525]  ? trace_hardirqs_on+0x37/0xe0
[   12.990548]  ? __pfx_read_tsc+0x10/0x10
[   12.990569]  ? ktime_get_ts64+0x86/0x230
[   12.990594]  kunit_try_run_case+0x1a5/0x480
[   12.990619]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.990643]  ? queued_spin_lock_slowpath+0x116/0xb40
[   12.990668]  ? __kthread_parkme+0x82/0x180
[   12.990689]  ? preempt_count_sub+0x50/0x80
[   12.990720]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.990743]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.990767]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.990792]  kthread+0x337/0x6f0
[   12.990810]  ? trace_preempt_on+0x20/0xc0
[   12.990831]  ? __pfx_kthread+0x10/0x10
[   12.990851]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.990872]  ? calculate_sigpending+0x7b/0xa0
[   12.990896]  ? __pfx_kthread+0x10/0x10
[   12.990916]  ret_from_fork+0x116/0x1d0
[   12.991007]  ? __pfx_kthread+0x10/0x10
[   12.991031]  ret_from_fork_asm+0x1a/0x30
[   12.991062]  </TASK>
[   12.991073] 
[   13.001672] Allocated by task 209:
[   13.001833]  kasan_save_stack+0x45/0x70
[   13.002364]  kasan_save_track+0x18/0x40
[   13.002558]  kasan_save_alloc_info+0x3b/0x50
[   13.002758]  __kasan_kmalloc+0xb7/0xc0
[   13.002923]  __kmalloc_cache_noprof+0x189/0x420
[   13.003454]  kmalloc_double_kzfree+0xa9/0x350
[   13.003626]  kunit_try_run_case+0x1a5/0x480
[   13.003837]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.004466]  kthread+0x337/0x6f0
[   13.004670]  ret_from_fork+0x116/0x1d0
[   13.004820]  ret_from_fork_asm+0x1a/0x30
[   13.005134] 
[   13.005238] Freed by task 209:
[   13.005575]  kasan_save_stack+0x45/0x70
[   13.005755]  kasan_save_track+0x18/0x40
[   13.005949]  kasan_save_free_info+0x3f/0x60
[   13.006514]  __kasan_slab_free+0x56/0x70
[   13.006695]  kfree+0x222/0x3f0
[   13.007108]  kfree_sensitive+0x67/0x90
[   13.007272]  kmalloc_double_kzfree+0x12b/0x350
[   13.007497]  kunit_try_run_case+0x1a5/0x480
[   13.007699]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.007938]  kthread+0x337/0x6f0
[   13.008522]  ret_from_fork+0x116/0x1d0
[   13.008670]  ret_from_fork_asm+0x1a/0x30
[   13.009112] 
[   13.009309] The buggy address belongs to the object at ffff888101e0ed00
[   13.009309]  which belongs to the cache kmalloc-16 of size 16
[   13.009939] The buggy address is located 0 bytes inside of
[   13.009939]  freed 16-byte region [ffff888101e0ed00, ffff888101e0ed10)
[   13.010718] 
[   13.010802] The buggy address belongs to the physical page:
[   13.011323] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e0e
[   13.011646] flags: 0x200000000000000(node=0|zone=2)
[   13.011863] page_type: f5(slab)
[   13.012367] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.012646] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.013310] page dumped because: kasan: bad access detected
[   13.013516] 
[   13.013614] Memory state around the buggy address:
[   13.013844]  ffff888101e0ec00: 00 04 fc fc 00 04 fc fc 00 05 fc fc fa fb fc fc
[   13.014477]  ffff888101e0ec80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   13.014794] >ffff888101e0ed00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.015313]                    ^
[   13.015481]  ffff888101e0ed80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.015860]  ffff888101e0ee00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.016527] ==================================================================