Hay
Date
July 12, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.836771] ==================================================================
[   16.837024] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   16.837165] Read of size 1 at addr fff00000c45d1ae0 by task kunit_try_catch/192
[   16.837229] 
[   16.837261] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.837352] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.837380] Hardware name: linux,dummy-virt (DT)
[   16.837411] Call trace:
[   16.837557]  show_stack+0x20/0x38 (C)
[   16.837609]  dump_stack_lvl+0x8c/0xd0
[   16.837654]  print_report+0x118/0x5d0
[   16.837698]  kasan_report+0xdc/0x128
[   16.837743]  __kasan_check_byte+0x54/0x70
[   16.837789]  kfree_sensitive+0x30/0xb0
[   16.838000]  kmalloc_double_kzfree+0x168/0x308
[   16.838061]  kunit_try_run_case+0x170/0x3f0
[   16.838108]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.838161]  kthread+0x328/0x630
[   16.838295]  ret_from_fork+0x10/0x20
[   16.838379] 
[   16.838507] Allocated by task 192:
[   16.838542]  kasan_save_stack+0x3c/0x68
[   16.838587]  kasan_save_track+0x20/0x40
[   16.838625]  kasan_save_alloc_info+0x40/0x58
[   16.838740]  __kasan_kmalloc+0xd4/0xd8
[   16.838779]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.838819]  kmalloc_double_kzfree+0xb8/0x308
[   16.838858]  kunit_try_run_case+0x170/0x3f0
[   16.838905]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.838950]  kthread+0x328/0x630
[   16.838982]  ret_from_fork+0x10/0x20
[   16.839017] 
[   16.839045] Freed by task 192:
[   16.839070]  kasan_save_stack+0x3c/0x68
[   16.839106]  kasan_save_track+0x20/0x40
[   16.839143]  kasan_save_free_info+0x4c/0x78
[   16.839195]  __kasan_slab_free+0x6c/0x98
[   16.839258]  kfree+0x214/0x3c8
[   16.839341]  kfree_sensitive+0x80/0xb0
[   16.839631]  kmalloc_double_kzfree+0x11c/0x308
[   16.839722]  kunit_try_run_case+0x170/0x3f0
[   16.839822]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.839944]  kthread+0x328/0x630
[   16.840015]  ret_from_fork+0x10/0x20
[   16.840113] 
[   16.840206] The buggy address belongs to the object at fff00000c45d1ae0
[   16.840206]  which belongs to the cache kmalloc-16 of size 16
[   16.840278] The buggy address is located 0 bytes inside of
[   16.840278]  freed 16-byte region [fff00000c45d1ae0, fff00000c45d1af0)
[   16.840712] 
[   16.840808] The buggy address belongs to the physical page:
[   16.840885] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1045d1
[   16.840955] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.841004] page_type: f5(slab)
[   16.841210] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.841320] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.841447] page dumped because: kasan: bad access detected
[   16.841539] 
[   16.841599] Memory state around the buggy address:
[   16.841692]  fff00000c45d1980: fa fb fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   16.841762]  fff00000c45d1a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.841815] >fff00000c45d1a80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.842111]                                                        ^
[   16.842186]  fff00000c45d1b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.842322]  fff00000c45d1b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.842426] ==================================================================

