Date
May 26, 2025, 9:10 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 17.737228] ================================================================== [ 17.737392] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 17.737525] Read of size 1 at addr fff00000c78c47a8 by task kunit_try_catch/188 [ 17.737638] [ 17.737713] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G B N 6.15.0-rc7-next-20250526 #1 PREEMPT [ 17.738236] Tainted: [B]=BAD_PAGE, [N]=TEST [ 17.738303] Hardware name: linux,dummy-virt (DT) [ 17.738490] Call trace: [ 17.738554] show_stack+0x20/0x38 (C) [ 17.738908] dump_stack_lvl+0x8c/0xd0 [ 17.739033] print_report+0x118/0x608 [ 17.739406] kasan_report+0xdc/0x128 [ 17.739682] __asan_report_load1_noabort+0x20/0x30 [ 17.739835] kmalloc_uaf2+0x3f4/0x468 [ 17.740164] kunit_try_run_case+0x170/0x3f0 [ 17.740299] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.740436] kthread+0x328/0x630 [ 17.740710] ret_from_fork+0x10/0x20 [ 17.741091] [ 17.741153] Allocated by task 188: [ 17.741362] kasan_save_stack+0x3c/0x68 [ 17.741642] kasan_save_track+0x20/0x40 [ 17.741797] kasan_save_alloc_info+0x40/0x58 [ 17.741887] __kasan_kmalloc+0xd4/0xd8 [ 17.741964] __kmalloc_cache_noprof+0x15c/0x3c0 [ 17.742049] kmalloc_uaf2+0xc4/0x468 [ 17.742125] kunit_try_run_case+0x170/0x3f0 [ 17.742209] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.742301] kthread+0x328/0x630 [ 17.742385] ret_from_fork+0x10/0x20 [ 17.742464] [ 17.742713] Freed by task 188: [ 17.742797] kasan_save_stack+0x3c/0x68 [ 17.743109] kasan_save_track+0x20/0x40 [ 17.743284] kasan_save_free_info+0x4c/0x78 [ 17.743533] __kasan_slab_free+0x6c/0x98 [ 17.743615] kfree+0x214/0x3c8 [ 17.743687] kmalloc_uaf2+0x134/0x468 [ 17.744114] kunit_try_run_case+0x170/0x3f0 [ 17.744425] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.744551] kthread+0x328/0x630 [ 17.744726] ret_from_fork+0x10/0x20 [ 17.744913] [ 17.744985] The buggy address belongs to the object at fff00000c78c4780 [ 17.744985] which belongs to the cache kmalloc-64 of size 64 [ 17.745298] The buggy address is located 40 bytes inside of [ 17.745298] freed 64-byte region [fff00000c78c4780, fff00000c78c47c0) [ 17.745644] [ 17.745781] The buggy address belongs to the physical page: [ 17.745877] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078c4 [ 17.746537] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 17.746692] page_type: f5(slab) [ 17.746782] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 17.746878] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 17.746996] page dumped because: kasan: bad access detected [ 17.747070] [ 17.747105] Memory state around the buggy address: [ 17.747174] fff00000c78c4680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 17.747294] fff00000c78c4700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 17.747435] >fff00000c78c4780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 17.747522] ^ [ 17.747594] fff00000c78c4800: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 17.747709] fff00000c78c4880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 17.747794] ==================================================================
[ 11.288821] ================================================================== [ 11.289313] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 11.289925] Read of size 1 at addr ffff8881028229a8 by task kunit_try_catch/206 [ 11.290344] [ 11.290474] CPU: 0 UID: 0 PID: 206 Comm: kunit_try_catch Tainted: G B N 6.15.0-rc7-next-20250526 #1 PREEMPT(voluntary) [ 11.290520] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.290532] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.290553] Call Trace: [ 11.290565] <TASK> [ 11.290580] dump_stack_lvl+0x73/0xb0 [ 11.290605] print_report+0xd1/0x650 [ 11.290627] ? __virt_addr_valid+0x1db/0x2d0 [ 11.290649] ? kmalloc_uaf2+0x4a8/0x520 [ 11.290669] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.290692] ? kmalloc_uaf2+0x4a8/0x520 [ 11.290712] kasan_report+0x141/0x180 [ 11.290734] ? kmalloc_uaf2+0x4a8/0x520 [ 11.290759] __asan_report_load1_noabort+0x18/0x20 [ 11.290779] kmalloc_uaf2+0x4a8/0x520 [ 11.290800] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 11.290819] ? finish_task_switch.isra.0+0x153/0x700 [ 11.290841] ? __switch_to+0x47/0xf50 [ 11.290866] ? __schedule+0x10cc/0x2b60 [ 11.290890] ? __pfx_read_tsc+0x10/0x10 [ 11.290909] ? ktime_get_ts64+0x86/0x230 [ 11.290933] kunit_try_run_case+0x1a5/0x480 [ 11.290953] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.290972] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.290996] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.291020] ? __kthread_parkme+0x82/0x180 [ 11.291040] ? preempt_count_sub+0x50/0x80 [ 11.291062] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.291082] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.291105] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.291129] kthread+0x337/0x6f0 [ 11.291148] ? trace_preempt_on+0x20/0xc0 [ 11.291182] ? __pfx_kthread+0x10/0x10 [ 11.291202] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.291224] ? calculate_sigpending+0x7b/0xa0 [ 11.291247] ? __pfx_kthread+0x10/0x10 [ 11.291267] ret_from_fork+0x116/0x1d0 [ 11.291285] ? __pfx_kthread+0x10/0x10 [ 11.291305] ret_from_fork_asm+0x1a/0x30 [ 11.291334] </TASK> [ 11.291344] [ 11.299140] Allocated by task 206: [ 11.299273] kasan_save_stack+0x45/0x70 [ 11.299429] kasan_save_track+0x18/0x40 [ 11.299624] kasan_save_alloc_info+0x3b/0x50 [ 11.299831] __kasan_kmalloc+0xb7/0xc0 [ 11.300171] __kmalloc_cache_noprof+0x189/0x420 [ 11.300343] kmalloc_uaf2+0xc6/0x520 [ 11.300487] kunit_try_run_case+0x1a5/0x480 [ 11.300634] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.301203] kthread+0x337/0x6f0 [ 11.301410] ret_from_fork+0x116/0x1d0 [ 11.301606] ret_from_fork_asm+0x1a/0x30 [ 11.301932] [ 11.302101] Freed by task 206: [ 11.302268] kasan_save_stack+0x45/0x70 [ 11.302484] kasan_save_track+0x18/0x40 [ 11.302628] kasan_save_free_info+0x3f/0x60 [ 11.302774] __kasan_slab_free+0x56/0x70 [ 11.303046] kfree+0x222/0x3f0 [ 11.303198] kmalloc_uaf2+0x14c/0x520 [ 11.303348] kunit_try_run_case+0x1a5/0x480 [ 11.303563] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.303763] kthread+0x337/0x6f0 [ 11.303885] ret_from_fork+0x116/0x1d0 [ 11.304018] ret_from_fork_asm+0x1a/0x30 [ 11.304157] [ 11.304249] The buggy address belongs to the object at ffff888102822980 [ 11.304249] which belongs to the cache kmalloc-64 of size 64 [ 11.304916] The buggy address is located 40 bytes inside of [ 11.304916] freed 64-byte region [ffff888102822980, ffff8881028229c0) [ 11.305807] [ 11.305910] The buggy address belongs to the physical page: [ 11.306217] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102822 [ 11.306484] flags: 0x200000000000000(node=0|zone=2) [ 11.306651] page_type: f5(slab) [ 11.306822] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 11.307173] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 11.307526] page dumped because: kasan: bad access detected [ 11.307755] [ 11.307871] Memory state around the buggy address: [ 11.308084] ffff888102822880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.308426] ffff888102822900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.308748] >ffff888102822980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.309157] ^ [ 11.309406] ffff888102822a00: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 11.309678] ffff888102822a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.310002] ==================================================================