Date
June 2, 2025, 2:10 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 20.260418] ================================================================== [ 20.261168] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x408/0x478 [ 20.261935] Read of size 1 at addr fff00000c5cc29a8 by task kunit_try_catch/175 [ 20.262550] [ 20.262873] CPU: 0 UID: 0 PID: 175 Comm: kunit_try_catch Tainted: G B N 6.12.32-rc1 #1 [ 20.263189] Tainted: [B]=BAD_PAGE, [N]=TEST [ 20.263278] Hardware name: linux,dummy-virt (DT) [ 20.263360] Call trace: [ 20.263418] dump_backtrace+0x9c/0x128 [ 20.263545] show_stack+0x20/0x38 [ 20.263635] dump_stack_lvl+0x8c/0xd0 [ 20.263697] print_report+0x118/0x5f0 [ 20.263743] kasan_report+0xdc/0x128 [ 20.263783] __asan_report_load1_noabort+0x20/0x30 [ 20.263832] kmalloc_uaf2+0x408/0x478 [ 20.263876] kunit_try_run_case+0x170/0x3f0 [ 20.263921] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.263972] kthread+0x24c/0x2d0 [ 20.264014] ret_from_fork+0x10/0x20 [ 20.264060] [ 20.269929] Allocated by task 175: [ 20.270937] kasan_save_stack+0x3c/0x68 [ 20.271883] kasan_save_track+0x20/0x40 [ 20.272406] kasan_save_alloc_info+0x40/0x58 [ 20.272956] __kasan_kmalloc+0xd4/0xd8 [ 20.273448] __kmalloc_cache_noprof+0x154/0x320 [ 20.273953] kmalloc_uaf2+0xc4/0x478 [ 20.274361] kunit_try_run_case+0x170/0x3f0 [ 20.274834] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.275718] kthread+0x24c/0x2d0 [ 20.276099] ret_from_fork+0x10/0x20 [ 20.276583] [ 20.276881] Freed by task 175: [ 20.277169] kasan_save_stack+0x3c/0x68 [ 20.277723] kasan_save_track+0x20/0x40 [ 20.278176] kasan_save_free_info+0x4c/0x78 [ 20.278704] __kasan_slab_free+0x6c/0x98 [ 20.279136] kfree+0x110/0x3b8 [ 20.279870] kmalloc_uaf2+0x138/0x478 [ 20.280273] kunit_try_run_case+0x170/0x3f0 [ 20.280630] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.281074] kthread+0x24c/0x2d0 [ 20.281471] ret_from_fork+0x10/0x20 [ 20.281828] [ 20.282099] The buggy address belongs to the object at fff00000c5cc2980 [ 20.282099] which belongs to the cache kmalloc-64 of size 64 [ 20.283677] The buggy address is located 40 bytes inside of [ 20.283677] freed 64-byte region [fff00000c5cc2980, fff00000c5cc29c0) [ 20.284610] [ 20.284898] The buggy address belongs to the physical page: [ 20.285401] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105cc2 [ 20.286044] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 20.286664] page_type: f5(slab) [ 20.287028] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 20.287858] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000 [ 20.288511] page dumped because: kasan: bad access detected [ 20.289030] [ 20.289541] Memory state around the buggy address: [ 20.290079] fff00000c5cc2880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 20.290738] fff00000c5cc2900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 20.291634] >fff00000c5cc2980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 20.291990] ^ [ 20.292472] fff00000c5cc2a00: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 20.292997] fff00000c5cc2a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 20.293712] ==================================================================
[ 12.388614] ================================================================== [ 12.389091] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4aa/0x520 [ 12.389562] Read of size 1 at addr ffff88810261a7a8 by task kunit_try_catch/193 [ 12.389897] [ 12.390040] CPU: 0 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G B N 6.12.32-rc1 #1 [ 12.390137] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.390158] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.390193] Call Trace: [ 12.390238] <TASK> [ 12.390267] dump_stack_lvl+0x73/0xb0 [ 12.390330] print_report+0xd1/0x640 [ 12.390373] ? __virt_addr_valid+0x1db/0x2d0 [ 12.390429] ? kmalloc_uaf2+0x4aa/0x520 [ 12.390469] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.390528] ? kmalloc_uaf2+0x4aa/0x520 [ 12.390566] kasan_report+0x140/0x180 [ 12.390628] ? kmalloc_uaf2+0x4aa/0x520 [ 12.390687] __asan_report_load1_noabort+0x18/0x20 [ 12.390732] kmalloc_uaf2+0x4aa/0x520 [ 12.390776] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 12.390814] ? finish_task_switch.isra.0+0x153/0x700 [ 12.390857] ? __switch_to+0x5d9/0xf60 [ 12.390906] ? __schedule+0xc49/0x27a0 [ 12.390941] ? __pfx_read_tsc+0x10/0x10 [ 12.390969] ? ktime_get_ts64+0x84/0x230 [ 12.390994] kunit_try_run_case+0x1a6/0x480 [ 12.391016] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.391035] ? _raw_spin_lock_irqsave+0xa2/0x110 [ 12.391075] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.391123] ? __kthread_parkme+0x82/0x160 [ 12.391142] ? preempt_count_sub+0x50/0x80 [ 12.391163] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.391182] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.391206] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.391230] kthread+0x257/0x310 [ 12.391247] ? __pfx_kthread+0x10/0x10 [ 12.391265] ret_from_fork+0x41/0x80 [ 12.391284] ? __pfx_kthread+0x10/0x10 [ 12.391302] ret_from_fork_asm+0x1a/0x30 [ 12.391331] </TASK> [ 12.391342] [ 12.400208] Allocated by task 193: [ 12.400487] kasan_save_stack+0x45/0x70 [ 12.400775] kasan_save_track+0x18/0x40 [ 12.401131] kasan_save_alloc_info+0x3b/0x50 [ 12.401316] __kasan_kmalloc+0xb7/0xc0 [ 12.401484] __kmalloc_cache_noprof+0x168/0x350 [ 12.401674] kmalloc_uaf2+0xc7/0x520 [ 12.402177] kunit_try_run_case+0x1a6/0x480 [ 12.402523] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.402970] kthread+0x257/0x310 [ 12.403272] ret_from_fork+0x41/0x80 [ 12.403591] ret_from_fork_asm+0x1a/0x30 [ 12.403966] [ 12.404174] Freed by task 193: [ 12.404433] kasan_save_stack+0x45/0x70 [ 12.404742] kasan_save_track+0x18/0x40 [ 12.405076] kasan_save_free_info+0x3f/0x60 [ 12.405420] __kasan_slab_free+0x56/0x70 [ 12.405754] kfree+0x123/0x3d0 [ 12.406074] kmalloc_uaf2+0x14d/0x520 [ 12.406400] kunit_try_run_case+0x1a6/0x480 [ 12.406679] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.406994] kthread+0x257/0x310 [ 12.407293] ret_from_fork+0x41/0x80 [ 12.407484] ret_from_fork_asm+0x1a/0x30 [ 12.407668] [ 12.407770] The buggy address belongs to the object at ffff88810261a780 [ 12.407770] which belongs to the cache kmalloc-64 of size 64 [ 12.408210] The buggy address is located 40 bytes inside of [ 12.408210] freed 64-byte region [ffff88810261a780, ffff88810261a7c0) [ 12.409017] [ 12.409233] The buggy address belongs to the physical page: [ 12.409600] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10261a [ 12.410191] flags: 0x200000000000000(node=0|zone=2) [ 12.410489] page_type: f5(slab) [ 12.410649] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 12.410910] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000 [ 12.411180] page dumped because: kasan: bad access detected [ 12.411404] [ 12.411547] Memory state around the buggy address: [ 12.411965] ffff88810261a680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.412522] ffff88810261a700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.413017] >ffff88810261a780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.413490] ^ [ 12.413835] ffff88810261a800: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 12.414326] ffff88810261a880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.414823] ==================================================================