Commit Graph
192 Commits
Author SHA1 Message Date
Dean 0306b66963 Merge pull request #10335 from MarcZX10/codex/libkernel-sys-phys-page-size
feat(libkernel_sys): report physical page size
2026-11-05 06:35:01 +13:00
Dean 806b470399 Merge pull request #10332 from MarcZX10/codex/libkernel-sys-getcwd
feat(libkernel_sys): implement __getcwd
2026-11-05 06:34:56 +13:00
Dean 97d57d5be5 Merge pull request #15025 from Gruzzberry/fix/kenv-set-unset-eperm
fix(libkernel_sys): fail kenv set and unset with EPERM for a jailed caller
2026-11-03 18:13:21 +13:00
Dean 5c24846824 Merge pull request #14548 from Ragbie/fix/link-symbolic-link-limit
fix(libkernel_sys): stop link at 32 symbolic links as FreeBSD does
2026-11-03 11:39:05 +13:00
Dean Galvin 73cebee9e1 Merge commit 'a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8' into HEAD
# Conflicts:
#	core/libs/prx/libkernel/Socket/src/Udp.cpp
2026-11-03 06:36:11 +13:00
amazedturnip f9de9beaef feat(libkernel_sys): implement is_in_sandbox 2026-11-02 06:19:34 -06:00
GruzzberryandClaude Sonnet 5.5 683fa0329c fix(libkernel_sys): fail kenv set and unset with EPERM for a jailed caller
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-02 10:48:35 +00:00
Dean 95175b5acf Merge pull request #11298 from Gruzzberry/fix/dangling-link-prefix-enoent
fix(libkernel): fail with ENOENT for a path below a dangling Windows symbolic link
2026-11-02 23:27:36 +13:00
Dean dab80aa136 Merge pull request #11216 from Gruzzberry/feat/kldload
feat(libkernel_sys): implement kldload argument and privilege checks
2026-11-02 23:27:13 +13:00
Dean 8b834be455 Merge pull request #10625 from Dom3005/feat/symlink-targets
feat(libkernel_sys): create symlink targets with parent-directory components
2026-11-02 23:23:34 +13:00
Dean 042c5fa5ce Merge pull request #12925 from KernelPanicNT/feat/libkernel-condattr-getclock-null-output
feat(libkernel): throw for a null pthread_condattr_getclock output
2026-11-02 20:55:04 +13:00
Dean ba75ea7d55 Merge pull request #10427 from Retr0G28/fix/fpathconf-socket
fix(libkernel_sys): answer fpathconf on a socket as FreeBSD answers it for a pipe
2026-11-02 10:48:44 +13:00
Evrim Cicek 5de8ac4559 test(libkernel_sys): expect link to stop at 32 symbolic links as FreeBSD does 2026-11-01 18:35:34 +03:00
Dean Galvin c4629cbbe0 Merge main into feat/libkernel-condattr-getclock-null-output
# Conflicts:
#	docs/dev/debt/libkernel.md
#	docs/dev/debt/libkernel_sys.md
2026-11-01 21:13:14 +13:00
Adrià 90cc8d57a5 Merge pull request #13895 from Gruzzberry/fix/chflags-sysflags-eperm
fix(libkernel): fail chflags and fchflags with EPERM when a system flag changes
2026-11-01 09:10:40 +01:00
GruzzberryandClaude Sonnet 5.5 5ba892d391 fix(libkernel): fail rtprio_thread, sched_setscheduler and setpriority with the jail privilege errors
A title is jailed (agreed on #11216). FreeBSD 11.4 prison_priv_check denies
PRIV_SCHED_RTPRIO, PRIV_SCHED_SET and PRIV_SCHED_SETPRIORITY to a jailed caller.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-01 07:56:25 +01:00
GruzzberryandClaude Sonnet 5.5 2d1342cf31 fix(libkernel): fail chflags and fchflags with EPERM when a system flag changes
FreeBSD 11.4 ufs_setattr refuses a change of any SF_* flag to a caller without PRIV_VFS_SYSFLAGS, which prison_priv_check denies a jailed root without allow.chflags. Under the credential model agreed on #11216 every SF_* flag now fails with EPERM, after the EOPNOTSUPP check for unknown bits, instead of throwing.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-01 07:51:40 +01:00
Adrià bc77a1512b Merge pull request #13792 from DeveshB-1/fix/title-workaround-efault
fix(libkernel_sys): return EFAULT from title workaround queries for invalid memory
2026-11-01 02:00:43 +01:00
Dean Galvin c27d72435d Merge main into feat/libkernel_sys-switch-utrace-tcsetsid 2026-11-01 12:50:11 +13:00
GruzzberryandClaude Sonnet 5.5 bfef134a9a fix(libkernel): fail with ENOENT for a path below a dangling Windows symbolic link
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 10:16:00 +00:00
Adrià 3ad2af8834 Merge pull request #13631 from Brecherbernd/test/fpathconf-shm-anon
test(libkernel_sys): cover fpathconf on an anonymous shared memory descriptor
2026-10-31 11:11:26 +01:00
DeveshB-1 0043a78765 fix(libkernel_sys): return EFAULT from title workaround queries for invalid memory 2026-10-31 12:18:10 +05:30
GruzzberryandClaude Sonnet 5.5 451f080829 feat(libkernel_sys): implement kldload argument and privilege checks
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 03:29:20 +00:00
BunnyFlandClaude Opus 5.5 069a2849fe Merge upstream main into feat/libkernel-amm-mapper-calls-1030
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 23:16:47 +01:00
Adrià 0399b0a2c9 Merge pull request #13487 from BunnyFl/feat/libkernel-amm-remaining
feat(libkernel_sys): add the remaining AMM command writers
2026-10-30 22:41:55 +01:00
Brecherbernd 6f4e921da3 test(libkernel_sys): cover fpathconf on an anonymous shared memory descriptor 2026-10-30 21:26:00 +01:00
BunnyFlandClaude Opus 5.5 de453bd3c5 test(libkernel_sys): run waits recorded by the new writers
A buffer of a counter write, satisfied counter and address waits (one
with a negative compare) and an address write is submitted and must
complete with the write done. The debt file records that a compare
recorded as mode 7 throws when the runner here executes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 19:08:56 +01:00
BunnyFlandClaude Opus 5.5 8794fec072 feat(libkernel_sys): add the AMM mapper calls
sceKernelCallIndirectBuffer, sceKernelCallIndirectBuffer2,
sceKernelCallIndirectBuffer3, sceKernelGiveDirectMemoryToMapper and
sceKernelMapperGetParam follow firmware 13.42's libkernel_sys: the
submit calls queue the buffer on the AMM queue, the direct memory call
keeps the library's 2 MiB checks and the parameter call copies the
size and the AMM address ranges. The kernel-side checks that are not
known throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:46:30 +01:00
BunnyFlandClaude Opus 5.5 cb6ff04550 test(libkernel_sys): cover a PRT range at the top of the address space
The firmware accepts a range whose end wraps to zero and refuses the one
just below it, which lies past the map range; the test pins both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:25:12 +01:00
BunnyFlandClaude Opus 5.5 c2dbf83b1a test(libkernel_sys): pin the firmware's wrapping range check in the PRT writers
Firmware 13.42 accepts a PRT range whose end wraps past the top of the
address space and records only bits 14 to 40 of the size. The writers
here do the same; the test pins it and the debt entry records it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:18:48 +01:00
BunnyFlandClaude Opus 5.5 dd0bc0b781 feat(libkernel_sys): add the AMM writers for PRT maps, address and counter writes, waits and event queues
sceKernelWriteMapCommand2, sceKernelWriteUnmapToPrtCommand,
sceKernelWriteWriteAddressCommand, sceKernelWriteWriteCounterCommand,
sceKernelWriteWaitOnAddressCommand, sceKernelWriteWaitOnCounterCommand
and sceKernelWriteEventQueueOnCompletionCommand follow the checks of
firmware 13.42's libkernel and record this project's command layout.
Without the PRT flag, sceKernelWriteMapCommand2 is
sceKernelWriteMapCommand, as on the console. The debt files record where
the existing writers' checks differ from the firmware.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 17:45:00 +01:00
BunnyFlandClaude Opus 5.5 004b47eda7 fix(libkernel_sys): accept all 128 title workaround bits and add the misspelled export
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 15:41:32 +01:00
Adrià 011a1699a5 test(libkernel_sys): drop the Windows throw assertion for a directory symbolic link in linkat 2026-10-30 08:40:33 +01:00
JJenkxandClaude Opus 5.5 a11e2192e9 fix(libkernel_sys): hard-link a symbolic link itself in linkat on Windows
Without AT_SYMLINK_FOLLOW, linkat of a symbolic link threw on Windows.
CreateHardLinkW links the link's own reparse point rather than its target,
dangling or not, so it gives FreeBSD's behaviour. NTFS cannot hard-link a
directory, so a symbolic link or junction to a directory still throws there.

guest_kernel_sys now runs the symbolic link linkat checks on Windows too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 08:40:33 +01:00
SimoneandClaude Opus 5.5 eea3c721a7 Merge branch 'main' into feat/libkernel_sys-switch-utrace-tcsetsid
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 22:56:43 +01:00
Adrià c8bc4a20d7 Merge pull request #12606 from EagleBearerYS/feat/libkernel-sys-settimeofday
feat(libkernel_sys): implement sceKernelSettimeofday
2026-10-29 21:20:32 +01:00
KernelPanicNT 602fc9c55a feat(libkernel): throw for a null pthread_condattr_getclock output
pthread_condattr_getclock reached NotImplemented_nid_no_patch for a null
output pointer with a valid attribute. Measured as a payload process on
a device, that call faults, as does scePthreadCondattrGetclock in the
same case, so both now throw std::invalid_argument. Every other measured
result of the condition attribute clock getters and setters already
matched. The test covers every invalid clock ID from -1 to 16.
2026-10-29 14:33:36 +00:00
Dean Galvin 307be471e0 test(libkernel-sys): assert the physical page size 2026-10-30 00:25:31 +13:00
Retr0 fdeee7478c Merge remote-tracking branch 'origin/main' into fix/fpathconf-socket
# Conflicts:
#	core/libs/CMakeLists.txt
#	core/libs/prx/libkernel_sys/Export.cpp
#	core/libs/tests/GuestKernelSys.cpp
2026-10-29 01:26:03 +02:00
Lindamea1andClaude Opus 5.5 c85368d0b5 feat(libkernel_sys): implement kldstat
kldstat was a NotImplemented stub. It now follows FreeBSD 11.4's
sys_kldstat (sys/kern/kern_linker.c): only the version field is read
(EFAULT when that fails), and a version other than 1056
(struct kld_file_stat_1) or 2080 (struct kld_file_stat) is EINVAL.
No linker file is listed here, as for kldnext, so every file id then
gets ENOENT and the structure is never written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 23:16:31 +00:00
MarcZX10 37ba95218a fix(libkernel_sys): separate getcwd changes from neighboring exports 2026-10-28 22:48:00 +00:00
MarcZX10 cb14263eae refactor: keep one declaration of each export of this PR, in its library header
The public header audit wants exactly one declaration per export, in the library header: __getcwd is declared in the libkernel_sys Api.hpp and the copies of other libraries' functions in Export.cpp and the test are replaced by includes of their headers.
2026-10-28 22:36:58 +00:00
MarcZX10 b6b9fcdd36 feat(libkernel_sys): implement __getcwd 2026-10-28 22:36:58 +00:00
MarcZX10 19c3f886ec test(libkernel_sys): cover raw getcwd calls 2026-10-28 22:36:28 +00:00
Yunus Shaikh 3e5441dd86 feat(libkernel_sys): implement sceKernelSettimeofday 2026-10-28 21:05:36 +00:00
Dean 750cf6cf48 Merge pull request #11595 from alvaroelpob/fix/libkernel-sys-linkat-symlink-itself
fix(libkernel_sys): link a symbolic link itself in linkat without AT_SYMLINK_FOLLOW
2026-10-29 01:32:29 +13:00
Dom3005 61316594bc Merge remote-tracking branch 'upstream/main' into feat/symlink-targets 2026-10-28 12:07:41 +01:00
Dean ba8990161b Merge pull request #12077 from JJenkx/windows/kernel-sys-link-cleanup
test(libkernel): remove test symbolic links with guest unlink on Windows
2026-10-28 22:46:24 +13:00
SimoneandClaude Opus 5.5 8d0d8c6822 Merge branch 'main' into feat/libkernel_sys-switch-utrace-tcsetsid
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 10:01:17 +01:00
Adrià 241649ed7e Merge pull request #11296 from tablefrogpillow/fix/fpathconf-kqueue-shm-eopnotsupp
fix(libkernel_sys): fail fpathconf on a kqueue or shm descriptor with EOPNOTSUPP
2026-10-28 09:41:16 +01:00