Date
July 5, 2025, 11:11 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.162707] ================================================================== [ 18.162902] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310 [ 18.162967] Write of size 33 at addr fff00000c65bef00 by task kunit_try_catch/186 [ 18.163025] [ 18.163261] CPU: 0 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 18.163645] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.163698] Hardware name: linux,dummy-virt (DT) [ 18.163741] Call trace: [ 18.163766] show_stack+0x20/0x38 (C) [ 18.163890] dump_stack_lvl+0x8c/0xd0 [ 18.164105] print_report+0x118/0x608 [ 18.164289] kasan_report+0xdc/0x128 [ 18.164336] kasan_check_range+0x100/0x1a8 [ 18.164385] __asan_memset+0x34/0x78 [ 18.164425] kmalloc_uaf_memset+0x170/0x310 [ 18.164471] kunit_try_run_case+0x170/0x3f0 [ 18.164845] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.165044] kthread+0x328/0x630 [ 18.165230] ret_from_fork+0x10/0x20 [ 18.165402] [ 18.165422] Allocated by task 186: [ 18.165698] kasan_save_stack+0x3c/0x68 [ 18.165840] kasan_save_track+0x20/0x40 [ 18.166015] kasan_save_alloc_info+0x40/0x58 [ 18.166097] __kasan_kmalloc+0xd4/0xd8 [ 18.166210] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.166332] kmalloc_uaf_memset+0xb8/0x310 [ 18.166389] kunit_try_run_case+0x170/0x3f0 [ 18.166578] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.166630] kthread+0x328/0x630 [ 18.166664] ret_from_fork+0x10/0x20 [ 18.166699] [ 18.166720] Freed by task 186: [ 18.166759] kasan_save_stack+0x3c/0x68 [ 18.166806] kasan_save_track+0x20/0x40 [ 18.166843] kasan_save_free_info+0x4c/0x78 [ 18.166891] __kasan_slab_free+0x6c/0x98 [ 18.166942] kfree+0x214/0x3c8 [ 18.166979] kmalloc_uaf_memset+0x11c/0x310 [ 18.167014] kunit_try_run_case+0x170/0x3f0 [ 18.167052] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.167095] kthread+0x328/0x630 [ 18.167134] ret_from_fork+0x10/0x20 [ 18.167182] [ 18.167199] The buggy address belongs to the object at fff00000c65bef00 [ 18.167199] which belongs to the cache kmalloc-64 of size 64 [ 18.167255] The buggy address is located 0 bytes inside of [ 18.167255] freed 64-byte region [fff00000c65bef00, fff00000c65bef40) [ 18.167314] [ 18.167348] The buggy address belongs to the physical page: [ 18.167378] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1065be [ 18.167432] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.167478] page_type: f5(slab) [ 18.167536] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 18.167602] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 18.167645] page dumped because: kasan: bad access detected [ 18.167676] [ 18.167695] Memory state around the buggy address: [ 18.167734] fff00000c65bee00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.167777] fff00000c65bee80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.167829] >fff00000c65bef00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.167866] ^ [ 18.167974] fff00000c65bef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.168445] fff00000c65bf000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.168529] ==================================================================
[ 13.877660] ================================================================== [ 13.878258] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360 [ 13.878809] Write of size 33 at addr ffff88810391d500 by task kunit_try_catch/204 [ 13.879323] [ 13.879454] CPU: 0 UID: 0 PID: 204 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 13.879509] Tainted: [B]=BAD_PAGE, [N]=TEST [ 13.879561] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 13.879587] Call Trace: [ 13.879601] <TASK> [ 13.879621] dump_stack_lvl+0x73/0xb0 [ 13.879673] print_report+0xd1/0x650 [ 13.879700] ? __virt_addr_valid+0x1db/0x2d0 [ 13.879757] ? kmalloc_uaf_memset+0x1a3/0x360 [ 13.879781] ? kasan_complete_mode_report_info+0x64/0x200 [ 13.879824] ? kmalloc_uaf_memset+0x1a3/0x360 [ 13.879867] kasan_report+0x141/0x180 [ 13.879892] ? kmalloc_uaf_memset+0x1a3/0x360 [ 13.879937] kasan_check_range+0x10c/0x1c0 [ 13.879964] __asan_memset+0x27/0x50 [ 13.879985] kmalloc_uaf_memset+0x1a3/0x360 [ 13.880019] ? __pfx_kmalloc_uaf_memset+0x10/0x10 [ 13.880044] ? __schedule+0x10cc/0x2b60 [ 13.880070] ? __pfx_read_tsc+0x10/0x10 [ 13.880106] ? ktime_get_ts64+0x86/0x230 [ 13.880133] kunit_try_run_case+0x1a5/0x480 [ 13.880226] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.880253] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 13.880280] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 13.880306] ? __kthread_parkme+0x82/0x180 [ 13.880330] ? preempt_count_sub+0x50/0x80 [ 13.880358] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.880384] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.880409] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 13.880435] kthread+0x337/0x6f0 [ 13.880456] ? trace_preempt_on+0x20/0xc0 [ 13.880483] ? __pfx_kthread+0x10/0x10 [ 13.880506] ? _raw_spin_unlock_irq+0x47/0x80 [ 13.880530] ? calculate_sigpending+0x7b/0xa0 [ 13.880557] ? __pfx_kthread+0x10/0x10 [ 13.880580] ret_from_fork+0x116/0x1d0 [ 13.880603] ? __pfx_kthread+0x10/0x10 [ 13.880626] ret_from_fork_asm+0x1a/0x30 [ 13.880661] </TASK> [ 13.880676] [ 13.892946] Allocated by task 204: [ 13.893135] kasan_save_stack+0x45/0x70 [ 13.893309] kasan_save_track+0x18/0x40 [ 13.893528] kasan_save_alloc_info+0x3b/0x50 [ 13.893777] __kasan_kmalloc+0xb7/0xc0 [ 13.894055] __kmalloc_cache_noprof+0x189/0x420 [ 13.894574] kmalloc_uaf_memset+0xa9/0x360 [ 13.894759] kunit_try_run_case+0x1a5/0x480 [ 13.894972] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.895560] kthread+0x337/0x6f0 [ 13.895777] ret_from_fork+0x116/0x1d0 [ 13.896021] ret_from_fork_asm+0x1a/0x30 [ 13.896286] [ 13.896375] Freed by task 204: [ 13.896506] kasan_save_stack+0x45/0x70 [ 13.896735] kasan_save_track+0x18/0x40 [ 13.896972] kasan_save_free_info+0x3f/0x60 [ 13.897255] __kasan_slab_free+0x56/0x70 [ 13.897442] kfree+0x222/0x3f0 [ 13.897580] kmalloc_uaf_memset+0x12b/0x360 [ 13.897783] kunit_try_run_case+0x1a5/0x480 [ 13.898035] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.898539] kthread+0x337/0x6f0 [ 13.898718] ret_from_fork+0x116/0x1d0 [ 13.898961] ret_from_fork_asm+0x1a/0x30 [ 13.899146] [ 13.899260] The buggy address belongs to the object at ffff88810391d500 [ 13.899260] which belongs to the cache kmalloc-64 of size 64 [ 13.899926] The buggy address is located 0 bytes inside of [ 13.899926] freed 64-byte region [ffff88810391d500, ffff88810391d540) [ 13.900496] [ 13.900613] The buggy address belongs to the physical page: [ 13.900927] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10391d [ 13.901524] flags: 0x200000000000000(node=0|zone=2) [ 13.901807] page_type: f5(slab) [ 13.901965] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 13.902354] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 13.902620] page dumped because: kasan: bad access detected [ 13.903239] [ 13.903539] Memory state around the buggy address: [ 13.903778] ffff88810391d400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 13.904212] ffff88810391d480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 13.904544] >ffff88810391d500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 13.904808] ^ [ 13.904950] ffff88810391d580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 13.905324] ffff88810391d600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 13.905747] ==================================================================