Date
June 23, 2025, 1:39 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 24.966653] ================================================================== [ 24.966956] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 24.967110] Read of size 1 at addr fff00000c76ce8a8 by task kunit_try_catch/190 [ 24.967762] [ 24.967973] CPU: 0 UID: 0 PID: 190 Comm: kunit_try_catch Tainted: G B N 6.15.4-rc1 #1 PREEMPT [ 24.968508] Tainted: [B]=BAD_PAGE, [N]=TEST [ 24.968871] Hardware name: linux,dummy-virt (DT) [ 24.968954] Call trace: [ 24.969073] show_stack+0x20/0x38 (C) [ 24.969207] dump_stack_lvl+0x8c/0xd0 [ 24.969326] print_report+0x118/0x608 [ 24.969549] kasan_report+0xdc/0x128 [ 24.969860] __asan_report_load1_noabort+0x20/0x30 [ 24.970007] kmalloc_uaf2+0x3f4/0x468 [ 24.970300] kunit_try_run_case+0x170/0x3f0 [ 24.970737] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 24.971060] kthread+0x328/0x630 [ 24.971203] ret_from_fork+0x10/0x20 [ 24.971627] [ 24.972026] Allocated by task 190: [ 24.972113] kasan_save_stack+0x3c/0x68 [ 24.972286] kasan_save_track+0x20/0x40 [ 24.972451] kasan_save_alloc_info+0x40/0x58 [ 24.972610] __kasan_kmalloc+0xd4/0xd8 [ 24.972725] __kmalloc_cache_noprof+0x16c/0x3c0 [ 24.972820] kmalloc_uaf2+0xc4/0x468 [ 24.972907] kunit_try_run_case+0x170/0x3f0 [ 24.973042] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 24.973239] kthread+0x328/0x630 [ 24.973332] ret_from_fork+0x10/0x20 [ 24.973510] [ 24.973606] Freed by task 190: [ 24.973786] kasan_save_stack+0x3c/0x68 [ 24.973877] kasan_save_track+0x20/0x40 [ 24.974029] kasan_save_free_info+0x4c/0x78 [ 24.974195] __kasan_slab_free+0x6c/0x98 [ 24.974339] kfree+0x214/0x3c8 [ 24.974445] kmalloc_uaf2+0x134/0x468 [ 24.974568] kunit_try_run_case+0x170/0x3f0 [ 24.974679] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 24.974797] kthread+0x328/0x630 [ 24.974886] ret_from_fork+0x10/0x20 [ 24.975066] [ 24.975207] The buggy address belongs to the object at fff00000c76ce880 [ 24.975207] which belongs to the cache kmalloc-64 of size 64 [ 24.975375] The buggy address is located 40 bytes inside of [ 24.975375] freed 64-byte region [fff00000c76ce880, fff00000c76ce8c0) [ 24.975551] [ 24.975607] The buggy address belongs to the physical page: [ 24.975685] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076ce [ 24.975922] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 24.976116] page_type: f5(slab) [ 24.976215] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 24.976336] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 24.976448] page dumped because: kasan: bad access detected [ 24.976561] [ 24.976619] Memory state around the buggy address: [ 24.976770] fff00000c76ce780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 24.976910] fff00000c76ce800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 24.977018] >fff00000c76ce880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 24.977098] ^ [ 24.977185] fff00000c76ce900: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 24.977349] fff00000c76ce980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 24.977460] ==================================================================
[ 17.716499] ================================================================== [ 17.717502] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 17.718160] Read of size 1 at addr ffff888102a167a8 by task kunit_try_catch/209 [ 17.719335] [ 17.719559] CPU: 0 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G B N 6.15.4-rc1 #1 PREEMPT(voluntary) [ 17.719776] Tainted: [B]=BAD_PAGE, [N]=TEST [ 17.719865] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 17.719948] Call Trace: [ 17.719991] <TASK> [ 17.720036] dump_stack_lvl+0x73/0xb0 [ 17.720110] print_report+0xd1/0x650 [ 17.720186] ? __virt_addr_valid+0x1db/0x2d0 [ 17.720378] ? kmalloc_uaf2+0x4a8/0x520 [ 17.720483] ? kasan_complete_mode_report_info+0x64/0x200 [ 17.720546] ? kmalloc_uaf2+0x4a8/0x520 [ 17.720580] kasan_report+0x141/0x180 [ 17.720646] ? kmalloc_uaf2+0x4a8/0x520 [ 17.720728] __asan_report_load1_noabort+0x18/0x20 [ 17.720823] kmalloc_uaf2+0x4a8/0x520 [ 17.720924] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 17.720989] ? finish_task_switch.isra.0+0x153/0x700 [ 17.721041] ? __switch_to+0x5d9/0xf60 [ 17.721071] ? dequeue_task_fair+0x156/0x4e0 [ 17.721106] ? __schedule+0x10cc/0x2b60 [ 17.721139] ? __pfx_read_tsc+0x10/0x10 [ 17.721166] ? ktime_get_ts64+0x86/0x230 [ 17.721200] kunit_try_run_case+0x1a5/0x480 [ 17.721278] ? __pfx_kunit_try_run_case+0x10/0x10 [ 17.721317] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 17.721353] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 17.721386] ? __kthread_parkme+0x82/0x180 [ 17.721416] ? preempt_count_sub+0x50/0x80 [ 17.721450] ? __pfx_kunit_try_run_case+0x10/0x10 [ 17.721483] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 17.721515] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 17.721548] kthread+0x337/0x6f0 [ 17.721570] ? trace_preempt_on+0x20/0xc0 [ 17.721625] ? __pfx_kthread+0x10/0x10 [ 17.721653] ? _raw_spin_unlock_irq+0x47/0x80 [ 17.721683] ? calculate_sigpending+0x7b/0xa0 [ 17.721712] ? __pfx_kthread+0x10/0x10 [ 17.721735] ret_from_fork+0x41/0x80 [ 17.721774] ? __pfx_kthread+0x10/0x10 [ 17.721799] ret_from_fork_asm+0x1a/0x30 [ 17.721840] </TASK> [ 17.721855] [ 17.738703] Allocated by task 209: [ 17.739080] kasan_save_stack+0x45/0x70 [ 17.739573] kasan_save_track+0x18/0x40 [ 17.739940] kasan_save_alloc_info+0x3b/0x50 [ 17.740429] __kasan_kmalloc+0xb7/0xc0 [ 17.740770] __kmalloc_cache_noprof+0x189/0x420 [ 17.741239] kmalloc_uaf2+0xc6/0x520 [ 17.741645] kunit_try_run_case+0x1a5/0x480 [ 17.742049] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 17.742469] kthread+0x337/0x6f0 [ 17.742768] ret_from_fork+0x41/0x80 [ 17.743166] ret_from_fork_asm+0x1a/0x30 [ 17.743592] [ 17.743872] Freed by task 209: [ 17.744258] kasan_save_stack+0x45/0x70 [ 17.744684] kasan_save_track+0x18/0x40 [ 17.745102] kasan_save_free_info+0x3f/0x60 [ 17.745493] __kasan_slab_free+0x56/0x70 [ 17.745913] kfree+0x222/0x3f0 [ 17.746296] kmalloc_uaf2+0x14c/0x520 [ 17.746721] kunit_try_run_case+0x1a5/0x480 [ 17.747136] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 17.747629] kthread+0x337/0x6f0 [ 17.747986] ret_from_fork+0x41/0x80 [ 17.748363] ret_from_fork_asm+0x1a/0x30 [ 17.748710] [ 17.748939] The buggy address belongs to the object at ffff888102a16780 [ 17.748939] which belongs to the cache kmalloc-64 of size 64 [ 17.749875] The buggy address is located 40 bytes inside of [ 17.749875] freed 64-byte region [ffff888102a16780, ffff888102a167c0) [ 17.750766] [ 17.750999] The buggy address belongs to the physical page: [ 17.751539] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a16 [ 17.752280] flags: 0x200000000000000(node=0|zone=2) [ 17.752701] page_type: f5(slab) [ 17.753052] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 17.753651] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 17.754118] page dumped because: kasan: bad access detected [ 17.754703] [ 17.754925] Memory state around the buggy address: [ 17.755436] ffff888102a16680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 17.756051] ffff888102a16700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 17.756673] >ffff888102a16780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 17.757266] ^ [ 17.757590] ffff888102a16800: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 17.758260] ffff888102a16880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 17.758872] ==================================================================