Hay
Date
July 8, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.328572] ==================================================================
[   31.328668] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   31.328785] Read of size 1 at addr fff00000c79816c0 by task kunit_try_catch/223
[   31.328870] 
[   31.328910] CPU: 0 UID: 0 PID: 223 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT 
[   31.329152] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.329183] Hardware name: linux,dummy-virt (DT)
[   31.329229] Call trace:
[   31.329414]  show_stack+0x20/0x38 (C)
[   31.329553]  dump_stack_lvl+0x8c/0xd0
[   31.329605]  print_report+0x118/0x5d0
[   31.329652]  kasan_report+0xdc/0x128
[   31.329743]  __kasan_check_byte+0x54/0x70
[   31.329915]  kfree_sensitive+0x30/0xb0
[   31.329965]  kmalloc_double_kzfree+0x168/0x308
[   31.330425]  kunit_try_run_case+0x170/0x3f0
[   31.330591]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.331111]  kthread+0x328/0x630
[   31.331726]  ret_from_fork+0x10/0x20
[   31.332237] 
[   31.332605] Allocated by task 223:
[   31.332757]  kasan_save_stack+0x3c/0x68
[   31.332854]  kasan_save_track+0x20/0x40
[   31.332918]  kasan_save_alloc_info+0x40/0x58
[   31.332982]  __kasan_kmalloc+0xd4/0xd8
[   31.333022]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.333071]  kmalloc_double_kzfree+0xb8/0x308
[   31.333236]  kunit_try_run_case+0x170/0x3f0
[   31.333508]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.333554]  kthread+0x328/0x630
[   31.333588]  ret_from_fork+0x10/0x20
[   31.333625] 
[   31.333647] Freed by task 223:
[   31.333676]  kasan_save_stack+0x3c/0x68
[   31.334799]  kasan_save_track+0x20/0x40
[   31.335384]  kasan_save_free_info+0x4c/0x78
[   31.335831]  __kasan_slab_free+0x6c/0x98
[   31.336315]  kfree+0x214/0x3c8
[   31.336464]  kfree_sensitive+0x80/0xb0
[   31.336504]  kmalloc_double_kzfree+0x11c/0x308
[   31.336949]  kunit_try_run_case+0x170/0x3f0
[   31.337016]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.337615]  kthread+0x328/0x630
[   31.338009]  ret_from_fork+0x10/0x20
[   31.338478] 
[   31.338519] The buggy address belongs to the object at fff00000c79816c0
[   31.338519]  which belongs to the cache kmalloc-16 of size 16
[   31.338811] The buggy address is located 0 bytes inside of
[   31.338811]  freed 16-byte region [fff00000c79816c0, fff00000c79816d0)
[   31.338879] 
[   31.338902] The buggy address belongs to the physical page:
[   31.339356] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107981
[   31.340109] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.340905] page_type: f5(slab)
[   31.340962] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   31.341015] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   31.341056] page dumped because: kasan: bad access detected
[   31.341090] 
[   31.341110] Memory state around the buggy address:
[   31.341144]  fff00000c7981580: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.341188]  fff00000c7981600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   31.341245] >fff00000c7981680: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   31.341286]                                            ^
[   31.341321]  fff00000c7981700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.341366]  fff00000c7981780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.341405] ==================================================================

