mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 12:35:42 +00:00
088e9994a0eafa1663d3aa008bbcfffc327c49e2
118
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
088e9994a0 | Merge remote-tracking branch 'origin/main' into frozen-session-disk-spill | ||
|
|
2d25fb91c5 |
Run Easy Anti-Cheat and BattlEye games on x86-64 DroidDeck-Proton under FEX (#3641)
* FEX: emulate x86-64 ptrace, seccomp and /proc for anti-cheat launchers * Guest hook: route raw execve/execveat through the exec wrapper and pass self-sent SIGSYS to the program A program that execs with syscall(SYS_execveat, ...) bypassed the environment the guest needs, so re-executing /proc/self/exe died in the loader. /proc/self/exe now maps to the real program on exec as it already does on open. A SIGSYS the program queues itself, or one from a filter for another architecture, went to the Android-filter emulation instead of the program's handler. * FEX: list only guest mappings in /proc/<pid>/maps on hosts below 47 address bits Credit the anti-cheat emulation source in the patch header. * Preloads: leave poll, ppoll and select buffers untouched when no emulated device is open A bad user pointer now reaches the kernel and returns EFAULT instead of crashing the caller inside the wrapper. * Emulate only host-architecture seccomp traps in the guest hook; report the calling thread's seccomp mode in FEX's /proc/self/status A SIGSYS carrying another architecture's seccomp siginfo now takes its default action when the program has no handler, so a process whose emulated filter traps a syscall while SIGSYS is blocked or ignored dies as on Linux. * FEX: read the host status file through the raw openat syscall * README: credit StonkGuy's FEX anti-cheat emulation * FEX: open the host status file with a direct system call so preloads cannot rewrite it * FEX: hand a traced program's ptrace state across exec * Credit StonkGuy in the FEX anti-cheat patches and README Co-authored-by: StonkGuy <68372320+StonkGuy@users.noreply.github.com> * FEX: open guest paths with the raw openat system call so host preloads cannot replace the file * FEX: serve emulated proc files by the requested path when the host returns a memfd * FEX: map fixed guest memory above a small host address space Co-authored-by: StonkGuy <StonkGuy@users.noreply.github.com> * FEX: serve decoder reads from fixed guest memory above the host limit * Run games with anti-cheat files on an x86-64 DroidDeck-Proton under FEX The Proton launchers look for Easy Anti-Cheat or BattlEye bridge files in the game folder and, when an x86-64 DroidDeck-Proton and the matching Proton runtime are installed, hand the launch to that Proton under FEX with the game's own prefix. Picking the x86-64 tool directly also runs it under FEX. DROIDDECK_ANTICHEAT=off keeps a game on ARM64. * Keep x86-64 DroidDeck-Proton builds out of the ARM64 tool list * droiddeck-fex: take the runtime from an adopted tool's original manifest * FEX: show the guest command line when the argument area cannot be remapped * FEX: describe the container's procfs in emulated mount tables * FEX: order the anti-cheat series after the guest stack patch from main * Test the container procfs view of FEX's emulated mount tables * Docs: describe the anti-cheat signal mask fix and the container procfs view * README: match the StonkGuy credit to the renumbered FEX patches * Keep anti-cheat games on a tool the user chose instead of moving them to x86-64 * test(game-env): build the adopted-tool wrapper through extra_wrapper_sh * Check anti-cheat runtime bridges, apply component choices under FEX and honour MAP_FIXED_NOREPLACE above the host limit * Check the driver query is answered before each wrapper's call sites * Keep x86-64 Proton builds out of the automatic default tool * Keep high guest mappings intact when a fixed map or unmap fails Check room in the region table, splits included, before a fixed map or unmap removes anything, return the host munmap error without touching the table entry, and keep write-protecting low shared aliases of executable ranges that sit above the host address limit. * Keep a requested x86-64 default and accept linked anti-cheat runtimes A request for the current automatic x86-64 default now marks it as the app's choice, so the next settle no longer moves it back to ARM64. Anti-cheat runtime discovery follows a symlinked runtime directory. * Route anti-cheat games to x86-64 Proton only on a capable FEX The FEX build now lists its patches in share/fex-emu/.droiddeck-patches. Anti-cheat routing needs the fixed guest memory patch in that list and otherwise keeps the launch on ARM64, as an older FEX cannot map the anti-cheat helper buffer above the host address limit. Installing a FEX build without the list removes a list left by an earlier build. * Update FEX before deciding anti-cheat routing A device on an older FEX build never went through droiddeck-fex on the ARM64 path, so the catalog FEX was never installed and the gate kept anti-cheat games on ARM64 forever. dd_anticheat now runs the new droiddeck-fex update action first, which installs the catalog build under the same lock and retry window as other FEX launches. * Leave MAP_FIXED_NOREPLACE above the host limit to the host Wine finds the top of the address space with MAP_FIXED_NOREPLACE probes. Claiming those probes above a 39-bit host limit made Wine place its stacks in relocated memory, and every wineserver request then failed with EFAULT because the iovec buffers it passes to writev are nested pointers that are not translated. Only MAP_FIXED requests are relocated again, so the probes see the real host limit while fixed mappings above it keep working. * Translate only pointer syscall arguments into high guest memory Pointer arguments are now picked from a per-syscall layout table, so scalar values such as a truncate length are never rewritten. Sized buffers must map to one contiguous host range or the call fails with EFAULT, and new host backings are placed next to their guest neighbours so adjacent mappings stay contiguous. readv, writev and the preadv/pwritev family, sendmsg and recvmsg get a host-side copy of their iovec and msghdr with translated bases, leaving the guest copies untouched. Code invalidation for kernel writes maps the host buffer back to its guest address, and an unmap checks the table before it changes any host mapping. * Claim high guest memory only with LSE atomics and invalidate every code alias High guest mappings are claimed only when the JIT emits LSE atomics, and exclusive load/store instructions are never single-stepped, so an atomic on high memory cannot spin. A store into high code invalidates every mirror of the written page through the tracked mapping. madvise and mprotect on high memory apply to each region at its own host address. * Reject wrapping lengths and drop stale code on discarded high memory A nonzero length that wraps when page-aligned now fails madvise with EINVAL and mprotect with ENOMEM, as on Linux. Discarding advice on high memory invalidates translated code for the range whenever advice reached any region. * Add an end-to-end probe for guest memory above the host address limit * Emulate exclusive pairs on high guest memory and release failed host unmaps later * Size counted guest buffers by element and keep exclusive access within guest protection poll, ppoll, epoll waits, mmsg calls and select bitmaps now translate the whole array their count describes, so a buffer that crosses into an unrelated host range fails with EFAULT and oversized counts cannot wrap. High regions remember their protection through mprotect, splitting at the range edges, and exclusive stores to read-only pages or loads from inaccessible pages reach the guest as a fault instead of being emulated. * Refuse a high unmap when failed host unmaps could not all be retained UnmapLocked counts the overlapping regions before it changes anything and returns ENOMEM when the retired list could not hold all of them, so a host range is never dropped from tracking while still mapped. * Serve memory trim requests while syscall user dispatch blocks A thread that runs with syscall user dispatch on and its selector set to block (as x86-64 Wine does while in Windows code) took the trim signal with the selector still blocking. Every raw syscall the handler made was then dispatched to the program's SIGSYS handler, which either deadlocked the thread or killed the process when SIGSYS was blocked, so the session saw it as a deaf process and the game stalled during loading. Track the selector each thread registers through prctl, allow syscalls for the length of the handler and restore the selector before returning. * Allow syscalls for a forwarded prctl while dispatch blocks The prctl wrapper issues its syscall from the preload's own text, so a thread whose selector blocks got SIGSYS where the plain libc call would have been dispatched the same way by the caller's own rules. Allow syscalls for the forwarded call and restore the selector afterwards. The dispatch test now waits until the selector blocks before it sends the trim request, and checks a prctl call made while it blocks. * Merge high regions after protection changes and translate message batches Protect now merges neighbouring high regions whose guest and host ranges touch and whose protection and code state match, so toggling page protections no longer fills the region table. Exclusive loads on high memory accept write-only pages and exclusive stores need only PROT_WRITE, matching x86-64 where writable pages are readable. sendmmsg and recvmmsg translate the name, control and io vectors of every message in the batch, return msg_len for each processed message and the received header fields for recvmmsg. Counted arrays passed to getgroups, setgroups, semop, semtimedop, io_submit, io_getevents, io_pgetevents, move_pages, futex_waitv and listmount are now checked to stay within one host range. The unused ToHost helper is removed. * Translate fixed-size, string and in-array guest pointers in high memory Give every syscall pointer without a length a fixed x86-64 size, a length read through another argument, or a terminator scan for strings, so spans crossing separately backed regions are refused before the kernel sees them. Size message queue buffers as the type word plus msgsz. Translate io_submit control blocks and their buffers, including vectored reads and writes, through bounded host copies, restore the guest words afterwards, and report guest iocb addresses back from io_getevents. Translate move_pages page lists for the calling process and futex_waitv addresses. Merge new mappings with matching neighbours. * Size high-memory syscall spans by kernel widths and embedded sizes Read counts with the width the kernel uses for each argument, so int and unsigned int counts ignore the upper register bits and negative counts reach the handler. Size capability data by its header version, perf and scheduler attributes, file handles and mount requests by their own size fields, and landlock rules by rule type. Keep the translated prefix of a message batch, read headers that span separate backings one by one, write results back through the current guest mapping, and stop counting messages whose length cannot be stored. Revisit an entry moved into an earlier slot while merging regions. Give newer syscalls fallback numbers in the test harness. * Send translated message batches one message at a time Submit sendmmsg batches that need scratch headers one message per call, storing each length before the next message goes out, so a length that cannot be stored stops the batch where Linux would. Skip the name length when no name was given and store flags before the control length. Check the whole fixed file-handle header even when its size is invalid. Hand capget and capset a private header so the checked data size matches the version the kernel reads, and return a rewritten version to the guest. Patch and restore AIO control blocks under the mapping lock and restore only the block that was patched. * Harden high-memory aio, capability and message batch write-backs Restore patched aio buffers through /proc/self/mem when the control block became read-only and keep the scratch vectors alive if that fails too, fault capability calls whose header write-back fails, stop send batches after a short message, and pin the batch socket with a private dup. * Pin batch sockets, fall back to whole batches and reconcile pending aio restores Follow-up message sends and the first dispatch share one duplicated socket. When it cannot be duplicated, the whole translated batch goes to the kernel in one call and lengths are written back up to the first one that cannot be stored. Short sends compare against the iovec lengths given to the kernel. Unrestorable aio_buf edits, including unreadable control blocks, keep their storage in a bounded list that later submissions reconcile. * Stop message batches at unreadable vectors, send singly without a spare descriptor and reserve aio restore slots A message whose iovec snapshot cannot be taken ends the prepared batch instead of being sent with an unknown length; when it is the first message the kernel handles the original array natively. When the batch socket cannot be duplicated, messages still go one at a time on the original descriptor with each length written before the next send. Pending aio restore slots are reserved under the pending mutex before the first guest edit and released or handed to the pending record, so concurrent submissions cannot exceed the bound. Tests use a real socket pair, injected descriptor exhaustion and concurrent reservations. * Send only the first message of a batch when the socket cannot be pinned * Replay high-memory faults over the whole access and reconcile aio restores on unmap * Keep high-memory traps ordered, fault-exact and locked against unmap Protect, Map and low mmap/munmap/mremap/mprotect reconcile pending aio restores at once, and io_submit reconciles them even when no high region is mapped. Ordered loads and stores split across backings are emulated between full fences instead of being byte-copied through the trampoline; atomics and exclusives are still refused. Gather and scatter use fault-safe copies, and a failing piece is re-faulted at the guest instruction through a probe load, with SIGBUS redelivered the same way. The VMA lock is held from planning until the scatter finishes, so unmap and protect cannot race a resumed access. Sign-extending loads are no longer classified as writes. * Defer user signals while guest high memory mappings are held Only the trampoline breakpoint completes a replay, user-sent SIGSEGV, SIGBUS and SIGTRAP raised while the mapping lock is held are requeued after it is released, and stranded control block words are restored when their page turns readable again. The harness now runs under a timeout. * Rebase the FEX patch series onto FEX-2612 * FEX: restore stranded aio words before readable protection, report failures Restore every pending aio word in the range before a readable guest protection is applied, on both the high and low paths, and fail the guest mprotect with the old protection kept when a word cannot be restored or its window cannot be closed. Ignore user-sent SIGSEGV/SIGBUS after deferral, read the cleared syscall info when resuming with guest GPRs and on restore, and check exclusive acquisition from a separate thread in the harness. * FEX: submit aio control blocks through private host copies Stop editing guest IOCBs in place when aio_buf needs translation. io_submit now hands the kernel a host copy of each such control block, maps io_event.obj back to the guest pointer when the completion is reaped, redirects io_cancel by guest pointer and context to the copy, and frees copies on reap, on io_destroy, or when the kernel did not accept them. The guest control block is never patched and its protection is never touched, so the pending restore records, the protection windows and the restore hooks in mmap, munmap, mremap and mprotect are removed with their tests. * fex: keep aio keys, cancels and reaped events native for copied control blocks Guest aio_key is no longer cleared before dispatch: the slot is probed with a same-value write and only the first n accepted copies get key 0 after the host io_submit returns n. io_cancel redirects to a copy only when the guest block is readable and its key is 0, so unreadable blocks fault in the kernel as before. io_getevents and io_pgetevents reap into emulator storage, translate and release copies there, then copy the events out, returning -EFAULT if that fails. A successful io_setup clears the ring header magic so userspace ring reapers fall back to io_getevents, where copies are translated and released. * fex: leave aio rejections, keys and unwritable event buffers to the kernel A copied control block whose key slot is read-only is now passed to the kernel as the guest's own block at the end of the list, so the kernel reports its native fd, eventfd or key error. After io_submit, guest keys follow the private copies through the first rejected position, and they are stored through a fresh translation of the guest address, skipped when it no longer maps. io_getevents and io_pgetevents probe the guest event buffer and reap at most its writable prefix, handing an unwritable buffer to the kernel so completions are not consumed. * Kept AIO completions and key stores stable against sibling remaps Wrapped event buffers go to the kernel unchanged. Direct reaps report guest control blocks and release copies only after the store lands. Guest stores and reads hold the mapping lock across translation and copy. Completions whose copy-out fails are stashed per context and delivered first on the next reap, and dropped on io_destroy. * fex: stage every AIO reap and keep stashed completions recoverable Hold the guest mapping for every high address, restore the caller's signal mask after thread-context holds, replace the fixed event stash with a per-context table that reserves space before dispatch, stage all reaps so control block identities are translated before copy-out, keep collecting ready completions once the stash meets min_nr, and restash events on every error except an interrupted delivery or a destroyed context. * fex: own AIO recovery storage before dispatch and bind it to the context lifetime Allocate the recovery node with the event buffer before the kernel consumes completions and hand the buffer itself to the stash when copy-out fails, so settling never allocates. Track each context by a generation that io_setup advances, so a destroy that finishes after a replacement context reuses the ring address only releases the old context's copies and stash. Drop the reservation cap so blocking reaps keep their min_nr. * fex: publish AIO contexts from private storage, keep their generation, wake blocked reapers for stashed completions * fex: wait for AIO events in bounded slices instead of wake markers, roll back setup by its own generation, fault unreadable io_setup output Blocked reapers wait in the kernel for at most 20 ms at a time and take stashed completions between waits until the guest minimum or timeout is met, so no eventfd or io_submit notification is needed. Deferred signals end the wait like EINTR. io_setup rollback uses the generation BeginContext installed, and an unreadable context output returns -EFAULT before dispatch. --------- Co-authored-by: StonkGuy <68372320+StonkGuy@users.noreply.github.com> Co-authored-by: StonkGuy <StonkGuy@users.noreply.github.com> |
||
|
|
f17406effc | Bind a spill to the resume count it was asked under and report a resume only once memory is back | ||
|
|
ad6bb159d3 | Write a sleeping session's memory to storage instead of zram | ||
|
|
80dbec57d7 |
fix(preload): Steam's overlay finds the robust list in Wine games without proot (#3577)
thread_robust_head() read the candidate list heads with process_vm_readv(getpid()).
In Wine games run without proot, and in any process whose first thread has exited,
that read fails with ESRCH, so the emulated get_robust_list answered ENOSYS and
Steam's arm64 gameoverlayrenderer.so aborted the game ("futex robust_list not
initialized by pthreads"). The read now goes through gettid().
|
||
|
|
72c8b8426d |
fix(input): Windows games see the gamepad again when the pad is not read through SDL (#3469)
Since each pad was described to Wine's udev backend with the identity its SDL backend sees, the udev backend left every pad to SDL. Where SDL does not open the pad, such as a session without proot, Windows games lost both the gamepad and the on-screen controls. The udev backend owns the pads again with the Steam Input identity it had before. SDL inside Wine's bus driver now reads the same identity for those pads and skips them as it skips any Steam Input pad, so each pad is still listed once and both triggers keep reading together. |
||
|
|
780c5658d0 |
fix(input): each pad is listed once in Windows games so both triggers read together (#3436)
* fix(input): each pad is listed once in Windows games so both triggers read together A pad that Wine's SDL backend also reads was described to Wine's udev backend as a Steam Input virtual pad, so Wine built two devices for one pad. SDL RawInput games could not match the two and read held triggers as released. The pad now keeps the identity the SDL backend sees unless that backend is told to skip it. Rumble that Wine starts through SDL is now held until the next update, matching the udev path, instead of stopping after one second. * fix(input): hold only the rumble Wine starts through SDL, not later SDL rumble in the same process * fix(input): read @file SDL ignore lists when choosing the pad identity SDL reads the ignore and except lists from a file when the value starts with @. Match the ring pad ID against that file's contents too. * fix(input): parse SDL controller ID lists the way SDL does when choosing the pad identity |
||
|
|
d9a9f9fed7 | fix(zram): find the control files under the native userland root (#3293) | ||
|
|
238ef76c5c |
fix(preload): apps that reload libudev no longer crash in the input wrappers (#3180)
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. |
||
|
|
f934feb457 |
fix(input): Remote Play connects again after the controls revert (#2968)
#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. |
||
|
|
7630173b24 |
fix(ddsession): keep path and status buffers off the wrapper fast path (#3071)
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> |
||
|
|
a03ec8eb57 |
Session preload: leave programs a Chromium app starts from its own folder alone (#3121)
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. |
||
|
|
d967dd03a3 |
fix(desktop): Electron and Chromium apps start however they are launched (#3106)
* fix(desktop): Electron and Chromium apps start however they are launched The session preload only added --no-sandbox when the program path itself sat beside chrome-sandbox, so a PATH link such as /usr/bin/vesktop was missed and the app aborted on the setuid sandbox. It now resolves the path and also checks the parent folder, and adds --ozone-platform=x11 when an X display is set, since Wayland cannot open the GPU stand-in. The desktop menu overrides that added the same flags are removed: they covered only menu launches made after the desktop started, and the preload now covers every launch. Stale overrides are cleaned up by the existing marker check. * fix(preload): execvp checks the program found on PATH for the Chromium flags * fix(preload): the PATH lookup prefers the program execvp would run |
||
|
|
366afa6b73 |
fix(desktop): an arm64 AppImage started directly runs like one opened from the file manager (#3108)
* fix(desktop): an arm64 AppImage started directly runs like one opened from the file manager Without proot a guest program starts through the dynamic loader, which refuses the nonzero ABI version byte that marks every type 2 AppImage, so running an arm64 AppImage from a terminal or from a menu entry that names the image failed with "ELF file ABI version invalid". The preload already hands foreign programs to droiddeck-open; AppImages now go there too, where they are unpacked and started as the file manager does. * fix(desktop): hand off only AppImages that carry a filesystem, never a bare runtime |
||
|
|
15b1e196af |
fix(remote-play): the decoder reports a changed stream size, so fullscreen streams are not cropped to a corner (#3095)
* fix(remote-play): the decoder reports a changed stream size, so fullscreen streams are not cropped to a corner * fix(remote-play): capture buffers are sized for large streams up front and a size change reopens only the app decoder * fix(remote-play): reject out-of-range scaling deltas and an SPS that ends before its frame flag |
||
|
|
3b8b14b06c |
fix(session): FEX and AppImage extraction no longer hang at start-up (#3070)
The clock pause preload opened its control file on the first monotonic clock read. A program whose allocator reads the clock while holding its own lock, as FEX does while it starts, re-entered that allocator through the open wrappers and deadlocked. The control file is now opened only in the preload's constructor, so a clock read never opens a file. |
||
|
|
2c2d55058e | fix(preload): open synthesized socket tables when the fd reopen is denied (#3034) | ||
|
|
ff5e4c7ac7 |
fix(preload): accept NETLINK_ROUTE multicast subscriptions (#3015)
* fix(preload): accept NETLINK_ROUTE multicast subscriptions Programs that watch for network changes bind their route socket with multicast groups or join them with NETLINK_ADD_MEMBERSHIP. The emulated socket refused both with EACCES, and .NET's NetworkChange treats that as fatal: CurseForge's Mods Agent failed to initialise with "Permission denied" from NetworkChange.CreateSocket(), so the app never loaded its library. Real Linux lets unprivileged sockets join rtnetlink groups. Accept the groups at bind and through ADD/DROP_MEMBERSHIP, report them from getsockname(), and keep queries on the same socket working. No change events are generated yet; queries still return the current snapshot. * fix(preload): keep netlink group membership in the shared socket state Memberships now live in the peer metadata the kernel holds for the socket, next to the port and cap ack, so they survive exec and a change made by one process after fork is seen by every process holding the socket. * fix(session): answer denied /proc/net socket tables Android's SELinux policy denies app processes every file under /proc/net. .NET lists TCP listeners from /proc/net/tcp and tcp6 before it binds a server port, so the CurseForge Mods Agent failed on every port with "An error was encountered while querying information from the operating system" on stock firmware. Denied tcp, tcp6, udp and udp6 reads now get a header-only table, through open and openat as well as fopen, the same way the route and interface tables already are. * fix(session): keep synthesized socket tables read-only and file-only Reopen the populated table read-only instead of duplicating its writable descriptor, and leave O_DIRECTORY opens with their original failure. |
||
|
|
a8d03d687f | fix(input): SDL 3 games no longer crash on the virtual pads' udev devices (#2915) | ||
|
|
183cbd9351 |
fix(preload): start apps that check for a single thread and stop the first-call allocation hang (#2995)
* fix(preload): look up the native glibc symbol version first so wrapped calls never allocate On x86 the first dlvsym lookup asked for GLIBC_2.17, which only exists on arm64. The failed lookup makes glibc allocate, which deadlocks when the first wrapped call happens inside a program's own allocator setup. Each architecture now asks for its base version first. * fix(zram): start the page-out worker per request instead of keeping a thread in every process Every process that loaded the session preload carried a resident zr-worker thread from its constructor on. Programs that check they are single-threaded before forking or before unshare(CLONE_NEWUSER) failed, for example Chromium's zygote, which could not start its GPU process. The signal handler now starts the worker with a raw clone on a stack the preload maps itself. The worker makes only raw system calls and exits when no request is left, so starting it from the handler is safe and idle processes stay single-threaded. When the worker cannot be started, the process trims inline in small steps as before. * fix(preload): start the page-out worker with the same clone flags as a thread Programs that filter clone to the flag set threads use, as browser sandboxes do, now accept the worker. The kernel clears the stack-busy word and wakes waiters when the worker exits. * fix(preload): page out inline in single-threaded and self-sandboxed processes A process with one thread may be about to check that it is single-threaded before fork or unshare, and a process that added a seccomp filter after it started may trap system calls into its own handler. Neither gets a worker thread now; both trim inline in small steps as before. * fix(preload): check the signalled thread's own seccomp filters before starting the worker Read Seccomp_filters from /proc/thread-self/status so a thread that installed its own filter without TSYNC trims inline instead of calling clone under that filter, and fall back to the inline path when the signal mask cannot be changed. * test(preload): start parked threads with SIGURG already blocked * test(preload): count only page-out workers when checking for leftover threads |
||
|
|
f29f72d5d9 | fix(input): restore Steam controller reattach (#2963) | ||
|
|
9925873764 | revert(input): restore pre-overhaul controls (#2958) | ||
|
|
a3e8b44145 |
fix(input): Remote Play connects again with the virtual pads present (#2946)
Since #1593 every process except the Steam client gets DroidDeck's udev answers through dlsym. Steam's Remote Play client, streaming_client, is an SDL3 program: for each input node it treats as a joystick, SDL3 asks udev_device_get_driver for the device that udev_device_new_from_devnum returned. The preload answered new_from_devnum with its own handle for a virtual pad but did not answer get_driver, so the real libudev read the handle as its own and streaming_client crashed before the stream opened. It reaches that call whenever it can stat a pad node: the Xbox 360 pad, Steam's own uinput gamepads, and since #2033 the pads it reads. streaming_client now keeps the real libudev like the Steam client, and a virtual pad answers get_driver with no driver, so other SDL3 programs no longer crash on it. |
||
|
|
d7f43c26cd |
fix(input): Steam finds a DualShock or DualSense chosen mid-session (#2942)
* fix(input): Steam finds a DualShock or DualSense chosen mid-session Android lets an app open a uevent netlink socket but not join its multicast groups, and libudev joins none when no udev daemon runs, so the udev monitors Steam's SDL opens heard nothing and the pad switch's add and remove events reached no one. SDL only noticed a new PlayStation pad when the old one happened to fail a read. A monitor left without a subscription is now swapped for the session's stand-in under the same descriptor, so it receives the injected events. * test(preload): stub the udev monitor bind hook in the CDP guard build |
||
|
|
c4f4e18f87 | fix: the virtual pads reach non-Steam programs, where udev is resolved through dlsym (#1593) | ||
|
|
f2d8e9e837 | perf(storage): answer repeated SD library checks from the directory cache (#2881) | ||
|
|
adf13d0bdd |
feat(session): manage memory automatically and remove the manual memory controls (#2853)
Memory in the Steam session is kept above a floor by a monitor instead of the zRAM, RAM cap and VRAM cap settings, which are removed. |
||
|
|
eabcfc7b74 |
chore: consistent code branding (#2800)
* chore: consistent code branding * fix: carry legacy overrides, queues and live sync rows across the rename * fix: keep queued legacy overrides on a failed rename and separate merged queue entries |
||
|
|
812e492302 |
fix(zram): page game memory out on a worker thread, not the signalled game thread (#2335)
* fix: move zram page-out off signal thread * fix: drain pending zram requests * Time the async and inline page-out runs on the same workload * fix(zram): keep pageout worker responsive under load * test(zram): synchronize signal delivery before fixture shutdown * test(zram): compare matched single-request timings * test(zram): correct single request timing control * test(zram): calibrate single request timing together * test(zram): fail the timed run when the acknowledgement never arrives |
||
|
|
b1a7d9b2d0 | fix(preload): leave anonymous memory alone when copying noexec image pages (#2706) | ||
|
|
f65e7a3d43 |
fix(preload): Windows games run from noexec shared storage under every Proton (#2594)
* fix(preload): Windows games run from noexec shared storage under every Proton When mprotect(PROT_EXEC) on a private mapping is refused, libblsession moves the pages into anonymous memory and retries, so Wine can make an image's code sections executable on noexec mounts. FEX keeps its existing handling. * fix(preload): copy noexec image pages without faulting or dropping access * fix(preload): install copied image pages with final permissions |
||
|
|
a20528c62b |
fix(preload): 32-bit x86 programs get correct large-file stat, open, write and lock results (#2592)
The session preload is also built for i386 and preloaded into every 32-bit x86 program under FEX. There it aliased fstat64, ftruncate64, pwrite64, fallocate64, posix_fallocate64, open64, openat64 and fcntl64 to their 32-bit hooks, which on i386 take a different struct layout or argument size. fstat64 returned a size with garbage high bits, so libdbus rejected a valid 33-byte /etc/machine-id as too large and aborted the program. The aliases now exist only where off_t is off64_t; on i386 the 64-bit calls reach their own glibc functions, keeping the open and lock hooks. |
||
|
|
cd945a520a |
fix(dircache): Steam no longer deadlocks when a library below calls back in (#2560)
With "Run without proot" on, the Steam client hung about a second after login and aborted three minutes later with "fatal stalled cross-thread pipe". The directory cache holds its lock while it adds an inotify watch. Without proot that call reaches the native userland hook, whose inotify_add_watch creates a missing directory with mkdir() by name. That mkdir resolves to the cache's own wrapper, which waits for the same lock on the same thread. Steam's IPC threads then queue behind it. The cache now counts the locks each thread holds. While a thread holds one, calls that come back into the cache (opendir, the change wrappers, created files, missing-name checks, closedir of a stream it did not open) go straight to the next library. The same guard covers the hook's remove(), which calls unlink() by name while the cache's remove wrapper holds its operation lock. |
||
|
|
01bfe8519e | fix(session): preserve guest monotonic time after long pauses (#2393) | ||
|
|
a7bd6ed299 | fix(venus): drop LIBGL_KOPPER_DISABLE without calling the guarded unsetenv (#2441) | ||
|
|
b3c61cf0bf |
fix: permissions set by Windows programs are kept on SD cards (#2504)
* fix: keep file permissions set by Windows programs on volumes without extended attributes Wine's server stores a file's security descriptor in an extended attribute. Volumes that cannot hold one dropped every descriptor, so a program that checks and repairs its install folder's permissions repeated the repair on every start. The descriptor is now kept inside the prefix when the volume refuses it, and follows the file when the server renames or deletes it. * fix: a path deleted with remove() drops its kept descriptor too |
||
|
|
2848484a99 |
feat: fuck proot and proots mama (#2300)
* feat: experimental native userland that runs the Linux side without proot * fix(native): keep the visible name of link2symlink binaries * fix(ci): run the native hook build through bash * fix(native): address review findings in the hook and the ctl fallback * fix(ctl): use the broadcast fallback only when content is missing * fix(native): survive Android's seccomp filter in ld.so, libc and posix_spawn children * docs(native): how to test under Android's seccomp filter * fix(session): hide an unlistable /sys/bus/pci/devices so libpci does not abort Chromium's GPU init * fix(native): nested syscall() redirects no longer loop with libblsession's openat2 * fix(native): controllers reach Steam and the install-script evaluator no longer blocks game moves * fix(native): write the hook's NUL character literals as escapes * fix(native): proot fast path turns off and greys out while running without proot * fix(native): D-Bus logins work and Xwayland still admits root once peers read as root * fix(native): scripts on session mounts outside the rootfs run with the rootfs shell * fix(native): games on the SD card library start in their own folder * fix(native): Wine drive links proot made point at their real places * fix(native): at-calls, uid lookups and relative programs follow the session's mounts * fix(native): close-from in spawned programs covers what is open at the spawn * fix(native): service names resolve and the DNS fallback answers what was asked * build(native): the hook is built with its Go support and tracked by the preload recipe * fix(native): drive links into identity mounts stay, and relink and seccomp patch failures are logged * fix(native): seccomp-sim's filter holds every allowed call * fix(ctl): the broadcast fallback only stands in for a missing content command * fix(native): pre-2.33 glibc stat calls present owners as root too * fix(native): res_init and res_ninit call glibc, so Steam's store resolves names * fix(ci): a preload lock older than a new output rebuilds that group, and generated headers are not hashed * fix(native): a second seccomp patch run leaves other system calls alone * fix(native): the terminal and bottom desktop keep proot's environment in a native session * fix(native): any number of session mounts, and openat2 relative to a mounted folder * fix(agent): a native command's stdin is written beside its timeout * fix(ctl): native rejects --env without = and timeouts outside 0-600 s * fix(native): the resolver fallback has the network's IPv6 servers, and lookups keep the fallback's validation errors * fix(native): a spawn whose dup2 source close-from closed fails with EBADF * fix(native): __getcwd_chk checks its buffer, and seccomp-sim -a takes only call numbers * feat(native): guests see the session hostname from uname and gethostname * feat(native): the terminal and bottom desktop run without proot * fix(components): an origin APK without a newer preload output still proves the rest * fix(native): seccomp-sim -a rejects empty fields * fix(native): gethostbyname no longer answers failed lookups with Ubuntu and Debian addresses * feat(native): store installers, root helpers, Comet and Xodus run without proot * fix(native): the hook finds libraries, preloads and itself through a sandbox's mounts, and ldconfig -C makes its cache * feat(native): Flatpak sandboxes run without proot, and apply_extra runs without a runtime * fix(native): remove, glob and nftw take guest paths, and links in a mount are followed as the guest sees them * fix(native): Flatpak sandboxes get the session's mounts, their libraries' RUNPATHs, and no rootfs-only settings * fix(native): gethostbyname asks the network's DNS servers, nftw of / gives single slashes, and the library path fits mapped directories * fix(native): a native process starts in its working directory's real place * fix(native): the library path given to ld.so holds whole directories only * fix(native): Wine drive links keep their guest paths, so proot finds the library after a native session * fix(native): droiddeckctl native prepares the rootfs with the setting off * fix(native): a SysV segment stays while any process has it attached * fix(native): DNS lookups ask the network's own servers before public ones * fix(native): a program's own seccomp traps reach its own SIGSYS handler * feat(native): run native sessions under a device's own app seccomp filter for testing * fix(native): SysV attaches and collection take a lock, a failed mark fails the attach, and collection closes its directory * fix(native): shmat fails when it cannot take the segment lock * fix(native): the SysV segment lock is retried when a signal interrupts it * fix(native): process tools see the session's processes as root's * fix(native): native processes are named after their program, not ld.so * fix(native): a session's helpers keep the mode the session started in * fix(native): a keyed SysV segment stays until IPC_RMID * fix(native): a rootfs link to an absolute guest path is followed in the guest, so Wine finds its z: drive * fix(native): a sandbox whose loader can't be patched runs under proot * fix(native): creating a private SysV segment also collects stale ones * fix(native): a session stopped during startup forgets its mode * fix(xbox): a native backend is authorized by its process ancestry * fix(native): Wine's drive links are followed in the guest from any prefix * fix(native): only the startup that owns the running session publishes its mode * fix(native): a SysV segment stays until IPC_RMID even after its maker ends * fix(native): a sandbox mount nested in another mount gets its own place * fix(native): a sandbox whose mount places can't be made runs under proot |
||
|
|
055e2ec78f |
Fix Electron Node mode sandbox injection (#2418)
* Fix Electron Node mode sandbox injection * fix(preload): treat any nonempty ELECTRON_RUN_AS_NODE as Electron Node mode |
||
|
|
92742f37c1 | fix(preload): answer netlink requests sent with write and writev (#2304) | ||
|
|
a33954b8bd |
perf: answer Steam's missing-file checks on SD and USB libraries from the directory cache (#2212)
* perf: answer Steam's missing-file checks on FUSE libraries from the directory cache Before creating and committing each file, the Steam client checks whether it already exists under its exact, lower-cased and folded spellings. On an SD or USB library reached through Android's FUSE layer every one of those misses is a round trip to MediaProvider (Brawlhalla: about 65,000 misses, 92 of the 161 s of preallocation and 60 of the 93 s of commit). The client already caches the listings of its steamapps directories on FUSE and keeps them exact through its own changes, inotify and a short TTL. access() now answers a name that is absent from a live listing of its directory without asking the filesystem. Directory paths match case-insensitively only when the library's filesystem folds case, and names compare case-insensitively, so an existing file is never reported missing. * fix: reuse a listing for a differently cased folder only when the whole path folds case Checking that steamapps alone folds case let a listing of one folder answer for a different folder below it whose name differs only in case. The fill now compares the listed folder with its fully case-swapped path below steamapps, so a listing is reused across case only when the filesystem folds every level. * fix(dircache): match a folded listing only below the same prefix and skip it during a tracked change * fix(linuxfs): a folder renamed or removed above a cached listing drops that listing * fix(linuxfs): watch the folders above a cached listing so a rename or removal by any process drops it * fix(linuxfs): also watch the folders above steamapps, and stop a stuck probe from hanging the tests * fix(linuxfs): a listing under a symlink or an unwatchable folder no longer answers absent lookups * fix(linuxfs): a symlink check that cannot be watched also stops absent answers * fix(linuxfs): a differently cased lookup reuses a listing only for the same folder |
||
|
|
a123af7c13 | fix(script-run): run x86 programs a native script starts through FEX (#2217) | ||
|
+1 |
3733c50902 |
feat: non-Adreno graphics stack (Venus, open driver pairs, gamescope patches) (#2029)
* Retain compositor resources when GPU completion is unconfirmed * Stop quarantined GPU callers before retries and mapped writes * Support Android hardware-buffer presentation over Wayland * Support PowerVR swapchains and linear image imports in Gamescope * Bundle verified PowerVR graphics components through existing build preparation * Detect and select the system Vulkan backend on PowerVR * Apply PowerVR Steam and game compatibility during normal launches * Show PowerVR support through existing driver and component controls * Update existing hardware guidance for system Vulkan support * Import the shared system Vulkan readiness check * Discover and propagate the actual PowerVR render node * Prune obsolete PowerVR runtimes after guest processes exit * Retain external DMA-BUF ownership after GPU quarantine * Name the PowerVR HAL selection explicitly * Isolate component UI tests from application startup * Cover the inherited FEX preset in PowerVR profile tests * Log test worker failures for CI diagnosis * Remove temporary test logging after diagnostic CI * Prefer system dependencies for the Android Vulkan loader * Capture raw stderr before test worker termination * Remove the temporary test worker crash probe * Import pinned DXVK recipe prerequisite from PowerVR PR570 Copy only the standalone build recipe, source pin, BC-format prerequisite and presentation-sync patch/check from wallentx/DroidDeck at |
||
|
|
6a5722c6d1 |
fix(preload): answer NETLINK_ROUTE queries inside a session (#2141)
* fix(preload): answer NETLINK_ROUTE queries inside a session ip(8) could not run in a session: the app's SELinux domain has no netlink_route_socket bind permission, so iproute2 failed at bind and never saw the link that getifaddrs() and /proc/net already expose. Serve NETLINK_ROUTE from the same etc/droiddeck-net snapshot: an AF_UNIX socketpair backs the netlink fd, link/addr/route dumps and route get are synthesised, writes return EPERM, and multicast subscriptions keep failing with EACCES so consumers that wait for link events keep their fallback. Replies carry the port id reported by getsockname() and recvmsg() rewrites the source address to AF_NETLINK/pid 0. iproute2's dump loop requires both before it accepts a message or NLMSG_DONE; when either is missing every message is skipped silently and the process blocks in recvmsg(). * fix(preload): keep socket() and send() semantics for emulated netlink * fix(preload): deliver netlink replies with the caller's blocking mode * fix(preload): preserve NETLINK_ROUTE protocol and fd semantics - Send ACKs for successful queries and honor NETLINK_CAP_ACK - Reject unsupported subscriptions and apply socket timeouts - Track socket identity and shared references across dup and close - Support kernel connect and rewrite recvfrom source addresses - Resolve local and connected routes before default gateways - Add netlink and iproute2 regression tests * fix(preload): handle netlink request limits and socket lifecycle - Collect large sendmsg requests without falling back to UNIX sockets - Reject oversized replies explicitly instead of returning partial results - Allocate unique port IDs and reject duplicate bindings - Honor socket flags and restore inherited sockets across exec - Validate socket types and report netlink socket identity - Replace the fixed socket table with a dynamic registry - Add regression tests for batching, port conflicts and exec inheritance * fix(preload): optimize netlink tracking and support link name queries - Add lock-free fd tracking to bypass netlink locks on ordinary sockets - Move descriptor restoration to initialization and explicit discovery paths - Support RTM_GETLINK lookups via IFLA_IFNAME with correct error codes - Add regression coverage for hot-path overhead and name-based queries * fix(preload): accept unterminated netlink interface names - Copy IFLA_IFNAME into a bounded, NUL-terminated buffer before lookup - Match kernel string length validation and ERANGE errors - Add regression coverage for unterminated names and boundary cases * fix(preload): pin peers for netlink replies * fix(preload): make autobind idempotent * fix(preload): isolate forked netlink cleanup * fix(preload): avoid interposed fd scans * perf(preload): skip PID checks for untracked fds * fix(preload): verify peer before replay --------- Co-authored-by: uubooster-team <uu.booster@service.netease.com> |
||
|
|
b9dbd006be |
fix(storage): Windows installs on a natively mounted card no longer ask for an administrator (#2100)
* fix(storage): Windows installs on a natively mounted card no longer ask for an administrator Cards mounted directly as FAT, exFAT or NTFS were not treated as Android storage, so wineserver reported an Anonymous owner and refused permission changes. Its chmod on these volumes also no longer fails the request. * fix(storage): keep NTFS owners and the chmod error |
||
|
|
ad0d39f457 | fix(quest): gamescope no longer aborts at start with vk.WaitSemaphores -13 (#1938) | ||
|
|
4b8f63d84d | feat: Mali Vulkan support through MaliBridge (#2027) | ||
|
|
3dcb3eac42 | chore: revert the Mali Vulkan squash to re-land it with history (#2026) | ||
|
|
1f91283f40 | feat: Mali Vulkan support through MaliBridge (#1950) | ||
|
|
c43a493ad8 | preload: set PR_SET_CHILD_SUBREAPER so double-forked Xwayland is not orphaned to init (#1716) | ||
|
|
8171bf20fd | Merge latest origin/main and resolve conflicts |