Hay
Date
July 3, 2025, 11:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.916981] ==================================================================
[   19.917375] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   19.917686] Read of size 1 at addr fff00000c6191560 by task kunit_try_catch/192
[   19.918160] 
[   19.918260] CPU: 0 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.918563] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.918622] Hardware name: linux,dummy-virt (DT)
[   19.918693] Call trace:
[   19.918908]  show_stack+0x20/0x38 (C)
[   19.919103]  dump_stack_lvl+0x8c/0xd0
[   19.919264]  print_report+0x118/0x608
[   19.919412]  kasan_report+0xdc/0x128
[   19.919527]  __kasan_check_byte+0x54/0x70
[   19.919624]  kfree_sensitive+0x30/0xb0
[   19.919731]  kmalloc_double_kzfree+0x168/0x308
[   19.919862]  kunit_try_run_case+0x170/0x3f0
[   19.919974]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.920095]  kthread+0x328/0x630
[   19.920182]  ret_from_fork+0x10/0x20
[   19.920643] 
[   19.920695] Allocated by task 192:
[   19.920763]  kasan_save_stack+0x3c/0x68
[   19.920855]  kasan_save_track+0x20/0x40
[   19.920930]  kasan_save_alloc_info+0x40/0x58
[   19.921283]  __kasan_kmalloc+0xd4/0xd8
[   19.921408]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.921497]  kmalloc_double_kzfree+0xb8/0x308
[   19.921605]  kunit_try_run_case+0x170/0x3f0
[   19.921785]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.921905]  kthread+0x328/0x630
[   19.922084]  ret_from_fork+0x10/0x20
[   19.922195] 
[   19.922731] Freed by task 192:
[   19.922831]  kasan_save_stack+0x3c/0x68
[   19.922931]  kasan_save_track+0x20/0x40
[   19.923015]  kasan_save_free_info+0x4c/0x78
[   19.923119]  __kasan_slab_free+0x6c/0x98
[   19.923203]  kfree+0x214/0x3c8
[   19.923270]  kfree_sensitive+0x80/0xb0
[   19.923350]  kmalloc_double_kzfree+0x11c/0x308
[   19.923436]  kunit_try_run_case+0x170/0x3f0
[   19.923522]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.924761]  kthread+0x328/0x630
[   19.925443]  ret_from_fork+0x10/0x20
[   19.925768] 
[   19.925834] The buggy address belongs to the object at fff00000c6191560
[   19.925834]  which belongs to the cache kmalloc-16 of size 16
[   19.926010] The buggy address is located 0 bytes inside of
[   19.926010]  freed 16-byte region [fff00000c6191560, fff00000c6191570)
[   19.926274] 
[   19.926346] The buggy address belongs to the physical page:
[   19.926456] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106191
[   19.926642] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.926744] page_type: f5(slab)
[   19.926818] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.926935] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.927019] page dumped because: kasan: bad access detected
[   19.927111] 
[   19.927155] Memory state around the buggy address:
[   19.927237]  fff00000c6191400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.927338]  fff00000c6191480: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.927424] >fff00000c6191500: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.927494]                                                        ^
[   19.927575]  fff00000c6191580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.927687]  fff00000c6191600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.927809] ==================================================================

