Repository navigation
Wine memory helper: run inside a Proton or Flatpak container - #14
Merged
Merged
Conversation
When Wine reserves the space a hook needs, Cheat Engine asks Wine itself for the block through a small generated Windows program. For a game in a Proton (Steam Runtime) or Flatpak container, the program could not reach the container's Wine, prefix and wineserver, so this failed with not_supported. The helper now joins the target's namespaces before starting Wine: the user namespace first (its owner may then join the rest), then mount, IPC, network, UTS and PID, with one more fork so the Wine process lives in the container's PID namespace and dies with its parent. The helper file is written to the container's /tmp (else its runtime directory or the prefix) through /proc/<pid>/root with openat2(RESOLVE_IN_ROOT), so no link in the container leads outside it, and the loader is checked the same way. A failure to enter the container is reported as not_supported. wine_integration calls the helper directly on the busy 64-bit and 32-bit targets and prints whether the target shared our namespaces. The Proton gate requires the helper to pass, and inside the Steam Runtime to have run in the container. Fixes #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9 for games in a Proton (Steam Runtime) or Flatpak container.
When Wine reserves the space a hook needs, Cheat Engine asks Wine for the block through a small generated Windows program. Until now that program was refused for a target in another mount namespace, because it could not reach the container's Wine, prefix and wineserver.
What changes
/tmp(falling back to its runtime directory, then the prefix). It is written through/proc/<pid>/rootwithopenat2(RESOLVE_IN_ROOT), so no link in the container can lead outside it. The loader is checked the same way.not_supported, and the Auto Assembler's message says so.Tests
wine_integrationcalls the helper directly on the busy targets, after the register-preservation check, since Wine interrupts a target thread to do the work. It prints whether the target shared our namespaces.The Proton gate requires the helper to pass, and to have run in the container in the Steam Runtime job.
On workhorse with Ubuntu's Wine 9.0, the helper allocated and released a 64-bit block in three setups:
Each container had its own PID namespace and a private
/tmpwith its own wineserver. The full regression suite passed.