Hay
Date
March 19, 2025, 10:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   34.620096] ==================================================================
[   34.620279] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   34.621414] Read of size 1 at addr fff00000c5d8b060 by task kunit_try_catch/194
[   34.621689] 
[   34.621857] CPU: 1 UID: 0 PID: 194 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT 
[   34.622568] Tainted: [B]=BAD_PAGE, [N]=TEST
[   34.622677] Hardware name: linux,dummy-virt (DT)
[   34.622789] Call trace:
[   34.623133]  show_stack+0x20/0x38 (C)
[   34.623799]  dump_stack_lvl+0x8c/0xd0
[   34.624020]  print_report+0x118/0x5f0
[   34.624408]  kasan_report+0xc8/0x118
[   34.624865]  __kasan_check_byte+0x54/0x70
[   34.625080]  kfree_sensitive+0x30/0xb0
[   34.625667]  kmalloc_double_kzfree+0x168/0x308
[   34.626072]  kunit_try_run_case+0x14c/0x3d0
[   34.626265]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.626434]  kthread+0x318/0x618
[   34.627354]  ret_from_fork+0x10/0x20
[   34.627524] 
[   34.627713] Allocated by task 194:
[   34.628308]  kasan_save_stack+0x3c/0x68
[   34.628721]  kasan_save_track+0x20/0x40
[   34.629089]  kasan_save_alloc_info+0x40/0x58
[   34.629293]  __kasan_kmalloc+0xd4/0xd8
[   34.629786]  __kmalloc_cache_noprof+0x15c/0x3c0
[   34.629974]  kmalloc_double_kzfree+0xb8/0x308
[   34.630503]  kunit_try_run_case+0x14c/0x3d0
[   34.630804]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.631329]  kthread+0x318/0x618
[   34.631790]  ret_from_fork+0x10/0x20
[   34.632178] 
[   34.632252] Freed by task 194:
[   34.632534]  kasan_save_stack+0x3c/0x68
[   34.632754]  kasan_save_track+0x20/0x40
[   34.632880]  kasan_save_free_info+0x4c/0x78
[   34.633006]  __kasan_slab_free+0x6c/0x98
[   34.633453]  kfree+0x214/0x3c8
[   34.633705]  kfree_sensitive+0x80/0xb0
[   34.633903]  kmalloc_double_kzfree+0x11c/0x308
[   34.634073]  kunit_try_run_case+0x14c/0x3d0
[   34.634373]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.634780]  kthread+0x318/0x618
[   34.634985]  ret_from_fork+0x10/0x20
[   34.635258] 
[   34.635329] The buggy address belongs to the object at fff00000c5d8b060
[   34.635329]  which belongs to the cache kmalloc-16 of size 16
[   34.635810] The buggy address is located 0 bytes inside of
[   34.635810]  freed 16-byte region [fff00000c5d8b060, fff00000c5d8b070)
[   34.636188] 
[   34.636367] The buggy address belongs to the physical page:
[   34.636485] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105d8b
[   34.636813] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.637313] page_type: f5(slab)
[   34.637467] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   34.637624] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   34.637756] page dumped because: kasan: bad access detected
[   34.638004] 
[   34.638221] Memory state around the buggy address:
[   34.638451]  fff00000c5d8af00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   34.638629]  fff00000c5d8af80: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc
[   34.639282] >fff00000c5d8b000: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   34.639573]                                                        ^
[   34.639832]  fff00000c5d8b080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.640010]  fff00000c5d8b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.640269] ==================================================================

