libkernel: execv/execve and the setuid/setgroups/setrlimit family are absent (XPSemu, PS5MC); fix branch ready #3558
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T13:11:49Z.
libkernel lacks
execv(KaK52lYTBIs) andexecve(kdguLiAheLI), and the identity and limit setterssetuid(JVmUZwK-HJU),setreuid(6w8tPp+Yk6E),setregid(ROILLZdYZPc),setgroups(M8VZ3iIlmyg) andsetrlimit(4X0QwvuCfjc). From the relink registry orderexecv/execveare the predicted next stop of XPSemu (PPSA97358) and the setters follow for XPSemu and PS5MC (PPSA99420); not yet observed in a run.Fix branch ready:
screamm:feat/libkernel-exec-setuid(two commits onmaina11c8f7f:57f0fa37feat(libkernel): implement execv and execve as throwing exports,1d0b2b61feat(libkernel): implement the identity and limit setters). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commits as they are.execv/execvefollow theexecvpprecedent of #2827: FreeBSD's checks first (EFAULTfor a null argv or path,ENOENT/ENOTDIRfrom the guest lookup,EACCESfor a non-regular file), then theexecutable replacement not implementedthrow where FreeBSD would load the image; over-long paths and oversized argument blocks throw rather than guess. XPSemu'sexecvsites run in aforkchild and itsforkreturnsENOSYS, so likeexecvpthey are not reached at start-up (ZiZc3/XPSemu8eec07b4). Sources: FreeBSD8c639945kern_exec.c,exec.c.kern_prot.c/kern_resource.c: ids 0 (or -1 unchanged) succeed, any other id throws (the console's credential rules are unmeasured);setgroupstakes{0}or the empty set (EINVALabove 1024,EFAULTfor a null list with a count) and marksissetugidas changed as FreeBSD does;setrlimitreturnsEFAULT/EINVALas FreeBSD orders them, treats negatives as infinity, lowers a soft limit above the hard one to it, and succeeds only when the result equals whatgetrlimitreports (RLIMIT_DATA), otherwise throws becausegetrlimitstores nothing. Note for XPSemu: itsos_setup_limitscallsgetrlimit(RLIMIT_NOFILE)first, which still throws onmain, so that is its real next stop there.guest_execvp,guest_credentials,guest_getrlimitgain the new cases.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs: the three tests 3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"533/536, the failures being the knownwindows_exceptions(#3411),guest_kernel_sys(#3510) andguest_filesystem(#3518); withmain'sProcess.cppall three extended tests fail;tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T14:01:59Z.
Independent verification on Linux (the gap noted in the report): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.main— no rebase needed, the commit (1d0b2b619) is unchanged.tools/check_conventions.py --base origin/mainandgit diff --checkpass.The branch is also mirrored at
blawesom:verify/3558for anyone carrying.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T20:11:28Z.
Every export this issue lists is on
mainnow (checked atdacd78525), so it can be closed:execv: #3544execve: #4105setuid,setreuid,setgroups: #3893setregid: #4595setrlimit: #3980All of them are in
core/libs/prx/libkernel/System/src/Process.cpp.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T00:09:13Z.
Closing: all seven are on main (#3544, #4105, #3893, #4595, #3980). If a title still stops on one of them, comment here.