Hay
Date
July 10, 2025, 11:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.093213] ==================================================================
[   16.093443] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   16.093659] Read of size 1 at addr fff00000c5ff7a40 by task kunit_try_catch/192
[   16.093828] 
[   16.093867] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.094129] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.094157] Hardware name: linux,dummy-virt (DT)
[   16.094424] Call trace:
[   16.094450]  show_stack+0x20/0x38 (C)
[   16.094637]  dump_stack_lvl+0x8c/0xd0
[   16.094754]  print_report+0x118/0x608
[   16.094920]  kasan_report+0xdc/0x128
[   16.094967]  __kasan_check_byte+0x54/0x70
[   16.095183]  kfree_sensitive+0x30/0xb0
[   16.095238]  kmalloc_double_kzfree+0x168/0x308
[   16.095285]  kunit_try_run_case+0x170/0x3f0
[   16.095337]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.095567]  kthread+0x328/0x630
[   16.095619]  ret_from_fork+0x10/0x20
[   16.095888] 
[   16.095938] Allocated by task 192:
[   16.095974]  kasan_save_stack+0x3c/0x68
[   16.096061]  kasan_save_track+0x20/0x40
[   16.096178]  kasan_save_alloc_info+0x40/0x58
[   16.096219]  __kasan_kmalloc+0xd4/0xd8
[   16.096418]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.096597]  kmalloc_double_kzfree+0xb8/0x308
[   16.096654]  kunit_try_run_case+0x170/0x3f0
[   16.096694]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.096831]  kthread+0x328/0x630
[   16.096864]  ret_from_fork+0x10/0x20
[   16.096960] 
[   16.096980] Freed by task 192:
[   16.097062]  kasan_save_stack+0x3c/0x68
[   16.097113]  kasan_save_track+0x20/0x40
[   16.097150]  kasan_save_free_info+0x4c/0x78
[   16.097190]  __kasan_slab_free+0x6c/0x98
[   16.097276]  kfree+0x214/0x3c8
[   16.097427]  kfree_sensitive+0x80/0xb0
[   16.097609]  kmalloc_double_kzfree+0x11c/0x308
[   16.097788]  kunit_try_run_case+0x170/0x3f0
[   16.097832]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.098143]  kthread+0x328/0x630
[   16.098555]  ret_from_fork+0x10/0x20
[   16.098604] 
[   16.098624] The buggy address belongs to the object at fff00000c5ff7a40
[   16.098624]  which belongs to the cache kmalloc-16 of size 16
[   16.098684] The buggy address is located 0 bytes inside of
[   16.098684]  freed 16-byte region [fff00000c5ff7a40, fff00000c5ff7a50)
[   16.098784] 
[   16.098827] The buggy address belongs to the physical page:
[   16.098861] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105ff7
[   16.098915] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.099336] page_type: f5(slab)
[   16.099459] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.099533] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.099609] page dumped because: kasan: bad access detected
[   16.099957] 
[   16.100050] Memory state around the buggy address:
[   16.100106]  fff00000c5ff7900: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   16.100231]  fff00000c5ff7980: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.100275] >fff00000c5ff7a00: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   16.100313]                                            ^
[   16.100348]  fff00000c5ff7a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.100389]  fff00000c5ff7b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.100437] ==================================================================

