Date
July 24, 2025, 4:41 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 32.678365] ================================================================== [ 32.678837] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 32.678919] Read of size 1 at addr fff00000c9a87e28 by task kunit_try_catch/219 [ 32.679077] [ 32.679164] CPU: 0 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc7-next-20250724 #1 PREEMPT [ 32.679323] Tainted: [B]=BAD_PAGE, [N]=TEST [ 32.679356] Hardware name: linux,dummy-virt (DT) [ 32.679410] Call trace: [ 32.679439] show_stack+0x20/0x38 (C) [ 32.679790] dump_stack_lvl+0x8c/0xd0 [ 32.679975] print_report+0x118/0x5e8 [ 32.680065] kasan_report+0xdc/0x128 [ 32.680213] __asan_report_load1_noabort+0x20/0x30 [ 32.680293] kmalloc_uaf2+0x3f4/0x468 [ 32.680409] kunit_try_run_case+0x170/0x3f0 [ 32.680607] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 32.680942] kthread+0x328/0x630 [ 32.681100] ret_from_fork+0x10/0x20 [ 32.681254] [ 32.681314] Allocated by task 219: [ 32.681386] kasan_save_stack+0x3c/0x68 [ 32.681638] kasan_save_track+0x20/0x40 [ 32.681830] kasan_save_alloc_info+0x40/0x58 [ 32.681993] __kasan_kmalloc+0xd4/0xd8 [ 32.682071] __kmalloc_cache_noprof+0x16c/0x3c0 [ 32.682218] kmalloc_uaf2+0xc4/0x468 [ 32.682374] kunit_try_run_case+0x170/0x3f0 [ 32.682416] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 32.682495] kthread+0x328/0x630 [ 32.683021] ret_from_fork+0x10/0x20 [ 32.683104] [ 32.683164] Freed by task 219: [ 32.683211] kasan_save_stack+0x3c/0x68 [ 32.683363] kasan_save_track+0x20/0x40 [ 32.683408] kasan_save_free_info+0x4c/0x78 [ 32.683446] __kasan_slab_free+0x6c/0x98 [ 32.683491] kfree+0x214/0x3c8 [ 32.683526] kmalloc_uaf2+0x134/0x468 [ 32.683693] kunit_try_run_case+0x170/0x3f0 [ 32.683760] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 32.683973] kthread+0x328/0x630 [ 32.684031] ret_from_fork+0x10/0x20 [ 32.684067] [ 32.684088] The buggy address belongs to the object at fff00000c9a87e00 [ 32.684088] which belongs to the cache kmalloc-64 of size 64 [ 32.684150] The buggy address is located 40 bytes inside of [ 32.684150] freed 64-byte region [fff00000c9a87e00, fff00000c9a87e40) [ 32.684213] [ 32.684235] The buggy address belongs to the physical page: [ 32.684273] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a87 [ 32.684336] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 32.684394] page_type: f5(slab) [ 32.684449] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 32.684511] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 32.684553] page dumped because: kasan: bad access detected [ 32.684585] [ 32.684603] Memory state around the buggy address: [ 32.684649] fff00000c9a87d00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 32.684695] fff00000c9a87d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 32.684796] >fff00000c9a87e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 32.685447] ^ [ 32.685517] fff00000c9a87e80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 32.685573] fff00000c9a87f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 32.685629] ==================================================================
[ 27.150958] ================================================================== [ 27.152170] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 27.152756] Read of size 1 at addr ffff8881054640a8 by task kunit_try_catch/236 [ 27.152996] [ 27.153087] CPU: 0 UID: 0 PID: 236 Comm: kunit_try_catch Tainted: G B W N 6.16.0-rc7-next-20250724 #1 PREEMPT(voluntary) [ 27.153143] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST [ 27.153157] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 27.153180] Call Trace: [ 27.153193] <TASK> [ 27.153214] dump_stack_lvl+0x73/0xb0 [ 27.153246] print_report+0xd1/0x640 [ 27.153269] ? __virt_addr_valid+0x1db/0x2d0 [ 27.153293] ? kmalloc_uaf2+0x4a8/0x520 [ 27.153313] ? kasan_complete_mode_report_info+0x64/0x200 [ 27.153339] ? kmalloc_uaf2+0x4a8/0x520 [ 27.153360] kasan_report+0x141/0x180 [ 27.153382] ? kmalloc_uaf2+0x4a8/0x520 [ 27.153408] __asan_report_load1_noabort+0x18/0x20 [ 27.153432] kmalloc_uaf2+0x4a8/0x520 [ 27.153452] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 27.153471] ? finish_task_switch.isra.0+0x153/0x700 [ 27.153492] ? __switch_to+0x47/0xf80 [ 27.153520] ? __schedule+0x10da/0x2b60 [ 27.153545] ? __pfx_read_tsc+0x10/0x10 [ 27.153566] ? ktime_get_ts64+0x86/0x230 [ 27.153602] kunit_try_run_case+0x1a5/0x480 [ 27.153630] ? __pfx_kunit_try_run_case+0x10/0x10 [ 27.153654] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 27.153679] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 27.153703] ? __kthread_parkme+0x82/0x180 [ 27.153724] ? preempt_count_sub+0x50/0x80 [ 27.153747] ? __pfx_kunit_try_run_case+0x10/0x10 [ 27.153770] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 27.153793] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 27.153816] kthread+0x337/0x6f0 [ 27.153838] ? trace_preempt_on+0x20/0xc0 [ 27.153862] ? __pfx_kthread+0x10/0x10 [ 27.153882] ? _raw_spin_unlock_irq+0x47/0x80 [ 27.153905] ? calculate_sigpending+0x7b/0xa0 [ 27.153928] ? __pfx_kthread+0x10/0x10 [ 27.153949] ret_from_fork+0x116/0x1d0 [ 27.153968] ? __pfx_kthread+0x10/0x10 [ 27.153988] ret_from_fork_asm+0x1a/0x30 [ 27.154019] </TASK> [ 27.154030] [ 27.168198] Allocated by task 236: [ 27.168611] kasan_save_stack+0x45/0x70 [ 27.169142] kasan_save_track+0x18/0x40 [ 27.169619] kasan_save_alloc_info+0x3b/0x50 [ 27.170184] __kasan_kmalloc+0xb7/0xc0 [ 27.170608] __kmalloc_cache_noprof+0x189/0x420 [ 27.171157] kmalloc_uaf2+0xc6/0x520 [ 27.171569] kunit_try_run_case+0x1a5/0x480 [ 27.172067] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 27.172641] kthread+0x337/0x6f0 [ 27.173044] ret_from_fork+0x116/0x1d0 [ 27.173457] ret_from_fork_asm+0x1a/0x30 [ 27.173889] [ 27.174137] Freed by task 236: [ 27.174442] kasan_save_stack+0x45/0x70 [ 27.174589] kasan_save_track+0x18/0x40 [ 27.174717] kasan_save_free_info+0x3f/0x60 [ 27.174864] __kasan_slab_free+0x56/0x70 [ 27.174996] kfree+0x222/0x3f0 [ 27.175108] kmalloc_uaf2+0x14c/0x520 [ 27.175232] kunit_try_run_case+0x1a5/0x480 [ 27.175382] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 27.175548] kthread+0x337/0x6f0 [ 27.175670] ret_from_fork+0x116/0x1d0 [ 27.175796] ret_from_fork_asm+0x1a/0x30 [ 27.175932] [ 27.175997] The buggy address belongs to the object at ffff888105464080 [ 27.175997] which belongs to the cache kmalloc-64 of size 64 [ 27.176343] The buggy address is located 40 bytes inside of [ 27.176343] freed 64-byte region [ffff888105464080, ffff8881054640c0) [ 27.177749] [ 27.177922] The buggy address belongs to the physical page: [ 27.178497] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105464 [ 27.179410] flags: 0x200000000000000(node=0|zone=2) [ 27.179918] page_type: f5(slab) [ 27.180217] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 27.181031] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 27.181696] page dumped because: kasan: bad access detected [ 27.182399] [ 27.182591] Memory state around the buggy address: [ 27.183067] ffff888105463f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 27.183817] ffff888105464000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 27.184558] >ffff888105464080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 27.185369] ^ [ 27.185795] ffff888105464100: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 27.186608] ffff888105464180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 27.187292] ==================================================================