Commit Graph
12 Commits
Author SHA1 Message Date
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Dean 39e971a2ea Merge pull request #8985 from MarcZX10/codex/groups-pointer-safety
fix(libkernel): return EFAULT for invalid group pointers
2026-10-23 14:05:39 +13:00
slopggobblercobbler81 d28c74af94 feat(libkernel): implement setresuid and setresgid
Follow FreeBSD 11.4 sys_setresuid and sys_setresgid (sys/kern/kern_prot.c):
accept real, effective, and saved user and group IDs for the guest process,
which is assumed to run as root with IDs 0. Setting an ID to 0 or -1 (unchanged)
is accepted without changing credentials and returns 0; any other value throws.
Cover both in guest_credentials test and update libkernel debt documentation.
2026-10-21 17:25:25 +02:00
MarcZX10 67db9d371f test(libkernel): cover invalid group credential pointers 2026-10-21 08:31:59 +00:00
MarcZX10 30167dace1 test(libkernel): cover invalid getresid output pointers 2026-10-21 08:08:39 +00:00
slopggobblercobbler81 aab806939e feat(libkernel): implement getresuid and getresgid
Follow FreeBSD 11.4 sys_getresuid and sys_getresgid (sys/kern/kern_prot.c):
retrieve real, effective, and saved user and group IDs for the guest process,
which is assumed to run as root with IDs 0. Pointers that are not null receive 0,
null pointers are ignored, and 0 is returned leaving errno unchanged on success.
Cover both in guest_credentials test and update libkernel debt documentation.
2026-10-21 06:56:42 +02:00
pushkarreddyy a1b6caaf0a feat(libkernel): implement setgid 2026-10-19 20:41:52 +05:30
xXPBSXxandClaude Sonnet 5.5 b5d0d7bfbb test(libkernel): cover getgid and issetugid
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-16 07:02:18 +02:00
jagrat Singh 057b8108b3 feat(libkernel): implement setregid
Follow FreeBSD sys_setregid and root identity model: accept real and effective group id 0 or -1 (unchanged) and change nothing; any other id throws. Update GuestCredentials test and TechnicalDebt.
2026-10-13 00:25:13 +05:30
MarcZX100 b6f96f8e90 test(libkernel): extend existing credential regression coverage 2026-10-11 18:55:56 +00:00
Mouad-Scriptz-0 bc5bfd0ed6 feat(libkernel): export setuid, setreuid, setgroups and getgroups
`setuid`, `setreuid` and `setgroups` are absent imports of XPSemu
(PPSA97358) and PS5MC (PPSA99420) on `main`. The guest process is modelled
as root with ids 0, as `seteuid` and `setegid` already assume: `setuid`
accepts 0 and `setreuid` 0 or -1 per id and change nothing, any other id
throws. `setgroups` keeps the supplementary group list as FreeBSD's
`kern_setgroups` does (`NGROUPS_MAX` 1023, an empty list leaves the
effective group as the only entry, a first entry other than 0 throws) and
the new `getgroups` reports it. `guest_credentials` covers the accepted
ids, the default list, a set list, an empty list and the EINVAL/EFAULT
cases.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
(cherry picked from commit d12b062074dcf64bff694800d77f7261adf6f59e)
2026-10-11 18:55:22 +00:00
Daniel Radosa 1414b27d29 feat(libkernel): implement seteuid and setegid
The guest process is assumed to run as root. Under FreeBSD's
sys_seteuid and sys_setegid, id 0 is then accepted without a privilege
check and changes no credential, so both return 0. Any other id would
change the effective credential, which is not modelled, and throws.

Part of #1578.
2026-10-09 19:14:02 +02:00