eden/src
xbzk b6ee847947
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run
[hle/am] make Service::Process move-only to fix #3908 KProcess use-after-free (#4137)
#3908 changed process_creation.*, CreateProcess/CreateApplicationProcess, to return std::optional<Process> instead of std::unique_ptr<Process>, so the AM sites now transfer a Process by value via make_unique<Service::Process>(*std::move(opt)).

The consequence: Process owns a refcounted KProcess* but its user-declared dtor suppressed the implicit move ctor, so that "move" silently shallow-copied and the temporary's dtor Close()/RemoveProcess()'d the shared handle -> use-after-free.

It's seems to be user end based, so whether it crashes may depend on machine, compiler, allocator reuse, refcount slack, and the AM event-observer thread race, idk. It reliably crashed my MSVC build at launching games (cstack: ProcessHolder -> MultiWait -> KSynchronizationObject::Wait -> null) multiple times.

Fix: give Process a move ctor that steals the handle (nulling the source so the moved-from dtor is a no-op) and delete copy/move-assign, making the optional<->unique_ptr transfer safe.

Bonus: explicited delete for the 3 kinds of assignment: copy ctor (the one used in eden), copy assign and move assign (currently unused) to force compile error if they ever come to use.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4137
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-29 02:39:11 +02:00
..
android [android] Add Enable GPU Buffer Readback option to Android (#4132) 2026-06-28 03:37:23 +02:00
audio_core [video_core, hle] remove redundant parent references in system structs (#3908) 2026-06-23 06:31:25 +02:00
common [hle/bsd] do not use rust-result wannabe Expected in functions (#4075) 2026-06-27 08:50:24 +02:00
core [hle/am] make Service::Process move-only to fix #3908 KProcess use-after-free (#4137) 2026-06-29 02:39:11 +02:00
dedicated_room [desktop] More qt_common reorganization (#3916) 2026-05-20 04:49:16 +02:00
dynarmic [dynarmic, MacroHLE] Fix crashes on W^X systems (#4090) 2026-06-15 22:06:14 +02:00
frontend_common [qt] fix various crashes due to invalid/corrupted/outdated settings (#4070) 2026-06-14 20:48:24 +02:00
hid_core [video_core, hle] remove redundant parent references in system structs (#3908) 2026-06-23 06:31:25 +02:00
input_common [video_core, hle] remove redundant parent references in system structs (#3908) 2026-06-23 06:31:25 +02:00
network [common] unify std::random_device (#3801) 2026-03-31 20:12:41 +02:00
qt_common [buffer_cache] Add option to control GPU buffer readback (#4126) 2026-06-27 08:38:04 +02:00
shader_recompiler [video_core, maxwell] fixes for homebrew games that use MESA compiler (#4012) 2026-06-15 03:05:11 +02:00
tests [tests] Require backing base pointer to be nonnull for HostMemory tests (#4138) 2026-06-28 08:01:41 +02:00
video_core [vulkan] Fix EDS 0-2 (#4117) 2026-06-28 15:07:54 +02:00
web_service [cmake, deps] conjure common/httplib.h and remove global def for httplib macros (#3800) 2026-04-06 19:13:09 +02:00
yuzu xbzk/gpu-logging_qt-controls_android-fix (#4018) 2026-06-27 02:52:13 +02:00
yuzu_cmd [externals] Update to SDL3 (#3952) 2026-05-18 19:07:41 +02:00
yuzu_room_standalone [cmake] add a YUZU_STATIC_ROOM option (#3411) 2026-01-28 23:54:49 +01:00
.clang-format chore: make yuzu REUSE compliant 2022-07-27 12:53:49 +02:00
CMakeLists.txt [dynarmic] bootstrap loongarch64 host build (#4015) 2026-05-30 01:42:23 +02:00
dep_hashes.h.in [cmake, frontend] feat: CPMUtil + dependency viewer (#238) 2025-08-11 22:27:29 +02:00