Hay
Date
July 23, 2025, 3:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.219395] ==================================================================
[   31.219482] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   31.219562] Read of size 1 at addr fff00000c8603ee0 by task kunit_try_catch/225
[   31.219888] 
[   31.219965] CPU: 0 UID: 0 PID: 225 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   31.220065] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   31.220140] Hardware name: linux,dummy-virt (DT)
[   31.220175] Call trace:
[   31.220202]  show_stack+0x20/0x38 (C)
[   31.220258]  dump_stack_lvl+0x8c/0xd0
[   31.220628]  print_report+0x118/0x5e8
[   31.220710]  kasan_report+0xdc/0x128
[   31.220871]  __kasan_check_byte+0x54/0x70
[   31.221019]  kfree_sensitive+0x30/0xb0
[   31.221082]  kmalloc_double_kzfree+0x168/0x308
[   31.221313]  kunit_try_run_case+0x170/0x3f0
[   31.221568]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.221678]  kthread+0x328/0x630
[   31.221811]  ret_from_fork+0x10/0x20
[   31.221957] 
[   31.222101] Allocated by task 225:
[   31.222152]  kasan_save_stack+0x3c/0x68
[   31.222387]  kasan_save_track+0x20/0x40
[   31.222592]  kasan_save_alloc_info+0x40/0x58
[   31.222668]  __kasan_kmalloc+0xd4/0xd8
[   31.222719]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.222877]  kmalloc_double_kzfree+0xb8/0x308
[   31.222972]  kunit_try_run_case+0x170/0x3f0
[   31.223190]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.223408]  kthread+0x328/0x630
[   31.223476]  ret_from_fork+0x10/0x20
[   31.223620] 
[   31.223671] Freed by task 225:
[   31.223803]  kasan_save_stack+0x3c/0x68
[   31.223915]  kasan_save_track+0x20/0x40
[   31.223975]  kasan_save_free_info+0x4c/0x78
[   31.224360]  __kasan_slab_free+0x6c/0x98
[   31.224429]  kfree+0x214/0x3c8
[   31.224469]  kfree_sensitive+0x80/0xb0
[   31.224519]  kmalloc_double_kzfree+0x11c/0x308
[   31.225385]  kunit_try_run_case+0x170/0x3f0
[   31.225442]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.225487]  kthread+0x328/0x630
[   31.225554]  ret_from_fork+0x10/0x20
[   31.225606] 
[   31.225651] The buggy address belongs to the object at fff00000c8603ee0
[   31.225651]  which belongs to the cache kmalloc-16 of size 16
[   31.225733] The buggy address is located 0 bytes inside of
[   31.225733]  freed 16-byte region [fff00000c8603ee0, fff00000c8603ef0)
[   31.226120] 
[   31.226166] The buggy address belongs to the physical page:
[   31.226474] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xfff00000c8603e00 pfn:0x108603
[   31.226750] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.226830] page_type: f5(slab)
[   31.227038] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   31.227266] raw: fff00000c8603e00 000000008080007f 00000000f5000000 0000000000000000
[   31.227351] page dumped because: kasan: bad access detected
[   31.227452] 
[   31.227474] Memory state around the buggy address:
[   31.227696]  fff00000c8603d80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.227884]  fff00000c8603e00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.228106] >fff00000c8603e80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.228294]                                                        ^
[   31.228393]  fff00000c8603f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.228504]  fff00000c8603f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.228583] ==================================================================

