mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 12:35:42 +00:00
* fix(native): reopen refused memfds and answer links in the form they are named Android's app policy refuses the open permission on memory files, so a read-only reopen of an own memfd through /proc/self/fd/N, /proc/thread-self/fd/N, /proc/<own pid or thread>/fd/N or /dev/fd/N failed with EACCES while read, write and mmap of the descriptor still worked. The hook now answers such a refused read-only open with a new memfd holding the same bytes, name, mode and seals. Writable opens, other processes' descriptors and regular files stay refused. FEX routes guest openat through libc syscall(), so x86 guests get the same answer. readlink() stripped the rootfs prefix from every target, so a link stored with a real target (Proton's s: drive) read as /root/... while getcwd(), /proc/self/fd and /proc/self/maps give the real path, and a path resolved through the link no longer matched the working directory. A link named by its real rootfs path, and /proc/<pid>/cwd, now keep the real target, as realpath() of a real path does; guest and relative names keep the guest form. * fix(native): keep the memfd copy read-only, leave openat2 errors native, keep guest form for remapped link names The copy that answers a refused read-only memfd reopen is now sealed against writes and resizing, so it cannot be written through as a read-only descriptor could not. openat2 reads its open_how only after the kernel refused the open with EACCES, so an unreadable pointer gets the kernel's EFAULT. readlinkat and fstatat keep the guest form for a relative name the hook remapped to a real path; only a name the caller supplied in real form keeps the real target. * fix(native): pin the memfd being copied and refuse copies that cannot match it * Copy a refused memfd only when the path and the descriptor name one file