Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.988202] ==================================================================
[   16.988312] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   16.988783] Read of size 1 at addr fff00000c3fbdda0 by task kunit_try_catch/192
[   16.988857] 
[   16.988918] CPU: 0 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   16.989079] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.989168] Hardware name: linux,dummy-virt (DT)
[   16.989308] Call trace:
[   16.989362]  show_stack+0x20/0x38 (C)
[   16.989601]  dump_stack_lvl+0x8c/0xd0
[   16.989796]  print_report+0x118/0x608
[   16.989996]  kasan_report+0xdc/0x128
[   16.990069]  __kasan_check_byte+0x54/0x70
[   16.990332]  kfree_sensitive+0x30/0xb0
[   16.990392]  kmalloc_double_kzfree+0x168/0x308
[   16.990449]  kunit_try_run_case+0x170/0x3f0
[   16.990659]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.990727]  kthread+0x328/0x630
[   16.990769]  ret_from_fork+0x10/0x20
[   16.990839] 
[   16.990857] Allocated by task 192:
[   16.990886]  kasan_save_stack+0x3c/0x68
[   16.990926]  kasan_save_track+0x20/0x40
[   16.990964]  kasan_save_alloc_info+0x40/0x58
[   16.991009]  __kasan_kmalloc+0xd4/0xd8
[   16.991448]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.991543]  kmalloc_double_kzfree+0xb8/0x308
[   16.991854]  kunit_try_run_case+0x170/0x3f0
[   16.992145]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.992392]  kthread+0x328/0x630
[   16.992507]  ret_from_fork+0x10/0x20
[   16.992578] 
[   16.992650] Freed by task 192:
[   16.992803]  kasan_save_stack+0x3c/0x68
[   16.992965]  kasan_save_track+0x20/0x40
[   16.993084]  kasan_save_free_info+0x4c/0x78
[   16.993150]  __kasan_slab_free+0x6c/0x98
[   16.993439]  kfree+0x214/0x3c8
[   16.993665]  kfree_sensitive+0x80/0xb0
[   16.993833]  kmalloc_double_kzfree+0x11c/0x308
[   16.993960]  kunit_try_run_case+0x170/0x3f0
[   16.994154]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.994236]  kthread+0x328/0x630
[   16.994451]  ret_from_fork+0x10/0x20
[   16.994623] 
[   16.994772] The buggy address belongs to the object at fff00000c3fbdda0
[   16.994772]  which belongs to the cache kmalloc-16 of size 16
[   16.994874] The buggy address is located 0 bytes inside of
[   16.994874]  freed 16-byte region [fff00000c3fbdda0, fff00000c3fbddb0)
[   16.995062] 
[   16.995091] The buggy address belongs to the physical page:
[   16.995134] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103fbd
[   16.995343] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.995421] page_type: f5(slab)
[   16.995553] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.995940] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.996063] page dumped because: kasan: bad access detected
[   16.996229] 
[   16.996285] Memory state around the buggy address:
[   16.996419]  fff00000c3fbdc80: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   16.996675]  fff00000c3fbdd00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.996740] >fff00000c3fbdd80: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   16.996894]                                ^
[   16.996955]  fff00000c3fbde00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.997222]  fff00000c3fbde80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.997304] ==================================================================