[   13.017800] ==================================================================
[   13.019319] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   13.019729] Read of size 1 at addr ffff888102749dc0 by task kunit_try_catch/209
[   13.019976] 
[   13.020401] CPU: 0 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.020489] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.020501] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.020686] Call Trace:
[   13.020703]  <TASK>
[   13.020721]  dump_stack_lvl+0x73/0xb0
[   13.020879]  print_report+0xd1/0x650
[   13.020905]  ? __virt_addr_valid+0x1db/0x2d0
[   13.020929]  ? kmalloc_double_kzfree+0x19c/0x350
[   13.020952]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.020975]  ? kmalloc_double_kzfree+0x19c/0x350
[   13.020999]  kasan_report+0x141/0x180
[   13.021020]  ? kmalloc_double_kzfree+0x19c/0x350
[   13.021047]  ? kmalloc_double_kzfree+0x19c/0x350
[   13.021070]  __kasan_check_byte+0x3d/0x50
[   13.021093]  kfree_sensitive+0x22/0x90
[   13.021116]  kmalloc_double_kzfree+0x19c/0x350
[   13.021139]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   13.021163]  ? __schedule+0x10cc/0x2b60
[   13.021186]  ? __pfx_read_tsc+0x10/0x10
[   13.021208]  ? ktime_get_ts64+0x86/0x230
[   13.021233]  kunit_try_run_case+0x1a5/0x480
[   13.021258]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.021281]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.021305]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.021329]  ? __kthread_parkme+0x82/0x180
[   13.021385]  ? preempt_count_sub+0x50/0x80
[   13.021410]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.021451]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.021475]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.021500]  kthread+0x337/0x6f0
[   13.021519]  ? trace_preempt_on+0x20/0xc0
[   13.021542]  ? __pfx_kthread+0x10/0x10
[   13.021562]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.021584]  ? calculate_sigpending+0x7b/0xa0
[   13.021608]  ? __pfx_kthread+0x10/0x10
[   13.021629]  ret_from_fork+0x116/0x1d0
[   13.021647]  ? __pfx_kthread+0x10/0x10
[   13.021667]  ret_from_fork_asm+0x1a/0x30
[   13.021699]  </TASK>
[   13.021710] 
[   13.036976] Allocated by task 209:
[   13.037476]  kasan_save_stack+0x45/0x70
[   13.038013]  kasan_save_track+0x18/0x40
[   13.038519]  kasan_save_alloc_info+0x3b/0x50
[   13.039256]  __kasan_kmalloc+0xb7/0xc0
[   13.039886]  __kmalloc_cache_noprof+0x189/0x420
[   13.040460]  kmalloc_double_kzfree+0xa9/0x350
[   13.041036]  kunit_try_run_case+0x1a5/0x480
[   13.041696]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.042164]  kthread+0x337/0x6f0
[   13.042292]  ret_from_fork+0x116/0x1d0
[   13.042657]  ret_from_fork_asm+0x1a/0x30
[   13.043242] 
[   13.043719] Freed by task 209:
[   13.044144]  kasan_save_stack+0x45/0x70
[   13.044667]  kasan_save_track+0x18/0x40
[   13.044821]  kasan_save_free_info+0x3f/0x60
[   13.045423]  __kasan_slab_free+0x56/0x70
[   13.045865]  kfree+0x222/0x3f0
[   13.045994]  kfree_sensitive+0x67/0x90
[   13.046128]  kmalloc_double_kzfree+0x12b/0x350
[   13.046279]  kunit_try_run_case+0x1a5/0x480
[   13.046727]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.047599]  kthread+0x337/0x6f0
[   13.048033]  ret_from_fork+0x116/0x1d0
[   13.048536]  ret_from_fork_asm+0x1a/0x30
[   13.049706] 
[   13.049880] The buggy address belongs to the object at ffff888102749dc0
[   13.049880]  which belongs to the cache kmalloc-16 of size 16
[   13.050706] The buggy address is located 0 bytes inside of
[   13.050706]  freed 16-byte region [ffff888102749dc0, ffff888102749dd0)
[   13.051137] 
[   13.051235] The buggy address belongs to the physical page:
[   13.051645] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102749
[   13.052020] flags: 0x200000000000000(node=0|zone=2)
[   13.052236] page_type: f5(slab)
[   13.052407] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.052716] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.053084] page dumped because: kasan: bad access detected
[   13.053311] 
[   13.053494] Memory state around the buggy address:
[   13.053734]  ffff888102749c80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   13.054064]  ffff888102749d00: 00 05 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   13.054370] >ffff888102749d80: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   13.054716]                                            ^
[   13.054937]  ffff888102749e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.055150]  ffff888102749e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.055505] ==================================================================