Date
July 15, 2025, 2:09 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.083258] ================================================================== [ 18.083427] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 18.083489] Read of size 1 at addr fff00000c45d8b60 by task kunit_try_catch/194 [ 18.083541] [ 18.083572] CPU: 0 UID: 0 PID: 194 Comm: kunit_try_catch Tainted: G B N 6.15.7-rc1 #1 PREEMPT [ 18.083686] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.083716] Hardware name: linux,dummy-virt (DT) [ 18.083754] Call trace: [ 18.083777] show_stack+0x20/0x38 (C) [ 18.083835] dump_stack_lvl+0x8c/0xd0 [ 18.083883] print_report+0x118/0x5d0 [ 18.083928] kasan_report+0xdc/0x128 [ 18.083972] __kasan_check_byte+0x54/0x70 [ 18.084018] kfree_sensitive+0x30/0xb0 [ 18.084085] kmalloc_double_kzfree+0x168/0x308 [ 18.084134] kunit_try_run_case+0x170/0x3f0 [ 18.084190] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.084269] kthread+0x328/0x630 [ 18.084315] ret_from_fork+0x10/0x20 [ 18.084361] [ 18.084380] Allocated by task 194: [ 18.084406] kasan_save_stack+0x3c/0x68 [ 18.084443] kasan_save_track+0x20/0x40 [ 18.084480] kasan_save_alloc_info+0x40/0x58 [ 18.084517] __kasan_kmalloc+0xd4/0xd8 [ 18.084564] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.084602] kmalloc_double_kzfree+0xb8/0x308 [ 18.084642] kunit_try_run_case+0x170/0x3f0 [ 18.084681] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.084732] kthread+0x328/0x630 [ 18.084776] ret_from_fork+0x10/0x20 [ 18.084810] [ 18.084828] Freed by task 194: [ 18.084862] kasan_save_stack+0x3c/0x68 [ 18.084905] kasan_save_track+0x20/0x40 [ 18.084942] kasan_save_free_info+0x4c/0x78 [ 18.084986] __kasan_slab_free+0x6c/0x98 [ 18.085028] kfree+0x214/0x3c8 [ 18.085061] kfree_sensitive+0x80/0xb0 [ 18.085103] kmalloc_double_kzfree+0x11c/0x308 [ 18.085145] kunit_try_run_case+0x170/0x3f0 [ 18.085183] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.085946] kthread+0x328/0x630 [ 18.086035] ret_from_fork+0x10/0x20 [ 18.086122] [ 18.086225] The buggy address belongs to the object at fff00000c45d8b60 [ 18.086225] which belongs to the cache kmalloc-16 of size 16 [ 18.086304] The buggy address is located 0 bytes inside of [ 18.086304] freed 16-byte region [fff00000c45d8b60, fff00000c45d8b70) [ 18.086677] [ 18.086872] The buggy address belongs to the physical page: [ 18.087010] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1045d8 [ 18.087194] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.087258] page_type: f5(slab) [ 18.087635] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 18.087731] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 18.087881] page dumped because: kasan: bad access detected [ 18.087952] [ 18.088028] Memory state around the buggy address: [ 18.088355] fff00000c45d8a00: fa fb fc fc fa fb fc fc 00 01 fc fc fa fb fc fc [ 18.088521] fff00000c45d8a80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.088597] >fff00000c45d8b00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.088738] ^ [ 18.088827] fff00000c45d8b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.088925] fff00000c45d8c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.089138] ==================================================================
[ 11.324620] ================================================================== [ 11.326117] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350 [ 11.326364] Read of size 1 at addr ffff8881027e74c0 by task kunit_try_catch/211 [ 11.326585] [ 11.326684] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G B N 6.15.7-rc1 #1 PREEMPT(voluntary) [ 11.326728] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.326739] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.326758] Call Trace: [ 11.326771] <TASK> [ 11.326787] dump_stack_lvl+0x73/0xb0 [ 11.326812] print_report+0xd1/0x610 [ 11.326834] ? __virt_addr_valid+0x1db/0x2d0 [ 11.326855] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.326873] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.326906] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.326924] kasan_report+0x141/0x180 [ 11.326947] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.326968] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.326987] __kasan_check_byte+0x3d/0x50 [ 11.327009] kfree_sensitive+0x22/0x90 [ 11.327032] kmalloc_double_kzfree+0x19c/0x350 [ 11.327050] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 11.327069] ? __schedule+0x207f/0x2b60 [ 11.327091] ? __pfx_read_tsc+0x10/0x10 [ 11.327110] ? ktime_get_ts64+0x86/0x230 [ 11.327137] kunit_try_run_case+0x1a5/0x480 [ 11.327157] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.327174] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.327197] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.327261] ? __kthread_parkme+0x82/0x180 [ 11.327284] ? preempt_count_sub+0x50/0x80 [ 11.327533] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.327561] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.327584] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.327606] kthread+0x337/0x6f0 [ 11.327621] ? trace_preempt_on+0x20/0xc0 [ 11.327644] ? __pfx_kthread+0x10/0x10 [ 11.327661] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.327682] ? calculate_sigpending+0x7b/0xa0 [ 11.327702] ? __pfx_kthread+0x10/0x10 [ 11.327719] ret_from_fork+0x41/0x80 [ 11.327739] ? __pfx_kthread+0x10/0x10 [ 11.327755] ret_from_fork_asm+0x1a/0x30 [ 11.327785] </TASK> [ 11.327795] [ 11.341316] Allocated by task 211: [ 11.341540] kasan_save_stack+0x45/0x70 [ 11.341735] kasan_save_track+0x18/0x40 [ 11.341992] kasan_save_alloc_info+0x3b/0x50 [ 11.342151] __kasan_kmalloc+0xb7/0xc0 [ 11.342282] __kmalloc_cache_noprof+0x189/0x420 [ 11.342501] kmalloc_double_kzfree+0xa9/0x350 [ 11.342710] kunit_try_run_case+0x1a5/0x480 [ 11.343037] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.343294] kthread+0x337/0x6f0 [ 11.343446] ret_from_fork+0x41/0x80 [ 11.343596] ret_from_fork_asm+0x1a/0x30 [ 11.343784] [ 11.344013] Freed by task 211: [ 11.344331] kasan_save_stack+0x45/0x70 [ 11.345236] kasan_save_track+0x18/0x40 [ 11.345399] kasan_save_free_info+0x3f/0x60 [ 11.345542] __kasan_slab_free+0x56/0x70 [ 11.345686] kfree+0x222/0x3f0 [ 11.345799] kfree_sensitive+0x67/0x90 [ 11.346123] kmalloc_double_kzfree+0x12b/0x350 [ 11.346570] kunit_try_run_case+0x1a5/0x480 [ 11.346991] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.347170] kthread+0x337/0x6f0 [ 11.347288] ret_from_fork+0x41/0x80 [ 11.347416] ret_from_fork_asm+0x1a/0x30 [ 11.347551] [ 11.347622] The buggy address belongs to the object at ffff8881027e74c0 [ 11.347622] which belongs to the cache kmalloc-16 of size 16 [ 11.348987] The buggy address is located 0 bytes inside of [ 11.348987] freed 16-byte region [ffff8881027e74c0, ffff8881027e74d0) [ 11.350067] [ 11.350233] The buggy address belongs to the physical page: [ 11.350765] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027e7 [ 11.351448] flags: 0x200000000000000(node=0|zone=2) [ 11.351617] page_type: f5(slab) [ 11.351939] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 11.352566] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 11.353109] page dumped because: kasan: bad access detected [ 11.353290] [ 11.353359] Memory state around the buggy address: [ 11.353512] ffff8881027e7380: 00 04 fc fc 00 04 fc fc 00 01 fc fc 00 01 fc fc [ 11.353911] ffff8881027e7400: 00 04 fc fc 00 04 fc fc fa fb fc fc fa fb fc fc [ 11.354498] >ffff8881027e7480: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc [ 11.355185] ^ [ 11.355632] ffff8881027e7500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.356315] ffff8881027e7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.357090] ==================================================================