[   13.312072] ==================================================================
[   13.313556] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   13.314409] Read of size 1 at addr ffff888101c9b480 by task kunit_try_catch/209
[   13.315100] 
[   13.315328] CPU: 0 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.315376] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.315388] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.315409] Call Trace:
[   13.315422]  <TASK>
[   13.315438]  dump_stack_lvl+0x73/0xb0
[   13.315470]  print_report+0xd1/0x610
[   13.315493]  ? __virt_addr_valid+0x1db/0x2d0
[   13.315516]  ? kmalloc_double_kzfree+0x19c/0x350
[   13.315539]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.315562]  ? kmalloc_double_kzfree+0x19c/0x350
[   13.315586]  kasan_report+0x141/0x180
[   13.315607]  ? kmalloc_double_kzfree+0x19c/0x350
[   13.315633]  ? kmalloc_double_kzfree+0x19c/0x350
[   13.315657]  __kasan_check_byte+0x3d/0x50
[   13.315679]  kfree_sensitive+0x22/0x90
[   13.315702]  kmalloc_double_kzfree+0x19c/0x350
[   13.315725]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   13.315749]  ? __schedule+0x10cc/0x2b60
[   13.315772]  ? __pfx_read_tsc+0x10/0x10
[   13.315792]  ? ktime_get_ts64+0x86/0x230
[   13.315816]  kunit_try_run_case+0x1a5/0x480
[   13.315842]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.315865]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.315889]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.315913]  ? __kthread_parkme+0x82/0x180
[   13.315934]  ? preempt_count_sub+0x50/0x80
[   13.315958]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.315991]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.316016]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.316040]  kthread+0x337/0x6f0
[   13.316059]  ? trace_preempt_on+0x20/0xc0
[   13.316082]  ? __pfx_kthread+0x10/0x10
[   13.316102]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.316124]  ? calculate_sigpending+0x7b/0xa0
[   13.316149]  ? __pfx_kthread+0x10/0x10
[   13.316170]  ret_from_fork+0x116/0x1d0
[   13.316188]  ? __pfx_kthread+0x10/0x10
[   13.316208]  ret_from_fork_asm+0x1a/0x30
[   13.316238]  </TASK>
[   13.316248] 
[   13.328886] Allocated by task 209:
[   13.329384]  kasan_save_stack+0x45/0x70
[   13.329760]  kasan_save_track+0x18/0x40
[   13.329901]  kasan_save_alloc_info+0x3b/0x50
[   13.330331]  __kasan_kmalloc+0xb7/0xc0
[   13.330691]  __kmalloc_cache_noprof+0x189/0x420
[   13.330913]  kmalloc_double_kzfree+0xa9/0x350
[   13.331072]  kunit_try_run_case+0x1a5/0x480
[   13.331221]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.331773]  kthread+0x337/0x6f0
[   13.332211]  ret_from_fork+0x116/0x1d0
[   13.332583]  ret_from_fork_asm+0x1a/0x30
[   13.332963] 
[   13.333194] Freed by task 209:
[   13.333625]  kasan_save_stack+0x45/0x70
[   13.333980]  kasan_save_track+0x18/0x40
[   13.334299]  kasan_save_free_info+0x3f/0x60
[   13.334568]  __kasan_slab_free+0x56/0x70
[   13.334713]  kfree+0x222/0x3f0
[   13.334829]  kfree_sensitive+0x67/0x90
[   13.334962]  kmalloc_double_kzfree+0x12b/0x350
[   13.335650]  kunit_try_run_case+0x1a5/0x480
[   13.336098]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.336681]  kthread+0x337/0x6f0
[   13.337205]  ret_from_fork+0x116/0x1d0
[   13.337576]  ret_from_fork_asm+0x1a/0x30
[   13.337943] 
[   13.338102] The buggy address belongs to the object at ffff888101c9b480
[   13.338102]  which belongs to the cache kmalloc-16 of size 16
[   13.339074] The buggy address is located 0 bytes inside of
[   13.339074]  freed 16-byte region [ffff888101c9b480, ffff888101c9b490)
[   13.339729] 
[   13.339803] The buggy address belongs to the physical page:
[   13.339977] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101c9b
[   13.340838] flags: 0x200000000000000(node=0|zone=2)
[   13.341571] page_type: f5(slab)
[   13.341899] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.342638] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.343167] page dumped because: kasan: bad access detected
[   13.343384] 
[   13.343617] Memory state around the buggy address:
[   13.344204]  ffff888101c9b380: 00 02 fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   13.344741]  ffff888101c9b400: fa fb fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   13.344964] >ffff888101c9b480: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.345740]                    ^
[   13.346057]  ffff888101c9b500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.346766]  ffff888101c9b580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.347052] ==================================================================