Date
July 10, 2025, 9:07 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 29.656575] ================================================================== [ 29.656799] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 29.656978] Read of size 1 at addr fff00000c8686b20 by task kunit_try_catch/223 [ 29.657685] [ 29.657767] CPU: 0 UID: 0 PID: 223 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5-next-20250710 #1 PREEMPT [ 29.658057] Tainted: [B]=BAD_PAGE, [N]=TEST [ 29.658085] Hardware name: linux,dummy-virt (DT) [ 29.658172] Call trace: [ 29.658196] show_stack+0x20/0x38 (C) [ 29.658489] dump_stack_lvl+0x8c/0xd0 [ 29.658693] print_report+0x118/0x5d0 [ 29.658839] kasan_report+0xdc/0x128 [ 29.658994] __kasan_check_byte+0x54/0x70 [ 29.659111] kfree_sensitive+0x30/0xb0 [ 29.659228] kmalloc_double_kzfree+0x168/0x308 [ 29.659277] kunit_try_run_case+0x170/0x3f0 [ 29.659615] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 29.659669] kthread+0x328/0x630 [ 29.659818] ret_from_fork+0x10/0x20 [ 29.659938] [ 29.660002] Allocated by task 223: [ 29.660055] kasan_save_stack+0x3c/0x68 [ 29.660098] kasan_save_track+0x20/0x40 [ 29.660145] kasan_save_alloc_info+0x40/0x58 [ 29.660183] __kasan_kmalloc+0xd4/0xd8 [ 29.660220] __kmalloc_cache_noprof+0x16c/0x3c0 [ 29.660261] kmalloc_double_kzfree+0xb8/0x308 [ 29.660299] kunit_try_run_case+0x170/0x3f0 [ 29.660339] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 29.660416] kthread+0x328/0x630 [ 29.660450] ret_from_fork+0x10/0x20 [ 29.660498] [ 29.660518] Freed by task 223: [ 29.660588] kasan_save_stack+0x3c/0x68 [ 29.660629] kasan_save_track+0x20/0x40 [ 29.660667] kasan_save_free_info+0x4c/0x78 [ 29.660705] __kasan_slab_free+0x6c/0x98 [ 29.660743] kfree+0x214/0x3c8 [ 29.660787] kfree_sensitive+0x80/0xb0 [ 29.660940] kmalloc_double_kzfree+0x11c/0x308 [ 29.661022] kunit_try_run_case+0x170/0x3f0 [ 29.661101] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 29.661155] kthread+0x328/0x630 [ 29.661186] ret_from_fork+0x10/0x20 [ 29.661223] [ 29.661241] The buggy address belongs to the object at fff00000c8686b20 [ 29.661241] which belongs to the cache kmalloc-16 of size 16 [ 29.661301] The buggy address is located 0 bytes inside of [ 29.661301] freed 16-byte region [fff00000c8686b20, fff00000c8686b30) [ 29.661365] [ 29.661385] The buggy address belongs to the physical page: [ 29.661479] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xfff00000c8686a40 pfn:0x108686 [ 29.661743] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 29.661981] page_type: f5(slab) [ 29.662110] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 29.662316] raw: fff00000c8686a40 000000008080007f 00000000f5000000 0000000000000000 [ 29.662364] page dumped because: kasan: bad access detected [ 29.662634] [ 29.662652] Memory state around the buggy address: [ 29.662686] fff00000c8686a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 29.662730] fff00000c8686a80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 29.662774] >fff00000c8686b00: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 29.663002] ^ [ 29.663043] fff00000c8686b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 29.663089] fff00000c8686c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 29.663196] ==================================================================
[ 25.376866] ================================================================== [ 25.377318] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350 [ 25.377561] Read of size 1 at addr ffff888103cd6780 by task kunit_try_catch/240 [ 25.377794] [ 25.377882] CPU: 1 UID: 0 PID: 240 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5-next-20250710 #1 PREEMPT(voluntary) [ 25.377933] Tainted: [B]=BAD_PAGE, [N]=TEST [ 25.377945] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 25.377967] Call Trace: [ 25.377980] <TASK> [ 25.377999] dump_stack_lvl+0x73/0xb0 [ 25.378028] print_report+0xd1/0x610 [ 25.378050] ? __virt_addr_valid+0x1db/0x2d0 [ 25.378074] ? kmalloc_double_kzfree+0x19c/0x350 [ 25.378096] ? kasan_complete_mode_report_info+0x64/0x200 [ 25.378121] ? kmalloc_double_kzfree+0x19c/0x350 [ 25.378143] kasan_report+0x141/0x180 [ 25.378163] ? kmalloc_double_kzfree+0x19c/0x350 [ 25.378187] ? kmalloc_double_kzfree+0x19c/0x350 [ 25.378209] __kasan_check_byte+0x3d/0x50 [ 25.378229] kfree_sensitive+0x22/0x90 [ 25.378254] kmalloc_double_kzfree+0x19c/0x350 [ 25.378276] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 25.378298] ? __schedule+0x10cc/0x2b60 [ 25.378320] ? __pfx_read_tsc+0x10/0x10 [ 25.378341] ? ktime_get_ts64+0x86/0x230 [ 25.378365] kunit_try_run_case+0x1a5/0x480 [ 25.378386] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.378405] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 25.378427] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 25.378449] ? __kthread_parkme+0x82/0x180 [ 25.378469] ? preempt_count_sub+0x50/0x80 [ 25.378492] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.378512] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.378536] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 25.378559] kthread+0x337/0x6f0 [ 25.378578] ? trace_preempt_on+0x20/0xc0 [ 25.378600] ? __pfx_kthread+0x10/0x10 [ 25.378620] ? _raw_spin_unlock_irq+0x47/0x80 [ 25.378640] ? calculate_sigpending+0x7b/0xa0 [ 25.378662] ? __pfx_kthread+0x10/0x10 [ 25.378683] ret_from_fork+0x116/0x1d0 [ 25.379023] ? __pfx_kthread+0x10/0x10 [ 25.379056] ret_from_fork_asm+0x1a/0x30 [ 25.379088] </TASK> [ 25.379102] [ 25.398450] Allocated by task 240: [ 25.398601] kasan_save_stack+0x45/0x70 [ 25.398768] kasan_save_track+0x18/0x40 [ 25.398901] kasan_save_alloc_info+0x3b/0x50 [ 25.399810] __kasan_kmalloc+0xb7/0xc0 [ 25.400208] __kmalloc_cache_noprof+0x189/0x420 [ 25.400677] kmalloc_double_kzfree+0xa9/0x350 [ 25.401111] kunit_try_run_case+0x1a5/0x480 [ 25.401277] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.401451] kthread+0x337/0x6f0 [ 25.401768] ret_from_fork+0x116/0x1d0 [ 25.402249] ret_from_fork_asm+0x1a/0x30 [ 25.402667] [ 25.402836] Freed by task 240: [ 25.403227] kasan_save_stack+0x45/0x70 [ 25.403634] kasan_save_track+0x18/0x40 [ 25.404005] kasan_save_free_info+0x3f/0x60 [ 25.404336] __kasan_slab_free+0x56/0x70 [ 25.404559] kfree+0x222/0x3f0 [ 25.404674] kfree_sensitive+0x67/0x90 [ 25.405086] kmalloc_double_kzfree+0x12b/0x350 [ 25.405545] kunit_try_run_case+0x1a5/0x480 [ 25.406025] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.406424] kthread+0x337/0x6f0 [ 25.406552] ret_from_fork+0x116/0x1d0 [ 25.407002] ret_from_fork_asm+0x1a/0x30 [ 25.407384] [ 25.407548] The buggy address belongs to the object at ffff888103cd6780 [ 25.407548] which belongs to the cache kmalloc-16 of size 16 [ 25.408414] The buggy address is located 0 bytes inside of [ 25.408414] freed 16-byte region [ffff888103cd6780, ffff888103cd6790) [ 25.408843] [ 25.409161] The buggy address belongs to the physical page: [ 25.409640] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103cd6 [ 25.410627] flags: 0x200000000000000(node=0|zone=2) [ 25.411026] page_type: f5(slab) [ 25.411319] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122 [ 25.411616] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 25.411978] page dumped because: kasan: bad access detected [ 25.412459] [ 25.412624] Memory state around the buggy address: [ 25.413197] ffff888103cd6680: fa fb fc fc 00 06 fc fc 00 06 fc fc 00 06 fc fc [ 25.413902] ffff888103cd6700: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 25.414117] >ffff888103cd6780: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.414328] ^ [ 25.414440] ffff888103cd6800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.414684] ffff888103cd6880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.415227] ==================================================================