Date
July 5, 2025, 5:09 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.434321] ================================================================== [ 18.434436] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 18.434628] Read of size 1 at addr fff00000c7818b28 by task kunit_try_catch/188 [ 18.434677] [ 18.434709] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 18.434797] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.434830] Hardware name: linux,dummy-virt (DT) [ 18.434870] Call trace: [ 18.434893] show_stack+0x20/0x38 (C) [ 18.434939] dump_stack_lvl+0x8c/0xd0 [ 18.434986] print_report+0x118/0x608 [ 18.435031] kasan_report+0xdc/0x128 [ 18.435076] __asan_report_load1_noabort+0x20/0x30 [ 18.435127] kmalloc_uaf2+0x3f4/0x468 [ 18.435170] kunit_try_run_case+0x170/0x3f0 [ 18.435217] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.435269] kthread+0x328/0x630 [ 18.435312] ret_from_fork+0x10/0x20 [ 18.435358] [ 18.435377] Allocated by task 188: [ 18.435541] kasan_save_stack+0x3c/0x68 [ 18.435614] kasan_save_track+0x20/0x40 [ 18.435712] kasan_save_alloc_info+0x40/0x58 [ 18.435754] __kasan_kmalloc+0xd4/0xd8 [ 18.435789] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.435829] kmalloc_uaf2+0xc4/0x468 [ 18.435873] kunit_try_run_case+0x170/0x3f0 [ 18.435920] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.435963] kthread+0x328/0x630 [ 18.435994] ret_from_fork+0x10/0x20 [ 18.436030] [ 18.436048] Freed by task 188: [ 18.436075] kasan_save_stack+0x3c/0x68 [ 18.436111] kasan_save_track+0x20/0x40 [ 18.436147] kasan_save_free_info+0x4c/0x78 [ 18.436295] __kasan_slab_free+0x6c/0x98 [ 18.436333] kfree+0x214/0x3c8 [ 18.436460] kmalloc_uaf2+0x134/0x468 [ 18.436505] kunit_try_run_case+0x170/0x3f0 [ 18.436550] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.436633] kthread+0x328/0x630 [ 18.436783] ret_from_fork+0x10/0x20 [ 18.436857] [ 18.436908] The buggy address belongs to the object at fff00000c7818b00 [ 18.436908] which belongs to the cache kmalloc-64 of size 64 [ 18.436998] The buggy address is located 40 bytes inside of [ 18.436998] freed 64-byte region [fff00000c7818b00, fff00000c7818b40) [ 18.437091] [ 18.437110] The buggy address belongs to the physical page: [ 18.437145] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107818 [ 18.437383] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.437430] page_type: f5(slab) [ 18.437466] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 18.437515] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 18.437555] page dumped because: kasan: bad access detected [ 18.437611] [ 18.437667] Memory state around the buggy address: [ 18.437717] fff00000c7818a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.437857] fff00000c7818a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.437908] >fff00000c7818b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.437965] ^ [ 18.438113] fff00000c7818b80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 18.438189] fff00000c7818c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.438339] ==================================================================
[ 11.913674] ================================================================== [ 11.914136] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 11.914656] Read of size 1 at addr ffff8881031aac28 by task kunit_try_catch/206 [ 11.915098] [ 11.915210] CPU: 0 UID: 0 PID: 206 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 11.915255] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.915267] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.915287] Call Trace: [ 11.915300] <TASK> [ 11.915315] dump_stack_lvl+0x73/0xb0 [ 11.915345] print_report+0xd1/0x650 [ 11.915367] ? __virt_addr_valid+0x1db/0x2d0 [ 11.915388] ? kmalloc_uaf2+0x4a8/0x520 [ 11.915407] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.915428] ? kmalloc_uaf2+0x4a8/0x520 [ 11.915447] kasan_report+0x141/0x180 [ 11.915482] ? kmalloc_uaf2+0x4a8/0x520 [ 11.915506] __asan_report_load1_noabort+0x18/0x20 [ 11.915529] kmalloc_uaf2+0x4a8/0x520 [ 11.915549] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 11.915567] ? finish_task_switch.isra.0+0x153/0x700 [ 11.915588] ? __switch_to+0x47/0xf50 [ 11.915694] ? __schedule+0x10cc/0x2b60 [ 11.915718] ? __pfx_read_tsc+0x10/0x10 [ 11.915737] ? ktime_get_ts64+0x86/0x230 [ 11.915759] kunit_try_run_case+0x1a5/0x480 [ 11.915783] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.915805] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.915827] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.915852] ? __kthread_parkme+0x82/0x180 [ 11.915875] ? preempt_count_sub+0x50/0x80 [ 11.915898] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.915921] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.915942] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.915964] kthread+0x337/0x6f0 [ 11.915982] ? trace_preempt_on+0x20/0xc0 [ 11.916004] ? __pfx_kthread+0x10/0x10 [ 11.916023] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.916044] ? calculate_sigpending+0x7b/0xa0 [ 11.916066] ? __pfx_kthread+0x10/0x10 [ 11.916086] ret_from_fork+0x116/0x1d0 [ 11.916103] ? __pfx_kthread+0x10/0x10 [ 11.916123] ret_from_fork_asm+0x1a/0x30 [ 11.916152] </TASK> [ 11.916163] [ 11.924049] Allocated by task 206: [ 11.924179] kasan_save_stack+0x45/0x70 [ 11.924382] kasan_save_track+0x18/0x40 [ 11.924592] kasan_save_alloc_info+0x3b/0x50 [ 11.925044] __kasan_kmalloc+0xb7/0xc0 [ 11.925247] __kmalloc_cache_noprof+0x189/0x420 [ 11.925473] kmalloc_uaf2+0xc6/0x520 [ 11.925603] kunit_try_run_case+0x1a5/0x480 [ 11.925782] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.926059] kthread+0x337/0x6f0 [ 11.926384] ret_from_fork+0x116/0x1d0 [ 11.926574] ret_from_fork_asm+0x1a/0x30 [ 11.926859] [ 11.926943] Freed by task 206: [ 11.927066] kasan_save_stack+0x45/0x70 [ 11.927259] kasan_save_track+0x18/0x40 [ 11.927424] kasan_save_free_info+0x3f/0x60 [ 11.927795] __kasan_slab_free+0x56/0x70 [ 11.928018] kfree+0x222/0x3f0 [ 11.928149] kmalloc_uaf2+0x14c/0x520 [ 11.928278] kunit_try_run_case+0x1a5/0x480 [ 11.928419] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.928641] kthread+0x337/0x6f0 [ 11.928805] ret_from_fork+0x116/0x1d0 [ 11.928990] ret_from_fork_asm+0x1a/0x30 [ 11.929409] [ 11.929522] The buggy address belongs to the object at ffff8881031aac00 [ 11.929522] which belongs to the cache kmalloc-64 of size 64 [ 11.930029] The buggy address is located 40 bytes inside of [ 11.930029] freed 64-byte region [ffff8881031aac00, ffff8881031aac40) [ 11.930662] [ 11.930854] The buggy address belongs to the physical page: [ 11.931072] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1031aa [ 11.931308] flags: 0x200000000000000(node=0|zone=2) [ 11.931525] page_type: f5(slab) [ 11.931810] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 11.932146] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 11.932464] page dumped because: kasan: bad access detected [ 11.932634] [ 11.932799] Memory state around the buggy address: [ 11.933293] ffff8881031aab00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.933655] ffff8881031aab80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.933962] >ffff8881031aac00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.934356] ^ [ 11.934531] ffff8881031aac80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 11.934870] ffff8881031aad00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.935177] ==================================================================