Date
June 23, 2025, 7:07 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 33.198926] ================================================================== [ 33.199115] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 33.199288] Read of size 1 at addr fff00000c570b7a8 by task kunit_try_catch/200 [ 33.199512] [ 33.199578] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc3-next-20250623 #1 PREEMPT [ 33.199770] Tainted: [B]=BAD_PAGE, [N]=TEST [ 33.199836] Hardware name: linux,dummy-virt (DT) [ 33.199908] Call trace: [ 33.199959] show_stack+0x20/0x38 (C) [ 33.200107] dump_stack_lvl+0x8c/0xd0 [ 33.200249] print_report+0x118/0x608 [ 33.200807] kasan_report+0xdc/0x128 [ 33.200941] __asan_report_load1_noabort+0x20/0x30 [ 33.201414] kmalloc_uaf2+0x3f4/0x468 [ 33.201543] kunit_try_run_case+0x170/0x3f0 [ 33.201662] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 33.202020] kthread+0x328/0x630 [ 33.202176] ret_from_fork+0x10/0x20 [ 33.202349] [ 33.202394] Allocated by task 200: [ 33.202533] kasan_save_stack+0x3c/0x68 [ 33.202802] kasan_save_track+0x20/0x40 [ 33.203258] kasan_save_alloc_info+0x40/0x58 [ 33.203363] __kasan_kmalloc+0xd4/0xd8 [ 33.203745] __kmalloc_cache_noprof+0x16c/0x3c0 [ 33.203884] kmalloc_uaf2+0xc4/0x468 [ 33.204348] kunit_try_run_case+0x170/0x3f0 [ 33.204440] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 33.204544] kthread+0x328/0x630 [ 33.205903] ret_from_fork+0x10/0x20 [ 33.206072] [ 33.206119] Freed by task 200: [ 33.206227] kasan_save_stack+0x3c/0x68 [ 33.206341] kasan_save_track+0x20/0x40 [ 33.206568] kasan_save_free_info+0x4c/0x78 [ 33.206663] __kasan_slab_free+0x6c/0x98 [ 33.206785] kfree+0x214/0x3c8 [ 33.207454] kmalloc_uaf2+0x134/0x468 [ 33.207633] kunit_try_run_case+0x170/0x3f0 [ 33.207731] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 33.207851] kthread+0x328/0x630 [ 33.207937] ret_from_fork+0x10/0x20 [ 33.208049] [ 33.209713] The buggy address belongs to the object at fff00000c570b780 [ 33.209713] which belongs to the cache kmalloc-64 of size 64 [ 33.209921] The buggy address is located 40 bytes inside of [ 33.209921] freed 64-byte region [fff00000c570b780, fff00000c570b7c0) [ 33.210944] [ 33.211024] The buggy address belongs to the physical page: [ 33.211282] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10570b [ 33.212171] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 33.212309] page_type: f5(slab) [ 33.212487] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 33.212684] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 33.212814] page dumped because: kasan: bad access detected [ 33.212900] [ 33.212954] Memory state around the buggy address: [ 33.213050] fff00000c570b680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 33.213212] fff00000c570b700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 33.213659] >fff00000c570b780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 33.214107] ^ [ 33.214196] fff00000c570b800: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 33.214662] fff00000c570b880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 33.215401] ==================================================================
[ 22.104829] ================================================================== [ 22.105300] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 22.105554] Read of size 1 at addr ffff8881023b5ca8 by task kunit_try_catch/217 [ 22.105952] [ 22.106081] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc3-next-20250623 #1 PREEMPT(voluntary) [ 22.106164] Tainted: [B]=BAD_PAGE, [N]=TEST [ 22.106190] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 22.106225] Call Trace: [ 22.106360] <TASK> [ 22.106411] dump_stack_lvl+0x73/0xb0 [ 22.106471] print_report+0xd1/0x650 [ 22.106507] ? __virt_addr_valid+0x1db/0x2d0 [ 22.106542] ? kmalloc_uaf2+0x4a8/0x520 [ 22.106574] ? kasan_complete_mode_report_info+0x64/0x200 [ 22.106613] ? kmalloc_uaf2+0x4a8/0x520 [ 22.106648] kasan_report+0x141/0x180 [ 22.106686] ? kmalloc_uaf2+0x4a8/0x520 [ 22.106728] __asan_report_load1_noabort+0x18/0x20 [ 22.106769] kmalloc_uaf2+0x4a8/0x520 [ 22.106807] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 22.106841] ? finish_task_switch.isra.0+0x153/0x700 [ 22.106881] ? __switch_to+0x47/0xf50 [ 22.106925] ? __schedule+0x10cc/0x2b60 [ 22.106957] ? __pfx_read_tsc+0x10/0x10 [ 22.106990] ? ktime_get_ts64+0x86/0x230 [ 22.107028] kunit_try_run_case+0x1a5/0x480 [ 22.107070] ? __pfx_kunit_try_run_case+0x10/0x10 [ 22.107113] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 22.107148] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 22.107182] ? __kthread_parkme+0x82/0x180 [ 22.107216] ? preempt_count_sub+0x50/0x80 [ 22.107254] ? __pfx_kunit_try_run_case+0x10/0x10 [ 22.107290] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 22.107323] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 22.107358] kthread+0x337/0x6f0 [ 22.107404] ? trace_preempt_on+0x20/0xc0 [ 22.107445] ? __pfx_kthread+0x10/0x10 [ 22.107481] ? _raw_spin_unlock_irq+0x47/0x80 [ 22.107517] ? calculate_sigpending+0x7b/0xa0 [ 22.107558] ? __pfx_kthread+0x10/0x10 [ 22.107584] ret_from_fork+0x116/0x1d0 [ 22.107600] ? __pfx_kthread+0x10/0x10 [ 22.107618] ret_from_fork_asm+0x1a/0x30 [ 22.107645] </TASK> [ 22.107656] [ 22.115862] Allocated by task 217: [ 22.116012] kasan_save_stack+0x45/0x70 [ 22.116169] kasan_save_track+0x18/0x40 [ 22.116312] kasan_save_alloc_info+0x3b/0x50 [ 22.117045] __kasan_kmalloc+0xb7/0xc0 [ 22.117487] __kmalloc_cache_noprof+0x189/0x420 [ 22.117820] kmalloc_uaf2+0xc6/0x520 [ 22.118096] kunit_try_run_case+0x1a5/0x480 [ 22.118409] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 22.118773] kthread+0x337/0x6f0 [ 22.119072] ret_from_fork+0x116/0x1d0 [ 22.119338] ret_from_fork_asm+0x1a/0x30 [ 22.119637] [ 22.119760] Freed by task 217: [ 22.120058] kasan_save_stack+0x45/0x70 [ 22.120339] kasan_save_track+0x18/0x40 [ 22.120497] kasan_save_free_info+0x3f/0x60 [ 22.120653] __kasan_slab_free+0x56/0x70 [ 22.120929] kfree+0x222/0x3f0 [ 22.121139] kmalloc_uaf2+0x14c/0x520 [ 22.121408] kunit_try_run_case+0x1a5/0x480 [ 22.121679] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 22.122148] kthread+0x337/0x6f0 [ 22.122361] ret_from_fork+0x116/0x1d0 [ 22.122628] ret_from_fork_asm+0x1a/0x30 [ 22.122948] [ 22.123053] The buggy address belongs to the object at ffff8881023b5c80 [ 22.123053] which belongs to the cache kmalloc-64 of size 64 [ 22.123371] The buggy address is located 40 bytes inside of [ 22.123371] freed 64-byte region [ffff8881023b5c80, ffff8881023b5cc0) [ 22.123710] [ 22.123797] The buggy address belongs to the physical page: [ 22.123965] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1023b5 [ 22.124200] flags: 0x200000000000000(node=0|zone=2) [ 22.124373] page_type: f5(slab) [ 22.124619] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 22.125238] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 22.125727] page dumped because: kasan: bad access detected [ 22.126306] [ 22.126479] Memory state around the buggy address: [ 22.126847] ffff8881023b5b80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 22.127472] ffff8881023b5c00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 22.127787] >ffff8881023b5c80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 22.128687] ^ [ 22.129857] ffff8881023b5d00: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 22.131051] ffff8881023b5d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 22.131352] ==================================================================