[   11.803741] ==================================================================
[   11.804358] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   11.804828] Read of size 1 at addr ffff888101745ec0 by task kunit_try_catch/210
[   11.805129] 
[   11.805299] CPU: 1 UID: 0 PID: 210 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.805344] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.805355] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.805376] Call Trace:
[   11.805388]  <TASK>
[   11.805404]  dump_stack_lvl+0x73/0xb0
[   11.805433]  print_report+0xd1/0x650
[   11.805456]  ? __virt_addr_valid+0x1db/0x2d0
[   11.805479]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.805501]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.805522]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.805544]  kasan_report+0x141/0x180
[   11.805565]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.805590]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.805612]  __kasan_check_byte+0x3d/0x50
[   11.805633]  kfree_sensitive+0x22/0x90
[   11.805655]  kmalloc_double_kzfree+0x19c/0x350
[   11.805677]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.805699]  ? __schedule+0x10cc/0x2b60
[   11.805720]  ? __pfx_read_tsc+0x10/0x10
[   11.805741]  ? ktime_get_ts64+0x86/0x230
[   11.805765]  kunit_try_run_case+0x1a5/0x480
[   11.805789]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.805809]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.805831]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.805853]  ? __kthread_parkme+0x82/0x180
[   11.805873]  ? preempt_count_sub+0x50/0x80
[   11.805897]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.805920]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.805941]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.805962]  kthread+0x337/0x6f0
[   11.805981]  ? trace_preempt_on+0x20/0xc0
[   11.806003]  ? __pfx_kthread+0x10/0x10
[   11.806023]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.806042]  ? calculate_sigpending+0x7b/0xa0
[   11.806065]  ? __pfx_kthread+0x10/0x10
[   11.806085]  ret_from_fork+0x116/0x1d0
[   11.806116]  ? __pfx_kthread+0x10/0x10
[   11.806136]  ret_from_fork_asm+0x1a/0x30
[   11.806167]  </TASK>
[   11.806179] 
[   11.816371] Allocated by task 210:
[   11.816557]  kasan_save_stack+0x45/0x70
[   11.816731]  kasan_save_track+0x18/0x40
[   11.816889]  kasan_save_alloc_info+0x3b/0x50
[   11.817094]  __kasan_kmalloc+0xb7/0xc0
[   11.817378]  __kmalloc_cache_noprof+0x189/0x420
[   11.817625]  kmalloc_double_kzfree+0xa9/0x350
[   11.817779]  kunit_try_run_case+0x1a5/0x480
[   11.817959]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.818298]  kthread+0x337/0x6f0
[   11.818545]  ret_from_fork+0x116/0x1d0
[   11.818720]  ret_from_fork_asm+0x1a/0x30
[   11.818904] 
[   11.818978] Freed by task 210:
[   11.819125]  kasan_save_stack+0x45/0x70
[   11.819270]  kasan_save_track+0x18/0x40
[   11.819405]  kasan_save_free_info+0x3f/0x60
[   11.819551]  __kasan_slab_free+0x56/0x70
[   11.819737]  kfree+0x222/0x3f0
[   11.819897]  kfree_sensitive+0x67/0x90
[   11.820118]  kmalloc_double_kzfree+0x12b/0x350
[   11.820403]  kunit_try_run_case+0x1a5/0x480
[   11.820618]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.820827]  kthread+0x337/0x6f0
[   11.820992]  ret_from_fork+0x116/0x1d0
[   11.821153]  ret_from_fork_asm+0x1a/0x30
[   11.821448] 
[   11.821532] The buggy address belongs to the object at ffff888101745ec0
[   11.821532]  which belongs to the cache kmalloc-16 of size 16
[   11.821939] The buggy address is located 0 bytes inside of
[   11.821939]  freed 16-byte region [ffff888101745ec0, ffff888101745ed0)
[   11.822382] 
[   11.822482] The buggy address belongs to the physical page:
[   11.822788] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101745
[   11.823210] flags: 0x200000000000000(node=0|zone=2)
[   11.823560] page_type: f5(slab)
[   11.823722] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.824025] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.824444] page dumped because: kasan: bad access detected
[   11.824665] 
[   11.824735] Memory state around the buggy address:
[   11.824924]  ffff888101745d80: 00 01 fc fc 00 04 fc fc 00 04 fc fc 00 05 fc fc
[   11.825161]  ffff888101745e00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.826162] >ffff888101745e80: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   11.826508]                                            ^
[   11.827914]  ffff888101745f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.828170]  ffff888101745f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.828392] ==================================================================