* Unlock ProgramData entries a stale Windows owner locked
Wine builds the user SID from /etc/machine-id and the uid it runs as.
When either changes, descriptors stored in user.wine.sd keep the old
owner, and the next DACL change maps to mode 000 because no ACE matches
the token. Wine then cannot open the entry, so programs such as
Battle.net cannot repair their own folders.
Before each launch, clear stale local user owners under ProgramData and
give owner access back to entries they locked.
* Heal a locked ProgramData itself and keep read-only folders
* Serialise the ProgramData heal per prefix
* Launch even when the ProgramData owner check fails
* Read the machine ID as bytes the way Wine does
* Parse a signed machine ID the way Wine does
* Resolve fake input's real functions before any loader lock is held
Each hooked call looked up its real function through a function-local
static, and the x86 dlsym hook opened libc the same way. A thread that
entered a hook first held the static's guard while dlsym waited for the
loader lock, and a thread inside dlopen held the loader lock while its
constructor called the same hook and waited for the guard. Steam's update
window hung that way under FEX, so x86 Steam stopped at Installing update.
The real functions now live in lock-free slots filled by the library's
constructor, and the dlsym hook resolves dlvsym and libc there too.
* Use an atomic handshake in the loader lock test
* fix(flatpak): file dialogs and forwarded descriptors work in Flatpak apps
Flatpak apps opened from the desktop could not open files: the file
chooser's result went through a document store that cannot mount on
Android, and image loaders started with flatpak-spawn --forward-fd lost
their D-Bus descriptor because the app relaunches sandboxes and only
stdio survived.
- A session document store hands picked files and folders back in place
instead of failing without a mount.
- The bwrap shim offers its inherited descriptors once over a private
socket, and the native hook puts them back on their original numbers
before the program starts.
- The native hook resolves /proc/<pid>/root paths to the other
process's sandbox, so xdg-desktop-portal reads .flatpak-info and
identifies the calling app.
* fix(flatpak): check documents against the app's view and harden fd forwarding
The document store hands a picked file back in place only when the
calling app's own sandbox can open it with the requested access, so
paths the app cannot see are refused instead of handed out broken.
/proc/<pid>/root lookups follow links inside that process's view,
duplicated root descriptors keep their mapping, and close_range drops
stale records. Forwarded descriptors survive targets at the fd limit,
truncated offers are ignored, and the shim refuses more descriptors
than one message can carry.
* fix(flatpak): match picked documents by file identity and keep O_NOFOLLOW on process roots
The document store accepts an in-place path only when the app's view
holds the same file (device and inode) as the picked descriptor, and
reads each process root once. A bare /proc/<pid>/root opened with
O_NOFOLLOW is no longer mapped, so it fails like the kernel's link.
* Keep a trailing-slash process root translated and track only directory roots
* fix(battlenet): drop the unused runtime drive and list its games under the runtime path
* fix(battlenet): read product.db paths decoded and keep alias-saved folders
* fix(battlenet): keep drives for paths that climb out of the runtime
* fix(battlenet): keep a drive referenced with any separator spelling
* fix(battlenet): check decoded config values before dropping a drive
* fix(battlenet): games installed inside the runtime stay listed after a native session
* test(battlenet): expect the shared folder for a lone Forever install
---------
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
Co-authored-by: maxjivi05 <maxjividen@gmail.com>
fix(preload): keep libudev loaded while the input wrappers use it
Programs that close libudev and open it again crashed in the next wrapped
udev call: the wrappers kept function pointers into the unmapped copy.
Pin libudev with RTLD_NODELETE when it is opened so those pointers and
the stored handle stay valid.
* fix(xbox): an application element with attributes on the next line still counts
* fix(xbox): repair the patch hunk for the pretty-printed manifest test
* fix(desktop): a Kubuntu-default panel gets the SteamOS layout and launcher icon
* fix(desktop): lay out Plasma's stock panel with the SteamOS pins, once, over an older panel
* fix(desktop): keep Plasma's wide-screen cap and input-method panel in the SteamOS layout
* fix(desktop): stamp the panel layout only after the old panel is backed up, never over a backup
DroidDeck-Bionic: a Steam compatibility tool that runs the game itself on Android's libc (bionic) instead of glibc inside proot. Steam, the stores and the session stay on DroidDeck's Linux side; only the game process leaves proot.
- Listed in the Proton list only when Run without proot is on, in its own row. Its builds are pre-releases on Droid-Deck/DroidDeck-Proton (DroidDeck-Bionic-12.8-rNN, runtime built by .github/workflows/build-bionic-runtime.yml from tools/bionic-runtime); the app installs and updates them like the other extra tools and never makes one the default unless the user picks it.
- With proot on, a launch sent to a bionic tool goes to the newest DroidDeck-Proton (picks stay as set).
- ProtonExtras / ProtonMenu / ExperimentalProtons / droiddeck-proton-extra: bionic pre-releases checked and listed only without proot; updates carry the default and per-game picks over; deleting a tool never follows links out of it. ProtonDefault: picks left on an older bionic build move to the installed one.
- Components: FEX builds for bionic (bionic-stable on DroidDeck-Components); each tool is offered only the FEX builds that fit it.
- Session logs: the bionic game log and its graphics logs are part of Share logs.
Synced with main twice before the merge (latest sync fbed69ce on main 67b82ad9; Build APK and validation green); a local trial merge on main 3e1fc3e6 had no conflicts and the game-environment, Proton-extra and store-launch tests pass.
* fix(ea): a failed touchup is retried and its output reaches the store log
* fix(ea): bound the touchup output kept for the store log
The output goes to a temporary file and only its last 64 KiB are read back. The timeout test now checks the output is logged and the next launch retries.
* fix(ea): a touchup still runs when its output cannot be captured
* fix(library): keep another program of a Steam install out of the Steam app's route
* fix(library): cover a Steam-edited target in the unrouted-program test and docs
* fix(library): keep Steam-edited targets routed and release stale Spacewar imports for other programs
* fix(library): keep Steam-edited targets adopted before the marker existed routed
A saved executable and seen revision without the adoption marker are recognised
from the Steam shortcut record (its target is the current executable and differs
from the one the app asked for), and the marker is stored.
#2958 reverted the controller redesign and its follow-ups, and #2946 was
in that list, so streaming_client lost the real libudev again. #2963
brought back #2942 but not #2946. With the session's udev answers,
SDL3 in streaming_client hands a virtual pad's handle to the real
udev_device_get_driver and crashes about a second after it starts.
streaming_client in steamrtarm64/steamrt64 keeps the real libudev again,
like the Steam client. The no-driver answer for pads that #2946 also
added is left to #2915, which covers every device call.
The nested Wayland pointer reaches wlserver as touch 0, and in the Disabled
touch click mode wlserver_touchmotion returned before moving anything.
Buttons go through wlserver_mousebutton, so they still arrived, at an X
pointer that stayed at (0,0). Steam picks Disabled for Don't Starve
Together: DroidDeck's cursor followed the mouse while every click landed
in the top-left corner. The nested pointer now warps the X pointer in
Disabled as in the other modes; real fingers are still ignored.
At the game's default monster mesh detail, slimes show only their tips.
Set the two skeletal mesh detail values in Engine.ini before each launch,
in the prefix the game profile selects, and keep the file's permissions.
The game ignores -ini: overrides and deletes a writable Engine.ini after
reading it, so a launch argument or a one-time write does not work.
* fix(desktop): Plasma draws on the system PowerVR driver
KWin lacks the Android-buffer Wayland protocol the system PowerVR driver's
swapchain needs, so every Plasma client failed with "zink: could not create
swapchain" and the desktop stayed black under the cursor. Plasma's clients now
present through DRI on that path, as the Steam session already does.
* test(desktop): the kopper override reaches Plasma's child processes
* test(desktop): check the kopper override where Plasma launches
---------
Co-authored-by: Jacob Lambert <183008808+JMLambo@users.noreply.github.com>
PRoot's link2symlink resolves /usr/bin/env to a `.l2s.env….` stub and the
guest's uutils coreutils multicall refuses that name:
Security violation: Requested utility 'env' does not match executable
name: /usr/lib/cargo/bin/coreutils/.l2s.env0001.0116
Every exec of these five scripts therefore dies with GUEST_EXIT 1 before
Python starts, 20-60 ms into the session. They are droiddeck-diagnostic-
inventory (the session's first child), droiddeck-desktop-bookmarks (the
desktop's bookmarks refresh), droiddeck-ime, droiddeck-steam-games and
droiddeck-steam-shortcuts.
The absolute interpreter is what the other payload scripts already use,
and the guest runtime installs the python3 package (tools/ubuntu/
packages-runtime.txt), so /usr/bin/python3 exists in the rootfs.
Only the tracked overlay copies change: app/src/main/assets/linuxfs is
generated by the stageSessionScripts Gradle task, so the asset copies
follow from the overlay.
Co-authored-by: Pablo González <pgm1207@users.noreply.github.com>
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
* fix(native): programs started through the rootfs loader show their own command line
Without proot every dynamic guest program runs as "ld.so --preload <hook>
--library-path <dirs> --argv0 <name> <program> <args>", and the kernel's
/proc/<pid>/cmdline kept all of it. Launchers and the session match programs
by their command line, and Wine only moves its Windows command line over its
loader's name when its arguments follow each other, so the Battle.net launcher
never saw Battle.net.exe, gave up after five minutes and ended the session
with the game still running.
The hook now moves the program's own arguments to the front of that area at
start, as an exec of the program would have laid them out.
* fix(native): programs the app starts natively keep their path for /proc/<pid>/exe
* fix(native): the rewritten command line keeps AT_EXECFN naming the program
---------
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
* fix(display): layer buffers are imported as AHardwareBuffers only on the phone's own Vulkan driver
* fix(display): a failed 10-bit layer pool still falls back to 8-bit linear buffers
dd_descriptor_unlink, dd_descriptor_rmdir and dd_descriptor_rename put
one or two PATH_MAX buffers on their own frame (12 KB, 24 KB), and
dd_status_without_tracer put its 16 KB status buffer there, even on the
common path that only calls through to libc. Threads with small stacks,
such as .NET or Wine threads near their guard page, could overflow in
an otherwise plain unlink, rename or open.
The wrappers now do only the cheap checks and call the real function;
the buffers live in noinline helpers that run only when the descriptor
store or the status rewrite is actually needed. A test compiles both
sources with -fstack-usage and keeps each wrapper frame under 1 KB.
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
* fix(desktop): a program started through a directory link knows its real path
* fix(desktop): a missing or non-directory component still fails the lookup
* fix(fex): a program run from a descriptor keeps its argv[0] and an absolute /proc/self/exe
* fix(fex): 64-bit programs send their socket credentials through the hook
D-Bus clients fill SCM_CREDENTIALS with getuid(), which is 0 under the guest. FEX sent x86-64 sendmsg straight to the kernel, which refused the fake root uid with EPERM, so GLib programs lost the session bus and every portal. sendmsg, recvmsg and getsockopt now go through libc like the identity calls, so the hook puts in the real ids and shows the peer as root.
* fix(desktop): links read into a buffer sized from lstat show their guest target
lstat reports the guest length of a link stored with a rootfs target, and dpkg's
update-alternatives then reads it with exactly that many bytes. readlink filled the
buffer with the start of the host path, which could no longer be mapped back, so
every alternative looked dangling ("current alternative /data/dat is unknown").
The whole target is read first, mapped, then copied into the caller's buffer.
* fix(desktop): a zero-sized readlink buffer still fails with EINVAL
* test(desktop): read errno before printing the zero-size readlink result
* fix: a Steam target whose file is gone goes back to the app's exe
A shortcut Target edited in Steam is kept across the client's restart on
purpose, but it was kept even after the file it names disappeared. When the
app's own exe already equalled the recorded proposal, nothing replaced the dead
target: Steam started `System/launcher.exe`, Wine answered
`err:steam:run_process Failed to create process ...: 2`, and the game never ran
(#694, after #1644 and #2022 removed the two real causes).
The merge now treats a target that is not a file as no edit at all and writes
the listing's exe and StartIn. The check runs in the guest, where the shortcut's
paths live.
Fixes#694
* fix: keep a Steam target whose card is not mounted
- The app recreates /mnt/droiddeck-sd and /mnt/bannerlator-sd before binding the card, so the
mountpoint outlives a removed card. A target directly under one had an existing parent, so
the missing-file repair overwrote the edited Exe and Start In and kept them overwritten.
- The repair now needs the target's storage to be there: a card mountpoint that lists nothing
is a card that is not in the device, and the edit is kept for when it returns. Extra Steam
libraries under /mnt/droiddeck-lib/<id> get the same check.
- test_a_steam_target_under_a_bare_card_mountpoint_is_kept fails without the check and asserts
both fields; test_a_steam_target_under_a_mounted_card_goes_back_to_the_apps keeps the repair.
* fix: repair a Steam target removed with its folder
- A missing target is gone when its storage is mounted and either its folder is still
there or it lives in a tree the app always has (internal store installs, the internal
Steam library). An update that removes the whole game folder now repairs the shortcut.
- Store volumes and added game folders are removable mounts too: /mnt/droiddeck-stores/<id>
and /root/Games/<name> are checked for content before a target under them is treated as
gone, so an unplugged volume keeps the edited Exe and Start In.
- Tests: internal folder removed repairs both fields; a bare store mountpoint and a card
mountpoint keep both; a mounted card still repairs. 84 tests pass.
* fix: classify a Steam target by its resolved path
- A target such as /root/Games/Stores/../../../mnt/droiddeck-sd/Other.exe matched the
internal prefix and was repaired while the card was out. internal_target and
removable_mount now normalize the path before choosing the storage class, so the
decision follows the file the target resolves to; the kept text is unchanged.
- test_a_steam_target_is_classified_by_its_resolved_path fails before the normalization
(the edit is replaced) and keeps both fields after it. 85 tests pass.
Halo Wars: Definitive Edition's EAppx bundle leaves AppxBlockmap.xml at
the top of the game folder, and its one package folder has its own, so
hoist refused the install with "Extraction would overwrite ...". The
files a package container carries about itself (AppxBlockMap.xml,
AppxSignature.p7x, [Content_Types].xml, AppxMetadata) now replace the
bundle's copies, found by name regardless of letter casing. A game file
in the way still stops a fresh install.
* fix(desktop): Firefox draws on the system PowerVR driver
Under the nested KWin on the system PowerVR driver, Firefox's Wayland window
stops updating partway through drawing and repaints only where the pointer
moves. Through Xwayland it draws normally, so Desktop runs Firefox on X11 on
that path.
* fix(desktop): Firefox renders in software on the system PowerVR driver
The Xwayland workaround only worked because Firefox fell back to software
WebRender there. The breakage follows hardware WebRender on zink, not the
Wayland window: with MOZ_ACCELERATED=0 Firefox draws correctly on Wayland,
so it keeps native Wayland features such as fractional scaling.
---------
Co-authored-by: Jacob Lambert <183008808+JMLambo@users.noreply.github.com>
With depthTestEnable off, Vulkan ignores depthCompareOp. The Mali-G610 driver behind Venus
(Nothing Phone (2a), Dimensity 7200 Pro) applies it anyway, even without a depth attachment.
Zink leaves the op at VK_COMPARE_OP_NEVER whenever GL has the depth test off, so every fragment
Zink draws is thrown away: clears and copies work, draws never show. This is the black Steam UI
when it renders through Zink and the black picture of OpenGL games such as Stardew Valley. DXVK
sets ALWAYS in the same case, which is why D3D games drew.
The layer now hands the driver ALWAYS while the depth test is off:
- vkCmdSetDepthTestEnable and vkCmdSetDepthCompareOp keep the state per command buffer, which
vkBeginCommandBuffer clears. While the test is off the driver gets ALWAYS; turning it on again
restores the application's op.
- A pipeline with the depth test off and neither state dynamic is created with ALWAYS.
It is on for every device with gaps. ALWAYS for a disabled depth test changes nothing on a driver
that follows the spec.
The handle maps use key 0 for an empty slot. vkDestroyBuffer, vkFreeMemory and the other destroy
calls accept VK_NULL_HANDLE, and map_remove(0) matched the first empty slot it reached, so every
such call lowered count without removing anything. Once count wrapped below zero, every map_put
saw a full table and doubled it, and each rehash took twice as long as the one before.
Steam's web helper frees null buffers about 50,000 times in a few minutes. On a Mali-G610 its UI
stalled periodically for 0.2 s, 0.37 s, 0.75 s, 1.5 s and then 3 s, and the buffer map reported a
count of 4294967295.
map_get, map_put and map_remove now ignore key 0. On a Nothing Phone (2a) running 0.7.1 with this
change, the buffer map stayed at 256 slots after 115,000 frees and the stalls were gone.
* perf(steam): setup applies Steam's client update itself so the first launch has nothing to unpack
The setup already downloads every package of Steam's client update. droiddeck-steam-preapply now extracts them and writes the .installed and .manifest records the way Steam's updater does, so the first launch verifies and starts instead of unpacking for about half a minute and restarting. When it cannot, the packages stay and Steam updates itself as before.
* perf(setup): the Steam stage skips the plain packages it just applied, and Proton's install trusts the prefetch's checksum
With the whole client update applied from the cached packages, the separate 362 MB plain-package install is redundant: the cache pass applies the update and finishes the install, and the plain install stays as the fallback. DroidDeck Proton's archive was hashed twice more at install time after the prefetch had already verified it; the install now reuses that result while the file is unchanged.
* fix(steam): a failed or cancelled apply leaves nothing stale, extraction stays inside the Steam root, and a cache failure still installs
A failed apply removes its record and the cache marker so the next run retries; cancelling stops the helper; entries that leave the Steam root, directly or through a symlink, are refused; the plain install still runs when the cache pass fails; Proton's install reuses the prefetch's verification only for the same digest.
* fix(steam): a cancelled apply clears the cache marker too
* fix(desktop): Go programs see the session's identity and paths
Static Go programs now get the session's root identity from getuid and its
relatives, and set*id calls succeed, as C and x86 programs already do. The
added code also takes over Go's second raw system call function (and its
golang.org/x/sys copy), which getuid goes through.
Go programs that link the C library (snapd, gocryptfs, ipp-usb) get the same
code: their Go note is found past the other notes, and the code fits before
a data segment that does not start on a page boundary. snap now reaches the
session's snapd and installs snaps.
* fix(desktop): read every Go note and retry Go programs after a failed scan
run_parallel is called in an || list, which switches set -e off inside it and inside its workers, so a failed claim left the worker's index empty and the worker exited successfully with packages unclaimed. The worker now checks the claim itself and marks the run failed, and claim_next uses the same flock command as the unpack lock.
The parallel workers claimed packages with mkdir, which is not atomic in the app's guest shell: two workers sometimes took the same package and about 3 installs in 8 failed on a device. Claims now come from a counter under a flock, and a counter that cannot be read or written fails the worker.
* fix(appimage): catalog AppImages start without proot
* fix(appimage): cache cleanup does not follow symlinked entries
* fix(appimage): keep unpacked copies in use and track subsecond changes
* fix(appimage): extract native images through an open descriptor
---------
Co-authored-by: maxjivi05 <maxjividen@gmail.com>
The child-process fix always uses the guided pairing flow, Finish setup opens the setting directly and queues the Steam launch, the Play button carries the first-run progress, the setup bar weighs each download by its real size, and the Steam client packages download over four connections and unpack one at a time under a flock.
* feat(tools): pre_pr.sh runs the CI checks the fast loop skips, for what the branch changes
* fix(tools): pre_pr.sh checks authorship with no file changes and skips deleted tests
* docs(agents): pre_pr.sh picks tests by name
* docs(agents): pre_pr.sh compiles and lints only for app changes
* Native hook: start a program again through /proc/self/exe as itself
A program that execs /proc/self/exe (Chromium's network and utility
services, Electron apps) reached the kernel link, which names ld.so, so
the child was started without ld.so and saw libddexec as its own
program. Chromium then looked for its ICU data beside libddexec and the
network service crashed in a loop.
The exec path now resolves /proc/self/exe to the program the hook knows
it runs, so it is routed like any other guest program, and readlink of
the exe link names a program from a bind by its guest path.
* fix(hook): keep the host path of a running program a nested bind shadows
* feat(build): build_local.sh reuses main CI's prepared components when this tree would prepare the same
* docs(agents): build_local.sh reuses CI's prepared components
* fix(build): reuse only this repository's main artifacts, keyed by artifact id
* fix(build): CI reuse verifies before replacing, and declines other NDKs, PulseAudio sources, unregistered inputs and edited submodules
* fix(build): CI reuse also declines a VK_INCLUDE override
* fix(build): CI reuse also declines a custom build image
The browser flags were added to every program beside chrome-sandbox
that had no --type switch. Chrome's crash handler is such a program, so
it was started with --no-sandbox, rejected it and exited. A Chromium app
that starts a program from its own folder already passes that program
the arguments it needs, so those programs are left unchanged. Another
Chromium app started from it still gets the flags.
* fix(nativeguest): a script interpreter reached through a bind runs as a guest program
A Flatpak runtime binds its own /usr outside the sandbox root, so the hook
took #!/usr/bin/bash there for an Android program and handed it to the
kernel, which failed with "bad interpreter". An interpreter whose guest
path is a bind now starts like any guest program.
* Native hook: keep Android interpreters a bind reaches on the host
* Native hook: match the root of an interpreter on a folder boundary
* fix(fex): x86 programs see the session's identity from getuid and its relatives
* fix(hook): getresuid and getresgid keep EFAULT for a missing pointer
* fix(hook): getresuid and getresgid return EFAULT for any pointer the kernel cannot write
* fix(hook): getgroups returns EFAULT for a list the kernel cannot write