Date
July 17, 2025, 10:12 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 29.738944] ================================================================== [ 29.739003] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 29.739340] Read of size 1 at addr fff00000c7ac9380 by task kunit_try_catch/223 [ 29.739513] [ 29.739547] CPU: 1 UID: 0 PID: 223 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc6-next-20250717 #1 PREEMPT [ 29.739638] Tainted: [B]=BAD_PAGE, [N]=TEST [ 29.739665] Hardware name: linux,dummy-virt (DT) [ 29.739911] Call trace: [ 29.740088] show_stack+0x20/0x38 (C) [ 29.740150] dump_stack_lvl+0x8c/0xd0 [ 29.740344] print_report+0x118/0x5d0 [ 29.740582] kasan_report+0xdc/0x128 [ 29.740638] __kasan_check_byte+0x54/0x70 [ 29.740681] kfree_sensitive+0x30/0xb0 [ 29.740989] kmalloc_double_kzfree+0x168/0x308 [ 29.741188] kunit_try_run_case+0x170/0x3f0 [ 29.741244] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 29.741513] kthread+0x328/0x630 [ 29.741733] ret_from_fork+0x10/0x20 [ 29.741791] [ 29.741976] Allocated by task 223: [ 29.742604] kasan_save_stack+0x3c/0x68 [ 29.742693] kasan_save_track+0x20/0x40 [ 29.742810] kasan_save_alloc_info+0x40/0x58 [ 29.742881] __kasan_kmalloc+0xd4/0xd8 [ 29.743098] __kmalloc_cache_noprof+0x16c/0x3c0 [ 29.743269] kmalloc_double_kzfree+0xb8/0x308 [ 29.743333] kunit_try_run_case+0x170/0x3f0 [ 29.743371] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 29.743450] kthread+0x328/0x630 [ 29.743483] ret_from_fork+0x10/0x20 [ 29.743519] [ 29.743540] Freed by task 223: [ 29.743577] kasan_save_stack+0x3c/0x68 [ 29.743620] kasan_save_track+0x20/0x40 [ 29.743656] kasan_save_free_info+0x4c/0x78 [ 29.743693] __kasan_slab_free+0x6c/0x98 [ 29.743729] kfree+0x214/0x3c8 [ 29.743764] kfree_sensitive+0x80/0xb0 [ 29.743801] kmalloc_double_kzfree+0x11c/0x308 [ 29.743848] kunit_try_run_case+0x170/0x3f0 [ 29.743896] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 29.743938] kthread+0x328/0x630 [ 29.743979] ret_from_fork+0x10/0x20 [ 29.744016] [ 29.744035] The buggy address belongs to the object at fff00000c7ac9380 [ 29.744035] which belongs to the cache kmalloc-16 of size 16 [ 29.744104] The buggy address is located 0 bytes inside of [ 29.744104] freed 16-byte region [fff00000c7ac9380, fff00000c7ac9390) [ 29.744166] [ 29.744197] The buggy address belongs to the physical page: [ 29.744229] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107ac9 [ 29.744283] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 29.744341] page_type: f5(slab) [ 29.744381] raw: 0bfffe0000000000 fff00000c0001640 dead000000000100 dead000000000122 [ 29.744748] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 29.745173] page dumped because: kasan: bad access detected [ 29.745348] [ 29.745520] Memory state around the buggy address: [ 29.745969] fff00000c7ac9280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 29.746022] fff00000c7ac9300: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 29.746277] >fff00000c7ac9380: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 29.746419] ^ [ 29.746570] fff00000c7ac9400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 29.746753] fff00000c7ac9480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 29.746825] ==================================================================
[ 25.998397] ================================================================== [ 25.999805] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350 [ 26.000480] Read of size 1 at addr ffff888104561cc0 by task kunit_try_catch/241 [ 26.001216] [ 26.001442] CPU: 1 UID: 0 PID: 241 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc6-next-20250717 #1 PREEMPT(voluntary) [ 26.001505] Tainted: [B]=BAD_PAGE, [N]=TEST [ 26.001516] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 26.001538] Call Trace: [ 26.001552] <TASK> [ 26.001570] dump_stack_lvl+0x73/0xb0 [ 26.001602] print_report+0xd1/0x610 [ 26.001624] ? __virt_addr_valid+0x1db/0x2d0 [ 26.001648] ? kmalloc_double_kzfree+0x19c/0x350 [ 26.001669] ? kasan_complete_mode_report_info+0x64/0x200 [ 26.001694] ? kmalloc_double_kzfree+0x19c/0x350 [ 26.001716] kasan_report+0x141/0x180 [ 26.001737] ? kmalloc_double_kzfree+0x19c/0x350 [ 26.001762] ? kmalloc_double_kzfree+0x19c/0x350 [ 26.001783] __kasan_check_byte+0x3d/0x50 [ 26.001804] kfree_sensitive+0x22/0x90 [ 26.001825] kmalloc_double_kzfree+0x19c/0x350 [ 26.001847] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 26.001868] ? sysvec_apic_timer_interrupt+0x50/0x90 [ 26.001893] ? trace_hardirqs_on+0x37/0xe0 [ 26.001915] ? __pfx_read_tsc+0x10/0x10 [ 26.001940] ? ktime_get_ts64+0x86/0x230 [ 26.001964] kunit_try_run_case+0x1a5/0x480 [ 26.001988] ? __pfx_kunit_try_run_case+0x10/0x10 [ 26.002011] ? queued_spin_lock_slowpath+0x116/0xb40 [ 26.002034] ? __kthread_parkme+0x82/0x180 [ 26.002058] ? preempt_count_sub+0x50/0x80 [ 26.002091] ? __pfx_kunit_try_run_case+0x10/0x10 [ 26.002114] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 26.002136] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 26.002158] kthread+0x337/0x6f0 [ 26.002176] ? trace_preempt_on+0x20/0xc0 [ 26.002197] ? __pfx_kthread+0x10/0x10 [ 26.002217] ? _raw_spin_unlock_irq+0x47/0x80 [ 26.002280] ? calculate_sigpending+0x7b/0xa0 [ 26.002304] ? __pfx_kthread+0x10/0x10 [ 26.002325] ret_from_fork+0x116/0x1d0 [ 26.002342] ? __pfx_kthread+0x10/0x10 [ 26.002361] ret_from_fork_asm+0x1a/0x30 [ 26.002393] </TASK> [ 26.002403] [ 26.012763] Allocated by task 241: [ 26.012921] kasan_save_stack+0x45/0x70 [ 26.013059] kasan_save_track+0x18/0x40 [ 26.013196] kasan_save_alloc_info+0x3b/0x50 [ 26.013476] __kasan_kmalloc+0xb7/0xc0 [ 26.013665] __kmalloc_cache_noprof+0x189/0x420 [ 26.013886] kmalloc_double_kzfree+0xa9/0x350 [ 26.014121] kunit_try_run_case+0x1a5/0x480 [ 26.014492] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 26.014701] kthread+0x337/0x6f0 [ 26.014870] ret_from_fork+0x116/0x1d0 [ 26.015054] ret_from_fork_asm+0x1a/0x30 [ 26.015371] [ 26.015448] Freed by task 241: [ 26.015595] kasan_save_stack+0x45/0x70 [ 26.015725] kasan_save_track+0x18/0x40 [ 26.015897] kasan_save_free_info+0x3f/0x60 [ 26.016113] __kasan_slab_free+0x56/0x70 [ 26.016388] kfree+0x222/0x3f0 [ 26.016549] kfree_sensitive+0x67/0x90 [ 26.016720] kmalloc_double_kzfree+0x12b/0x350 [ 26.016874] kunit_try_run_case+0x1a5/0x480 [ 26.017045] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 26.017369] kthread+0x337/0x6f0 [ 26.017538] ret_from_fork+0x116/0x1d0 [ 26.017704] ret_from_fork_asm+0x1a/0x30 [ 26.017865] [ 26.017957] The buggy address belongs to the object at ffff888104561cc0 [ 26.017957] which belongs to the cache kmalloc-16 of size 16 [ 26.018589] The buggy address is located 0 bytes inside of [ 26.018589] freed 16-byte region [ffff888104561cc0, ffff888104561cd0) [ 26.019044] [ 26.019145] The buggy address belongs to the physical page: [ 26.019457] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104561 [ 26.019817] flags: 0x200000000000000(node=0|zone=2) [ 26.020002] page_type: f5(slab) [ 26.020180] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122 [ 26.020609] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 26.020906] page dumped because: kasan: bad access detected [ 26.021089] [ 26.021151] Memory state around the buggy address: [ 26.021375] ffff888104561b80: fa fb fc fc 00 00 fc fc fa fb fc fc fa fb fc fc [ 26.021589] ffff888104561c00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 26.021888] >ffff888104561c80: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc [ 26.022218] ^ [ 26.022611] ffff888104561d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 26.022880] ffff888104561d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 26.023096] ==================================================================