[   11.902191] ==================================================================
[   11.902847] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   11.903790] Read of size 1 at addr ffff8881023854c0 by task kunit_try_catch/209
[   11.904232] 
[   11.904337] CPU: 0 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.904586] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.904600] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.904622] Call Trace:
[   11.904635]  <TASK>
[   11.904651]  dump_stack_lvl+0x73/0xb0
[   11.904679]  print_report+0xd1/0x650
[   11.904701]  ? __virt_addr_valid+0x1db/0x2d0
[   11.904723]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.904744]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.904764]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.904787]  kasan_report+0x141/0x180
[   11.904807]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.904832]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.904853]  __kasan_check_byte+0x3d/0x50
[   11.904874]  kfree_sensitive+0x22/0x90
[   11.904897]  kmalloc_double_kzfree+0x19c/0x350
[   11.904918]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.904941]  ? __schedule+0x10cc/0x2b60
[   11.904962]  ? __pfx_read_tsc+0x10/0x10
[   11.904981]  ? ktime_get_ts64+0x86/0x230
[   11.905006]  kunit_try_run_case+0x1a5/0x480
[   11.905031]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.905053]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.905075]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.905096]  ? __kthread_parkme+0x82/0x180
[   11.905116]  ? preempt_count_sub+0x50/0x80
[   11.905155]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.905177]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.905198]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.905220]  kthread+0x337/0x6f0
[   11.905238]  ? trace_preempt_on+0x20/0xc0
[   11.905259]  ? __pfx_kthread+0x10/0x10
[   11.905279]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.905298]  ? calculate_sigpending+0x7b/0xa0
[   11.905376]  ? __pfx_kthread+0x10/0x10
[   11.905397]  ret_from_fork+0x116/0x1d0
[   11.905414]  ? __pfx_kthread+0x10/0x10
[   11.905434]  ret_from_fork_asm+0x1a/0x30
[   11.905464]  </TASK>
[   11.905476] 
[   11.915811] Allocated by task 209:
[   11.915970]  kasan_save_stack+0x45/0x70
[   11.916292]  kasan_save_track+0x18/0x40
[   11.916648]  kasan_save_alloc_info+0x3b/0x50
[   11.916983]  __kasan_kmalloc+0xb7/0xc0
[   11.917414]  __kmalloc_cache_noprof+0x189/0x420
[   11.917710]  kmalloc_double_kzfree+0xa9/0x350
[   11.917866]  kunit_try_run_case+0x1a5/0x480
[   11.918013]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.918219]  kthread+0x337/0x6f0
[   11.918499]  ret_from_fork+0x116/0x1d0
[   11.918973]  ret_from_fork_asm+0x1a/0x30
[   11.919134] 
[   11.919231] Freed by task 209:
[   11.919742]  kasan_save_stack+0x45/0x70
[   11.919929]  kasan_save_track+0x18/0x40
[   11.920256]  kasan_save_free_info+0x3f/0x60
[   11.920561]  __kasan_slab_free+0x56/0x70
[   11.920886]  kfree+0x222/0x3f0
[   11.921141]  kfree_sensitive+0x67/0x90
[   11.921428]  kmalloc_double_kzfree+0x12b/0x350
[   11.921805]  kunit_try_run_case+0x1a5/0x480
[   11.922009]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.922457]  kthread+0x337/0x6f0
[   11.922645]  ret_from_fork+0x116/0x1d0
[   11.922838]  ret_from_fork_asm+0x1a/0x30
[   11.923346] 
[   11.923452] The buggy address belongs to the object at ffff8881023854c0
[   11.923452]  which belongs to the cache kmalloc-16 of size 16
[   11.924034] The buggy address is located 0 bytes inside of
[   11.924034]  freed 16-byte region [ffff8881023854c0, ffff8881023854d0)
[   11.924909] 
[   11.924992] The buggy address belongs to the physical page:
[   11.925592] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102385
[   11.925935] flags: 0x200000000000000(node=0|zone=2)
[   11.926527] page_type: f5(slab)
[   11.926787] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.927226] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.927777] page dumped because: kasan: bad access detected
[   11.928014] 
[   11.928098] Memory state around the buggy address:
[   11.928613]  ffff888102385380: 00 06 fc fc 00 06 fc fc fa fb fc fc fa fb fc fc
[   11.929103]  ffff888102385400: 00 00 fc fc 00 00 fc fc 00 00 fc fc 00 00 fc fc
[   11.929670] >ffff888102385480: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   11.930075]                                            ^
[   11.930528]  ffff888102385500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.930927]  ffff888102385580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.931456] ==================================================================