Date
June 17, 2025, 6:35 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 17.057076] ================================================================== [ 17.057157] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 17.057483] Read of size 1 at addr fff00000c1193700 by task kunit_try_catch/201 [ 17.057554] [ 17.057676] CPU: 1 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250617 #1 PREEMPT [ 17.057778] Tainted: [B]=BAD_PAGE, [N]=TEST [ 17.057805] Hardware name: linux,dummy-virt (DT) [ 17.057997] Call trace: [ 17.058026] show_stack+0x20/0x38 (C) [ 17.058321] dump_stack_lvl+0x8c/0xd0 [ 17.058416] print_report+0x118/0x608 [ 17.058570] kasan_report+0xdc/0x128 [ 17.058658] __kasan_check_byte+0x54/0x70 [ 17.058728] kfree_sensitive+0x30/0xb0 [ 17.059113] kmalloc_double_kzfree+0x168/0x308 [ 17.059197] kunit_try_run_case+0x170/0x3f0 [ 17.059343] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.059427] kthread+0x328/0x630 [ 17.059574] ret_from_fork+0x10/0x20 [ 17.059682] [ 17.059702] Allocated by task 201: [ 17.059948] kasan_save_stack+0x3c/0x68 [ 17.060122] kasan_save_track+0x20/0x40 [ 17.060186] kasan_save_alloc_info+0x40/0x58 [ 17.060399] __kasan_kmalloc+0xd4/0xd8 [ 17.060509] __kmalloc_cache_noprof+0x16c/0x3c0 [ 17.060747] kmalloc_double_kzfree+0xb8/0x308 [ 17.060838] kunit_try_run_case+0x170/0x3f0 [ 17.060992] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.061066] kthread+0x328/0x630 [ 17.061128] ret_from_fork+0x10/0x20 [ 17.061358] [ 17.061534] Freed by task 201: [ 17.061697] kasan_save_stack+0x3c/0x68 [ 17.061789] kasan_save_track+0x20/0x40 [ 17.061865] kasan_save_free_info+0x4c/0x78 [ 17.062021] __kasan_slab_free+0x6c/0x98 [ 17.062064] kfree+0x214/0x3c8 [ 17.062100] kfree_sensitive+0x80/0xb0 [ 17.062140] kmalloc_double_kzfree+0x11c/0x308 [ 17.062185] kunit_try_run_case+0x170/0x3f0 [ 17.062612] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.062750] kthread+0x328/0x630 [ 17.062834] ret_from_fork+0x10/0x20 [ 17.062900] [ 17.063041] The buggy address belongs to the object at fff00000c1193700 [ 17.063041] which belongs to the cache kmalloc-16 of size 16 [ 17.063294] The buggy address is located 0 bytes inside of [ 17.063294] freed 16-byte region [fff00000c1193700, fff00000c1193710) [ 17.063723] [ 17.063777] The buggy address belongs to the physical page: [ 17.063833] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101193 [ 17.063943] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 17.064116] page_type: f5(slab) [ 17.064182] raw: 0bfffe0000000000 fff00000c0001640 dead000000000100 dead000000000122 [ 17.064385] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 17.064614] page dumped because: kasan: bad access detected [ 17.064676] [ 17.064753] Memory state around the buggy address: [ 17.064823] fff00000c1193600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 17.064908] fff00000c1193680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 17.065013] >fff00000c1193700: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 17.065079] ^ [ 17.065128] fff00000c1193780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 17.065195] fff00000c1193800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 17.065562] ==================================================================
[ 18.486655] ================================================================== [ 18.487851] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350 [ 18.488717] Read of size 1 at addr ffff8881027b1d60 by task kunit_try_catch/219 [ 18.490045] [ 18.490347] CPU: 0 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250617 #1 PREEMPT(voluntary) [ 18.490625] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.490665] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 18.490723] Call Trace: [ 18.490757] <TASK> [ 18.490802] dump_stack_lvl+0x73/0xb0 [ 18.490883] print_report+0xd1/0x650 [ 18.490917] ? __virt_addr_valid+0x1db/0x2d0 [ 18.490950] ? kmalloc_double_kzfree+0x19c/0x350 [ 18.490981] ? kasan_complete_mode_report_info+0x64/0x200 [ 18.491012] ? kmalloc_double_kzfree+0x19c/0x350 [ 18.491043] kasan_report+0x141/0x180 [ 18.491073] ? kmalloc_double_kzfree+0x19c/0x350 [ 18.491108] ? kmalloc_double_kzfree+0x19c/0x350 [ 18.491139] __kasan_check_byte+0x3d/0x50 [ 18.491168] kfree_sensitive+0x22/0x90 [ 18.491198] kmalloc_double_kzfree+0x19c/0x350 [ 18.491243] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 18.491322] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 18.491391] kunit_try_run_case+0x1a5/0x480 [ 18.491430] ? __pfx_kunit_try_run_case+0x10/0x10 [ 18.491461] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 18.491490] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 18.491525] ? __kthread_parkme+0x82/0x180 [ 18.491566] ? preempt_count_sub+0x50/0x80 [ 18.491598] ? __pfx_kunit_try_run_case+0x10/0x10 [ 18.491632] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.491663] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 18.491693] kthread+0x337/0x6f0 [ 18.491719] ? trace_preempt_on+0x20/0xc0 [ 18.491751] ? __pfx_kthread+0x10/0x10 [ 18.491779] ? _raw_spin_unlock_irq+0x47/0x80 [ 18.491811] ? calculate_sigpending+0x7b/0xa0 [ 18.491871] ? __pfx_kthread+0x10/0x10 [ 18.491903] ret_from_fork+0x116/0x1d0 [ 18.491929] ? __pfx_kthread+0x10/0x10 [ 18.491957] ret_from_fork_asm+0x1a/0x30 [ 18.491997] </TASK> [ 18.492013] [ 18.509955] Allocated by task 219: [ 18.510383] kasan_save_stack+0x45/0x70 [ 18.510921] kasan_save_track+0x18/0x40 [ 18.511396] kasan_save_alloc_info+0x3b/0x50 [ 18.511887] __kasan_kmalloc+0xb7/0xc0 [ 18.512246] __kmalloc_cache_noprof+0x189/0x420 [ 18.512631] kmalloc_double_kzfree+0xa9/0x350 [ 18.512962] kunit_try_run_case+0x1a5/0x480 [ 18.513311] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.513961] kthread+0x337/0x6f0 [ 18.514776] ret_from_fork+0x116/0x1d0 [ 18.515145] ret_from_fork_asm+0x1a/0x30 [ 18.515671] [ 18.515899] Freed by task 219: [ 18.516413] kasan_save_stack+0x45/0x70 [ 18.516695] kasan_save_track+0x18/0x40 [ 18.517128] kasan_save_free_info+0x3f/0x60 [ 18.517653] __kasan_slab_free+0x56/0x70 [ 18.518044] kfree+0x222/0x3f0 [ 18.518806] kfree_sensitive+0x67/0x90 [ 18.519676] kmalloc_double_kzfree+0x12b/0x350 [ 18.520457] kunit_try_run_case+0x1a5/0x480 [ 18.520987] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.521527] kthread+0x337/0x6f0 [ 18.522169] ret_from_fork+0x116/0x1d0 [ 18.522693] ret_from_fork_asm+0x1a/0x30 [ 18.523082] [ 18.523479] The buggy address belongs to the object at ffff8881027b1d60 [ 18.523479] which belongs to the cache kmalloc-16 of size 16 [ 18.524396] The buggy address is located 0 bytes inside of [ 18.524396] freed 16-byte region [ffff8881027b1d60, ffff8881027b1d70) [ 18.525794] [ 18.526014] The buggy address belongs to the physical page: [ 18.526607] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027b1 [ 18.527499] flags: 0x200000000000000(node=0|zone=2) [ 18.527963] page_type: f5(slab) [ 18.528338] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 18.529030] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 18.529806] page dumped because: kasan: bad access detected [ 18.530432] [ 18.530670] Memory state around the buggy address: [ 18.531079] ffff8881027b1c00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.531606] ffff8881027b1c80: fa fb fc fc fa fb fc fc 00 05 fc fc fa fb fc fc [ 18.532126] >ffff8881027b1d00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.532697] ^ [ 18.533708] ffff8881027b1d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.534433] ffff8881027b1e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.534990] ==================================================================