[   23.682363] ==================================================================
[   23.682938] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   23.683467] Read of size 1 at addr ffff8881025fe600 by task kunit_try_catch/240
[   23.683790] 
[   23.683944] CPU: 1 UID: 0 PID: 240 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT(voluntary) 
[   23.683998] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.684011] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.684034] Call Trace:
[   23.684048]  <TASK>
[   23.684068]  dump_stack_lvl+0x73/0xb0
[   23.684101]  print_report+0xd1/0x610
[   23.684125]  ? __virt_addr_valid+0x1db/0x2d0
[   23.684152]  ? kmalloc_double_kzfree+0x19c/0x350
[   23.684176]  ? kasan_complete_mode_report_info+0x64/0x200
[   23.684205]  ? kmalloc_double_kzfree+0x19c/0x350
[   23.684229]  kasan_report+0x141/0x180
[   23.684265]  ? kmalloc_double_kzfree+0x19c/0x350
[   23.684292]  ? kmalloc_double_kzfree+0x19c/0x350
[   23.684316]  __kasan_check_byte+0x3d/0x50
[   23.684338]  kfree_sensitive+0x22/0x90
[   23.684369]  kmalloc_double_kzfree+0x19c/0x350
[   23.684393]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   23.684442]  ? __schedule+0x10cc/0x2b60
[   23.684473]  ? __pfx_read_tsc+0x10/0x10
[   23.684499]  ? ktime_get_ts64+0x86/0x230
[   23.684538]  kunit_try_run_case+0x1a5/0x480
[   23.684563]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.684596]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.684618]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.684647]  ? __kthread_parkme+0x82/0x180
[   23.684669]  ? preempt_count_sub+0x50/0x80
[   23.684694]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.684716]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.684743]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.684771]  kthread+0x337/0x6f0
[   23.684793]  ? trace_preempt_on+0x20/0xc0
[   23.684881]  ? __pfx_kthread+0x10/0x10
[   23.684905]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.684932]  ? calculate_sigpending+0x7b/0xa0
[   23.684961]  ? __pfx_kthread+0x10/0x10
[   23.684984]  ret_from_fork+0x116/0x1d0
[   23.685005]  ? __pfx_kthread+0x10/0x10
[   23.685027]  ret_from_fork_asm+0x1a/0x30
[   23.685062]  </TASK>
[   23.685074] 
[   23.696135] Allocated by task 240:
[   23.696408]  kasan_save_stack+0x45/0x70
[   23.696586]  kasan_save_track+0x18/0x40
[   23.697292]  kasan_save_alloc_info+0x3b/0x50
[   23.697501]  __kasan_kmalloc+0xb7/0xc0
[   23.697664]  __kmalloc_cache_noprof+0x189/0x420
[   23.697963]  kmalloc_double_kzfree+0xa9/0x350
[   23.698182]  kunit_try_run_case+0x1a5/0x480
[   23.698394]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.698627]  kthread+0x337/0x6f0
[   23.698775]  ret_from_fork+0x116/0x1d0
[   23.699112]  ret_from_fork_asm+0x1a/0x30
[   23.699273] 
[   23.699340] Freed by task 240:
[   23.699494]  kasan_save_stack+0x45/0x70
[   23.699680]  kasan_save_track+0x18/0x40
[   23.699909]  kasan_save_free_info+0x3f/0x60
[   23.700131]  __kasan_slab_free+0x56/0x70
[   23.700447]  kfree+0x222/0x3f0
[   23.700621]  kfree_sensitive+0x67/0x90
[   23.700914]  kmalloc_double_kzfree+0x12b/0x350
[   23.701064]  kunit_try_run_case+0x1a5/0x480
[   23.701206]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.701469]  kthread+0x337/0x6f0
[   23.701653]  ret_from_fork+0x116/0x1d0
[   23.701837]  ret_from_fork_asm+0x1a/0x30
[   23.702065] 
[   23.702216] The buggy address belongs to the object at ffff8881025fe600
[   23.702216]  which belongs to the cache kmalloc-16 of size 16
[   23.702728] The buggy address is located 0 bytes inside of
[   23.702728]  freed 16-byte region [ffff8881025fe600, ffff8881025fe610)
[   23.703459] 
[   23.703538] The buggy address belongs to the physical page:
[   23.703858] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1025fe
[   23.704321] flags: 0x200000000000000(node=0|zone=2)
[   23.704554] page_type: f5(slab)
[   23.704702] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   23.705069] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   23.705481] page dumped because: kasan: bad access detected
[   23.705738] 
[   23.705868] Memory state around the buggy address:
[   23.706108]  ffff8881025fe500: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   23.706446]  ffff8881025fe580: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   23.706706] >ffff8881025fe600: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.707090]                    ^
[   23.707436]  ffff8881025fe680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.707727]  ffff8881025fe700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.708195] ==================================================================