mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-12 03:21:08 +00:00
4.0 KiB
4.0 KiB
proot patches carried by the app
Built by tools/proot/build.sh with the NDK on top of termux/proot 4dba3afb (Termux's
5.1.107-70 package, the proot the Linux runtime ships at opt/android-host/proot; every
file.c:line site in that binary matches this commit). talloc is linked in statically from
Samba's release tarball, so the apk carries one self-contained libproot.so plus
libproot-loader.so, and LinuxRuntime prefers them over the runtime's copy.
Ported from WinNative (feature/proot-enhancements, e7af0f24):
0001-tracee-lookup-by-pid.patch- tracees are hashed by pid, so each ptrace stop finds its tracee without walking one list entry per thread, and terminated tracees are swept only after a termination.0002-canon-resolve-parent-at-once.patch- a clean absolute guest path at least three directories deep under the rootfs binding alone has its parent opened once withO_PATHand taken as canonical when/proc/self/fdnames the path proot would build, replacing anlstatper component. The final component of a call that does not follow it is no longerlstated. Extensions still see the parent's host path, and the fast path stays off while the f2fs workaround is active.0003-clone3-flags-read-guard.patch- a thread created withclone3keeps the flags it inherited whenstruct clone_argscannot be read, instead of being tracked as a fork.
Ported from WinNative (main, 53836ca9, "Fix/performance and vac"):
0004-seccomp-filter-by-argument.patch- the seccomp filter tracesprctlonly forPR_SET_DUMPABLE,setrlimitonly forRLIMIT_STACKandprlimit64only when it sets a newRLIMIT_STACK, the only cases proot acts on; every other call runs without a stop.unameis traced by the core only on x86_64, the one arch it rewrites; kompat still adds it for--kernel-release.0005-seccomp-skip-unneeded-sysexit.patch- a seccomp stop fetches the registers once and looks the filter flags up by syscall number, instead of aPTRACE_GETEVENTMSGand a second register fetch. The flags table is built from proot's list merged with the enabled extensions' (kompat and fake_id0 here), so it is exactly what the filter reports.wait4/waitpidleft to the kernel andaccept/accept4without a sockaddr skip their exit stop, unless an extension replaced the syscall (kompat turningaccept4intoaccept).0006-clone3-exit-signal.patch-clone3flags and exit signal are read as the 64-bit fields ofstruct clone_args, so aclone3fork is told apart from a thread when proot decides how the child is traced.0007-proc-self-thread-group.patch- tracees track their thread group,/proc/selfnames it instead of the calling thread, and/proc/thread-selfresolves to/proc/<tgid>/task/<tid>.0008-fchmodat2-openat2.patch-fchmodat2paths are translated (honouringAT_SYMLINK_NOFOLLOW),openat2answersENOSYSso callers fall back to the translatedopenat, and syscall numbers past the end of a table are rejected instead of read.0009-tracee-relatives-sweep.patch- tracees count their children, so a terminating thread with no children or ptracees no longer walks every tracee; the per-stop memory collector is emptied instead of freed and reallocated.
Added by DroidDeck:
0011-kompat-utsname-only.patch---kernel-release(the guest'sDroidDeckhostname) loads kompat, whose filter trapsfutex,fcntl,epoll_pwait,pselect6,pipe2,eventfd2,socketand more, and which stripsAT_SYSINFO_EHDRon everyexecve, so glibc runs without the vDSO. When the virtual release is not older than the real kernel and the hwcap is left alone, every one of those handlers is a no-op: kompat now traces onlyuname,sethostnameandsetdomainnameand leaves the auxv as the kernel wrote it. On an SD 8 Gen 2 guest this took a futex ping-pong from 467 to 97 us,epoll_pwaitfrom 60 to 0.8 us andfcntlfrom 40-107 to 0.4 us, andclock_gettimeback to the vDSO.