Date
June 24, 2025, 12:47 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 24.706835] ================================================================== [ 24.707008] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8 [ 24.707395] Read of size 8 at addr fff00000c5a2ce80 by task kunit_try_catch/202 [ 24.707724] [ 24.707956] CPU: 0 UID: 0 PID: 202 Comm: kunit_try_catch Tainted: G B N 6.15.4-rc2 #1 PREEMPT [ 24.708172] Tainted: [B]=BAD_PAGE, [N]=TEST [ 24.708250] Hardware name: linux,dummy-virt (DT) [ 24.708342] Call trace: [ 24.708428] show_stack+0x20/0x38 (C) [ 24.709152] dump_stack_lvl+0x8c/0xd0 [ 24.709590] print_report+0x118/0x608 [ 24.709834] kasan_report+0xdc/0x128 [ 24.709953] __asan_report_load8_noabort+0x20/0x30 [ 24.710104] workqueue_uaf+0x480/0x4a8 [ 24.710454] kunit_try_run_case+0x170/0x3f0 [ 24.710597] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 24.710753] kthread+0x328/0x630 [ 24.710925] ret_from_fork+0x10/0x20 [ 24.711060] [ 24.711424] Allocated by task 202: [ 24.711552] kasan_save_stack+0x3c/0x68 [ 24.711824] kasan_save_track+0x20/0x40 [ 24.711921] kasan_save_alloc_info+0x40/0x58 [ 24.712046] __kasan_kmalloc+0xd4/0xd8 [ 24.712191] __kmalloc_cache_noprof+0x16c/0x3c0 [ 24.712297] workqueue_uaf+0x13c/0x4a8 [ 24.712593] kunit_try_run_case+0x170/0x3f0 [ 24.712767] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 24.713023] kthread+0x328/0x630 [ 24.713140] ret_from_fork+0x10/0x20 [ 24.713245] [ 24.713365] Freed by task 10: [ 24.713454] kasan_save_stack+0x3c/0x68 [ 24.713567] kasan_save_track+0x20/0x40 [ 24.713988] kasan_save_free_info+0x4c/0x78 [ 24.714206] __kasan_slab_free+0x6c/0x98 [ 24.714445] kfree+0x214/0x3c8 [ 24.714542] workqueue_uaf_work+0x18/0x30 [ 24.714639] process_one_work+0x530/0xf98 [ 24.714735] worker_thread+0x618/0xf38 [ 24.714819] kthread+0x328/0x630 [ 24.714907] ret_from_fork+0x10/0x20 [ 24.715011] [ 24.715132] Last potentially related work creation: [ 24.715341] kasan_save_stack+0x3c/0x68 [ 24.715484] kasan_record_aux_stack+0xb4/0xc8 [ 24.715603] __queue_work+0x65c/0x1008 [ 24.716120] queue_work_on+0xbc/0xf8 [ 24.716222] workqueue_uaf+0x210/0x4a8 [ 24.716279] kunit_try_run_case+0x170/0x3f0 [ 24.716328] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 24.716435] kthread+0x328/0x630 [ 24.716637] ret_from_fork+0x10/0x20 [ 24.716756] [ 24.716803] The buggy address belongs to the object at fff00000c5a2ce80 [ 24.716803] which belongs to the cache kmalloc-32 of size 32 [ 24.716943] The buggy address is located 0 bytes inside of [ 24.716943] freed 32-byte region [fff00000c5a2ce80, fff00000c5a2cea0) [ 24.717147] [ 24.717264] The buggy address belongs to the physical page: [ 24.717344] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a2c [ 24.717531] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 24.717759] page_type: f5(slab) [ 24.717855] raw: 0bfffe0000000000 fff00000c0001780 dead000000000100 dead000000000122 [ 24.717979] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 24.718116] page dumped because: kasan: bad access detected [ 24.718199] [ 24.718243] Memory state around the buggy address: [ 24.718320] fff00000c5a2cd80: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc [ 24.718449] fff00000c5a2ce00: fa fb fb fb fc fc fc fc 00 00 00 07 fc fc fc fc [ 24.718568] >fff00000c5a2ce80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 24.718763] ^ [ 24.718871] fff00000c5a2cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 24.718992] fff00000c5a2cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 24.719136] ==================================================================
[ 12.454886] ================================================================== [ 12.455445] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560 [ 12.455807] Read of size 8 at addr ffff8881039e0380 by task kunit_try_catch/220 [ 12.456293] [ 12.456491] CPU: 0 UID: 0 PID: 220 Comm: kunit_try_catch Tainted: G B N 6.15.4-rc2 #1 PREEMPT(voluntary) [ 12.456548] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.456560] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.456584] Call Trace: [ 12.456600] <TASK> [ 12.456666] dump_stack_lvl+0x73/0xb0 [ 12.456810] print_report+0xd1/0x650 [ 12.456847] ? __virt_addr_valid+0x1db/0x2d0 [ 12.456877] ? workqueue_uaf+0x4d6/0x560 [ 12.456904] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.456934] ? workqueue_uaf+0x4d6/0x560 [ 12.456964] kasan_report+0x141/0x180 [ 12.456995] ? workqueue_uaf+0x4d6/0x560 [ 12.457030] __asan_report_load8_noabort+0x18/0x20 [ 12.457061] workqueue_uaf+0x4d6/0x560 [ 12.457093] ? __pfx_workqueue_uaf+0x10/0x10 [ 12.457127] ? __schedule+0x10cc/0x2b60 [ 12.457166] ? __pfx_read_tsc+0x10/0x10 [ 12.457199] ? ktime_get_ts64+0x86/0x230 [ 12.457239] kunit_try_run_case+0x1a5/0x480 [ 12.458091] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.458176] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.458209] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.458233] ? __kthread_parkme+0x82/0x180 [ 12.458256] ? preempt_count_sub+0x50/0x80 [ 12.458286] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.458329] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.458365] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.458397] kthread+0x337/0x6f0 [ 12.458423] ? trace_preempt_on+0x20/0xc0 [ 12.458449] ? __pfx_kthread+0x10/0x10 [ 12.458467] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.458488] ? calculate_sigpending+0x7b/0xa0 [ 12.458509] ? __pfx_kthread+0x10/0x10 [ 12.458526] ret_from_fork+0x41/0x80 [ 12.458560] ? __pfx_kthread+0x10/0x10 [ 12.458579] ret_from_fork_asm+0x1a/0x30 [ 12.458609] </TASK> [ 12.458637] [ 12.470223] Allocated by task 220: [ 12.470800] kasan_save_stack+0x45/0x70 [ 12.471200] kasan_save_track+0x18/0x40 [ 12.471670] kasan_save_alloc_info+0x3b/0x50 [ 12.472015] __kasan_kmalloc+0xb7/0xc0 [ 12.472380] __kmalloc_cache_noprof+0x189/0x420 [ 12.472906] workqueue_uaf+0x152/0x560 [ 12.473500] kunit_try_run_case+0x1a5/0x480 [ 12.473697] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.473847] kthread+0x337/0x6f0 [ 12.473968] ret_from_fork+0x41/0x80 [ 12.474090] ret_from_fork_asm+0x1a/0x30 [ 12.474728] [ 12.474930] Freed by task 90: [ 12.475082] kasan_save_stack+0x45/0x70 [ 12.475257] kasan_save_track+0x18/0x40 [ 12.475380] kasan_save_free_info+0x3f/0x60 [ 12.475469] __kasan_slab_free+0x56/0x70 [ 12.475574] kfree+0x222/0x3f0 [ 12.476244] workqueue_uaf_work+0x12/0x20 [ 12.476713] process_one_work+0x5ee/0xf60 [ 12.477058] worker_thread+0x758/0x1220 [ 12.477489] kthread+0x337/0x6f0 [ 12.477953] ret_from_fork+0x41/0x80 [ 12.478270] ret_from_fork_asm+0x1a/0x30 [ 12.478717] [ 12.478882] Last potentially related work creation: [ 12.479222] kasan_save_stack+0x45/0x70 [ 12.479971] kasan_record_aux_stack+0xb2/0xc0 [ 12.480310] __queue_work+0x626/0xeb0 [ 12.481105] queue_work_on+0xb6/0xc0 [ 12.481718] workqueue_uaf+0x26d/0x560 [ 12.481910] kunit_try_run_case+0x1a5/0x480 [ 12.482544] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.483030] kthread+0x337/0x6f0 [ 12.483175] ret_from_fork+0x41/0x80 [ 12.483319] ret_from_fork_asm+0x1a/0x30 [ 12.483835] [ 12.484214] The buggy address belongs to the object at ffff8881039e0380 [ 12.484214] which belongs to the cache kmalloc-32 of size 32 [ 12.484871] The buggy address is located 0 bytes inside of [ 12.484871] freed 32-byte region [ffff8881039e0380, ffff8881039e03a0) [ 12.485149] [ 12.485265] The buggy address belongs to the physical page: [ 12.486338] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039e0 [ 12.487075] flags: 0x200000000000000(node=0|zone=2) [ 12.487455] page_type: f5(slab) [ 12.487788] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 12.488196] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 12.488467] page dumped because: kasan: bad access detected [ 12.489051] [ 12.489236] Memory state around the buggy address: [ 12.489598] ffff8881039e0280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 12.490206] ffff8881039e0300: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 12.490767] >ffff8881039e0380: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc [ 12.491512] ^ [ 12.491801] ffff8881039e0400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.491987] ffff8881039e0480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.492150] ==================================================================