[   22.313899] ==================================================================
[   22.314911] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   22.315964] Read of size 1 at addr ffff8881025519a0 by task kunit_try_catch/213
[   22.316787] 
[   22.317070] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT(voluntary) 
[   22.317289] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.317328] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.317455] Call Trace:
[   22.317492]  <TASK>
[   22.317528]  dump_stack_lvl+0x73/0xb0
[   22.317606]  print_report+0xd1/0x660
[   22.317671]  ? __virt_addr_valid+0x1db/0x2d0
[   22.317793]  ? kasan_complete_mode_report_info+0x64/0x200
[   22.317864]  kasan_report+0x104/0x140
[   22.318104]  ? kmalloc_double_kzfree+0x19c/0x350
[   22.318207]  ? kmalloc_double_kzfree+0x19c/0x350
[   22.318283]  ? kmalloc_double_kzfree+0x19c/0x350
[   22.318349]  __kasan_check_byte+0x3d/0x50
[   22.318415]  kfree_sensitive+0x22/0x90
[   22.318485]  kmalloc_double_kzfree+0x19c/0x350
[   22.318552]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   22.318609]  ? __schedule+0xd46/0x29c0
[   22.318658]  ? __pfx_read_tsc+0x10/0x10
[   22.318707]  ? ktime_get_ts64+0x86/0x240
[   22.318972]  kunit_try_run_case+0x1b2/0x490
[   22.319103]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.319206]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.319289]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.319372]  ? __kthread_parkme+0x82/0x160
[   22.319452]  ? preempt_count_sub+0x50/0x80
[   22.319739]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.319810]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.319900]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.319972]  kthread+0x323/0x710
[   22.320032]  ? trace_preempt_on+0x20/0xc0
[   22.320092]  ? __pfx_kthread+0x10/0x10
[   22.320199]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.320257]  ? calculate_sigpending+0x7b/0xa0
[   22.320310]  ? __pfx_kthread+0x10/0x10
[   22.320369]  ret_from_fork+0x41/0x80
[   22.320430]  ? __pfx_kthread+0x10/0x10
[   22.320490]  ret_from_fork_asm+0x1a/0x30
[   22.320579]  </TASK>
[   22.320608] 
[   22.342146] Allocated by task 213:
[   22.342612]  kasan_save_stack+0x3d/0x60
[   22.343348]  kasan_save_track+0x18/0x40
[   22.344082]  kasan_save_alloc_info+0x3b/0x50
[   22.344878]  __kasan_kmalloc+0xb7/0xc0
[   22.345486]  __kmalloc_cache_noprof+0x183/0x410
[   22.346501]  kmalloc_double_kzfree+0xa9/0x350
[   22.347272]  kunit_try_run_case+0x1b2/0x490
[   22.348018]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.348920]  kthread+0x323/0x710
[   22.349408]  ret_from_fork+0x41/0x80
[   22.350078]  ret_from_fork_asm+0x1a/0x30
[   22.350667] 
[   22.351456] Freed by task 213:
[   22.351672]  kasan_save_stack+0x3d/0x60
[   22.352396]  kasan_save_track+0x18/0x40
[   22.352575]  kasan_save_free_info+0x3f/0x60
[   22.352796]  __kasan_slab_free+0x56/0x70
[   22.353387]  kfree+0x222/0x3f0
[   22.353758]  kfree_sensitive+0x67/0x90
[   22.354200]  kmalloc_double_kzfree+0x12b/0x350
[   22.354671]  kunit_try_run_case+0x1b2/0x490
[   22.355540]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.356477]  kthread+0x323/0x710
[   22.356758]  ret_from_fork+0x41/0x80
[   22.357172]  ret_from_fork_asm+0x1a/0x30
[   22.358013] 
[   22.358287] The buggy address belongs to the object at ffff8881025519a0
[   22.358287]  which belongs to the cache kmalloc-16 of size 16
[   22.360181] The buggy address is located 0 bytes inside of
[   22.360181]  freed 16-byte region [ffff8881025519a0, ffff8881025519b0)
[   22.361631] 
[   22.362158] The buggy address belongs to the physical page:
[   22.362601] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102551
[   22.363571] flags: 0x200000000000000(node=0|zone=2)
[   22.364703] page_type: f5(slab)
[   22.365265] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   22.366155] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   22.366849] page dumped because: kasan: bad access detected
[   22.367504] 
[   22.367967] Memory state around the buggy address:
[   22.368381]  ffff888102551880: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   22.368893]  ffff888102551900: 00 05 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   22.369537] >ffff888102551980: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   22.370093]                                ^
[   22.371095]  ffff888102551a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.372011]  ffff888102551a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.372659] ==================================================================