[   25.533017] ==================================================================
[   25.534559] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   25.535594] Read of size 1 at addr ffff8881046316c0 by task kunit_try_catch/241
[   25.536239] 
[   25.536343] CPU: 1 UID: 0 PID: 241 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   25.536396] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.536410] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.536433] Call Trace:
[   25.536447]  <TASK>
[   25.536467]  dump_stack_lvl+0x73/0xb0
[   25.536499]  print_report+0xd1/0x640
[   25.536524]  ? __virt_addr_valid+0x1db/0x2d0
[   25.536551]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.536833]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.536968]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.536994]  kasan_report+0x141/0x180
[   25.537016]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.537042]  ? kmalloc_double_kzfree+0x19c/0x350
[   25.537064]  __kasan_check_byte+0x3d/0x50
[   25.537085]  kfree_sensitive+0x22/0x90
[   25.537110]  kmalloc_double_kzfree+0x19c/0x350
[   25.537133]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   25.537168]  ? __schedule+0x10da/0x2b60
[   25.537194]  ? __pfx_read_tsc+0x10/0x10
[   25.537216]  ? ktime_get_ts64+0x86/0x230
[   25.537241]  kunit_try_run_case+0x1a5/0x480
[   25.537267]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.537289]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.537313]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.537338]  ? __kthread_parkme+0x82/0x180
[   25.537371]  ? preempt_count_sub+0x50/0x80
[   25.537396]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.537419]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.537442]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.537465]  kthread+0x337/0x6f0
[   25.537484]  ? trace_preempt_on+0x20/0xc0
[   25.537509]  ? __pfx_kthread+0x10/0x10
[   25.537529]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.537552]  ? calculate_sigpending+0x7b/0xa0
[   25.537576]  ? __pfx_kthread+0x10/0x10
[   25.537597]  ret_from_fork+0x116/0x1d0
[   25.537616]  ? __pfx_kthread+0x10/0x10
[   25.537636]  ret_from_fork_asm+0x1a/0x30
[   25.537667]  </TASK>
[   25.537678] 
[   25.549776] Allocated by task 241:
[   25.549938]  kasan_save_stack+0x45/0x70
[   25.550295]  kasan_save_track+0x18/0x40
[   25.550622]  kasan_save_alloc_info+0x3b/0x50
[   25.551030]  __kasan_kmalloc+0xb7/0xc0
[   25.551731]  __kmalloc_cache_noprof+0x189/0x420
[   25.552135]  kmalloc_double_kzfree+0xa9/0x350
[   25.552349]  kunit_try_run_case+0x1a5/0x480
[   25.552765]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.553013]  kthread+0x337/0x6f0
[   25.553132]  ret_from_fork+0x116/0x1d0
[   25.553271]  ret_from_fork_asm+0x1a/0x30
[   25.553407] 
[   25.553472] Freed by task 241:
[   25.553578]  kasan_save_stack+0x45/0x70
[   25.554098]  kasan_save_track+0x18/0x40
[   25.554262]  kasan_save_free_info+0x3f/0x60
[   25.554398]  __kasan_slab_free+0x56/0x70
[   25.554571]  kfree+0x222/0x3f0
[   25.554738]  kfree_sensitive+0x67/0x90
[   25.554924]  kmalloc_double_kzfree+0x12b/0x350
[   25.555162]  kunit_try_run_case+0x1a5/0x480
[   25.555337]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.555501]  kthread+0x337/0x6f0
[   25.555615]  ret_from_fork+0x116/0x1d0
[   25.555751]  ret_from_fork_asm+0x1a/0x30
[   25.555881] 
[   25.555952] The buggy address belongs to the object at ffff8881046316c0
[   25.555952]  which belongs to the cache kmalloc-16 of size 16
[   25.556878] The buggy address is located 0 bytes inside of
[   25.556878]  freed 16-byte region [ffff8881046316c0, ffff8881046316d0)
[   25.558293] 
[   25.558396] The buggy address belongs to the physical page:
[   25.558591] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104631
[   25.558830] flags: 0x200000000000000(node=0|zone=2)
[   25.558989] page_type: f5(slab)
[   25.559112] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   25.560393] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   25.561246] page dumped because: kasan: bad access detected
[   25.561785] 
[   25.561950] Memory state around the buggy address:
[   25.562787]  ffff888104631580: 00 06 fc fc 00 06 fc fc fa fb fc fc fa fb fc fc
[   25.563530]  ffff888104631600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.564301] >ffff888104631680: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   25.565272]                                            ^
[   25.566314]  ffff888104631700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.566537]  ffff888104631780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.567084] ==================================================================