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

Environment
qemu-arm64
qemu-x86_64

[   18.332435] ==================================================================
[   18.332511] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   18.332570] Read of size 1 at addr fff00000c3f3ec80 by task kunit_try_catch/192
[   18.332633] 
[   18.332672] CPU: 0 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.333206] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.333299] Hardware name: linux,dummy-virt (DT)
[   18.333408] Call trace:
[   18.333435]  show_stack+0x20/0x38 (C)
[   18.333739]  dump_stack_lvl+0x8c/0xd0
[   18.333877]  print_report+0x118/0x608
[   18.333956]  kasan_report+0xdc/0x128
[   18.334042]  __kasan_check_byte+0x54/0x70
[   18.334308]  kfree_sensitive+0x30/0xb0
[   18.334443]  kmalloc_double_kzfree+0x168/0x308
[   18.334495]  kunit_try_run_case+0x170/0x3f0
[   18.334815]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.334907]  kthread+0x328/0x630
[   18.334988]  ret_from_fork+0x10/0x20
[   18.335212] 
[   18.335356] Allocated by task 192:
[   18.335624]  kasan_save_stack+0x3c/0x68
[   18.335722]  kasan_save_track+0x20/0x40
[   18.335883]  kasan_save_alloc_info+0x40/0x58
[   18.335980]  __kasan_kmalloc+0xd4/0xd8
[   18.336235]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.336300]  kmalloc_double_kzfree+0xb8/0x308
[   18.336739]  kunit_try_run_case+0x170/0x3f0
[   18.337288]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.337612]  kthread+0x328/0x630
[   18.337700]  ret_from_fork+0x10/0x20
[   18.337788] 
[   18.337844] Freed by task 192:
[   18.337887]  kasan_save_stack+0x3c/0x68
[   18.338285]  kasan_save_track+0x20/0x40
[   18.338603]  kasan_save_free_info+0x4c/0x78
[   18.338796]  __kasan_slab_free+0x6c/0x98
[   18.338891]  kfree+0x214/0x3c8
[   18.338936]  kfree_sensitive+0x80/0xb0
[   18.339087]  kmalloc_double_kzfree+0x11c/0x308
[   18.339553]  kunit_try_run_case+0x170/0x3f0
[   18.339685]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.340092]  kthread+0x328/0x630
[   18.340153]  ret_from_fork+0x10/0x20
[   18.340199] 
[   18.340560] The buggy address belongs to the object at fff00000c3f3ec80
[   18.340560]  which belongs to the cache kmalloc-16 of size 16
[   18.340648] The buggy address is located 0 bytes inside of
[   18.340648]  freed 16-byte region [fff00000c3f3ec80, fff00000c3f3ec90)
[   18.341072] 
[   18.341141] The buggy address belongs to the physical page:
[   18.341224] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f3e
[   18.341323] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.341453] page_type: f5(slab)
[   18.341533] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.341717] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.341889] page dumped because: kasan: bad access detected
[   18.341949] 
[   18.341986] Memory state around the buggy address:
[   18.342051]  fff00000c3f3eb80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.342166]  fff00000c3f3ec00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.342223] >fff00000c3f3ec80: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.342274]                    ^
[   18.342596]  fff00000c3f3ed00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.342663]  fff00000c3f3ed80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.342729] ==================================================================

[   11.728971] ==================================================================
[   11.729827] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   11.730369] Read of size 1 at addr ffff8881027960c0 by task kunit_try_catch/211
[   11.731090] 
[   11.731270] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.731315] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.731326] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.731346] Call Trace:
[   11.731358]  <TASK>
[   11.731389]  dump_stack_lvl+0x73/0xb0
[   11.731419]  print_report+0xd1/0x650
[   11.731441]  ? __virt_addr_valid+0x1db/0x2d0
[   11.731463]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.731485]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.731506]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.731527]  kasan_report+0x141/0x180
[   11.731548]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.731572]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.731594]  __kasan_check_byte+0x3d/0x50
[   11.731615]  kfree_sensitive+0x22/0x90
[   11.731637]  kmalloc_double_kzfree+0x19c/0x350
[   11.731658]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.731681]  ? __schedule+0x10cc/0x2b60
[   11.731706]  ? __pfx_read_tsc+0x10/0x10
[   11.731726]  ? ktime_get_ts64+0x86/0x230
[   11.731750]  kunit_try_run_case+0x1a5/0x480
[   11.731774]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.731795]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.731817]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.731838]  ? __kthread_parkme+0x82/0x180
[   11.731857]  ? preempt_count_sub+0x50/0x80
[   11.731880]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.731902]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.731923]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.731945]  kthread+0x337/0x6f0
[   11.731963]  ? trace_preempt_on+0x20/0xc0
[   11.731986]  ? __pfx_kthread+0x10/0x10
[   11.732005]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.732025]  ? calculate_sigpending+0x7b/0xa0
[   11.732047]  ? __pfx_kthread+0x10/0x10
[   11.732068]  ret_from_fork+0x116/0x1d0
[   11.732085]  ? __pfx_kthread+0x10/0x10
[   11.732104]  ret_from_fork_asm+0x1a/0x30
[   11.732134]  </TASK>
[   11.732145] 
[   11.745209] Allocated by task 211:
[   11.745550]  kasan_save_stack+0x45/0x70
[   11.745974]  kasan_save_track+0x18/0x40
[   11.746413]  kasan_save_alloc_info+0x3b/0x50
[   11.746572]  __kasan_kmalloc+0xb7/0xc0
[   11.746704]  __kmalloc_cache_noprof+0x189/0x420
[   11.747116]  kmalloc_double_kzfree+0xa9/0x350
[   11.747528]  kunit_try_run_case+0x1a5/0x480
[   11.747978]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.748498]  kthread+0x337/0x6f0
[   11.748812]  ret_from_fork+0x116/0x1d0
[   11.749207]  ret_from_fork_asm+0x1a/0x30
[   11.749453] 
[   11.749525] Freed by task 211:
[   11.749851]  kasan_save_stack+0x45/0x70
[   11.750216]  kasan_save_track+0x18/0x40
[   11.750576]  kasan_save_free_info+0x3f/0x60
[   11.751041]  __kasan_slab_free+0x56/0x70
[   11.751436]  kfree+0x222/0x3f0
[   11.751807]  kfree_sensitive+0x67/0x90
[   11.752078]  kmalloc_double_kzfree+0x12b/0x350
[   11.752240]  kunit_try_run_case+0x1a5/0x480
[   11.752396]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.752568]  kthread+0x337/0x6f0
[   11.753065]  ret_from_fork+0x116/0x1d0
[   11.753445]  ret_from_fork_asm+0x1a/0x30
[   11.753870] 
[   11.754193] The buggy address belongs to the object at ffff8881027960c0
[   11.754193]  which belongs to the cache kmalloc-16 of size 16
[   11.755329] The buggy address is located 0 bytes inside of
[   11.755329]  freed 16-byte region [ffff8881027960c0, ffff8881027960d0)
[   11.756237] 
[   11.756315] The buggy address belongs to the physical page:
[   11.756501] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102796
[   11.757128] flags: 0x200000000000000(node=0|zone=2)
[   11.757744] page_type: f5(slab)
[   11.758088] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.758918] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.759631] page dumped because: kasan: bad access detected
[   11.759994] 
[   11.760077] Memory state around the buggy address:
[   11.760506]  ffff888102795f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.761313]  ffff888102796000: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.761751] >ffff888102796080: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   11.762502]                                            ^
[   11.762874]  ffff888102796100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.763091]  ffff888102796180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.763302] ==================================================================