Commit Graph
224 Commits
Author SHA1 Message Date
xXPBSXxandClaude Sonnet 5.5 905e9d959c Merge main into fix/kernel-sys-getprocesstype-pid-errors-v2
The one conflict is in docs/dev/debt/libkernel_sys.md, where main added the
sceKernelTitleWorkaroundIsEnabled2 entry beside the sceKernelGetProcessType entry this
branch rewrites; both stay, with the measured sceKernelGetProcessType entry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 06:57:22 +01:00
Adrià 97fd93dd0f Merge pull request #16370 from Ragbie/fix/getcwd-syscall-errno
fix(libkernel_sys): answer raw __getcwd errors in FreeBSD's order and kinds
2026-11-10 12:55:51 +01:00
GruzzberryandClaude Sonnet 5.5 2100dfb559 feat(libkernel_sys): implement swapon
Look the name up as FreeBSD 11.4's sys_swapon does: EFAULT, ENOENT,
ENAMETOOLONG and ENOTDIR for a bad path, and ENOTBLK for any existing
file or directory, since only a disk device can be added as swap.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:23:16 +01:00
BunnyFl 3f3dc11f84 Merge remote-tracking branch 'upstream/main' into feat/kernel-title-workaround-2
# Conflicts:
#	docs/dev/debt/libkernel_sys.md
2026-11-09 14:37:45 +01:00
Dean e3de6cc570 Merge pull request #16017 from AlexWhitehouse/fix/libc-windows-directory-link-to-file-enotdir
fix(libc): answer ENOTDIR below a Windows directory link to a file
2026-11-09 18:49:55 +13:00
Adrià 828e44310e Merge pull request #9994 from xXPBSXx/fix/fchdir-kqueue-einval
fix(libkernel_sys): fail fchdir on a kqueue descriptor with EINVAL
2026-11-08 16:03:31 +01:00
Adrià 77d2cc9b36 Merge pull request #11031 from Gruzzberry/feat/getfsstat
feat(libkernel_sys): implement getfsstat
2026-11-08 05:19:18 +01:00
Evrim Cicek 58ab562c80 test(libkernel_sys): cover the 1024-byte path limit of raw __getcwd 2026-11-07 17:05:37 +03:00
Evrim Cicek e710d6e902 test(libkernel_sys): check the raw __getcwd errors against FreeBSD's kern___getcwd 2026-11-07 17:02:42 +03:00
xXPBSXxandClaude Sonnet 5.5 e5cea94152 test(kernel): pin sceKernelGetProcessType for pids 0 and 1
Measured in a PS5 payload process (firmware 11.60): pids 0 and 1
return 0x80020002.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 11:21:10 +01:00
BunnyFlandClaude Opus 5.5 019ce0a438 Merge branch 'main' into the equeue kqueue descriptor branch
Keep main's updated kqueue and kevent entry, which now lists the signal
filter, next to this branch's equeue entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 03:42:48 +01:00
Adrià 0e297f1425 Merge pull request #15035 from Gruzzberry/fix/time-set-eperm
fix(libkernel_sys): fail settimeofday and clock_settime with EPERM for a jailed caller
2026-11-07 00:50:58 +01:00
BunnyFlandClaude Opus 5.5 9760f2a68a Merge upstream/main into feat/libkernel-equeue-kqueue-descriptor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 22:43:38 +01:00
BunnyFlandClaude Opus 5.5 9c92f66f57 feat(libkernel_sys): answer sceKernelTitleWorkaroundIsEnabled2 as firmware 13.42 does
Firmware 13.42's libkernel_sys checks the workaround and output pointers
for null (EFAULT), refuses a bit above 0x7f or a 64-bit second argument of
0x29 or more (EINVAL), and otherwise stores the bit of the workaround's
id bitmap, as sceKernelTitleWorkaroundIsEnabled does. The second argument
is not read otherwise; its meaning stays in the debt entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 20:05:58 +01:00
orezraeyandClaude Opus 5.5 36814cbbe0 Merge main into fix/libkernel-ioctl-empty-request-measured-ps5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:59:00 -03:00
GruzzberryandClaude Sonnet 5.5 a7dee2017e fix(libkernel_sys): fail settimeofday and clock_settime with EPERM for a jailed caller
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 17:05:56 +00:00
GruzzberryandClaude Sonnet 5.5 3f7f31fb33 feat(libkernel_sys): implement getfsstat
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 17:05:53 +00:00
BunnyFlandClaude Opus 5.5 8e256c5c19 Merge upstream/main into feat/libkernel-equeue-kqueue-descriptor
Keep main's kqueue entry wording and its new ProcessExitOnSelf test next to this branch's
equeue entry and EqueueIsKqueueDescriptor test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 13:12:39 +01:00
Dean Galvin a7635dff0e Merge branch 'main' 2026-11-06 15:04:28 +13:00
orezraeyandClaude Opus 5.5 2e5675adfa Merge main into fix/libkernel-ioctl-empty-request-measured-ps5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 09:23:22 -03:00
Alex WhitehouseandClaude Opus 5.5 95b0d0d778 fix(libc): answer ENOTDIR below a Windows directory link to a file
Allow ERROR_DIRECTORY through the existing Windows link-text lookup so a
directory-flag symbolic link to a regular file, a path through a file, or
another such link is classified as BlockedByFile. Other host errors keep
the existing fallback. FreeBSD 11.4 lookup follows intermediate symbolic
links and rejects traversal through a regular file with ENOTDIR:
https://github.com/freebsd/freebsd-src/blob/releng/11.4/sys/kern/vfs_lookup.c

Extend the registered guest_kernel_sys prefix tests with access checks
for these directory links, a chain through a file, a dangling directory
link and valid file/directory link controls. Keep all existing assertions
and remove only the corrected clause from the libc debt entry.

Windows Release filesystem/path group: 21 passed, 1 existing skip on both
main and the change. CreateSymbolicLinkW fails with privilege error 1314
in this session, so the symlink cases skip and the required native-open,
main-failure and mutation-failure evidence remains unverified.
Conventions checks pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 10:12:31 +00:00
Dean a525b04647 Merge pull request #13286 from Kikoarl/fix/libkernel_sys-readlink-bounds
fix(libkernel_sys): validate guest destination buffer in readlink and readlinkat
2026-11-05 21:51:39 +13:00
Dean 26e8ed784a Merge pull request #12915 from Kikoarl/fix/libkernel-fstatat-bounds
fix(libkernel): validate guest FileStat destination in fstatat when follow is false
2026-11-05 21:51:07 +13:00
BunnyFlandClaude Opus 5.5 7461f7801a Merge upstream/main into feat/libkernel-equeue-kqueue-descriptor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 18:44:36 +01:00
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
BunnyFlandClaude Opus 5.5 c029cd11fc feat(libkernel): make an equeue a kqueue descriptor as firmware 13.42 does
Firmware 13.42's libkernel_sys.sprx creates a kqueue for every equeue,
returns (named object id << 32) | descriptor, waits with kevent on the
descriptor and closes it on delete. sceKernelGetKqueueFromEqueue
stores the descriptor. Equeue handles were counters in their own table,
so the descriptor could not be used with kevent or close and the export
threw.

Equeues now reserve a descriptor and live in the kqueue table.
sceKernelDeleteEqueue checks the whole handle and closes the
descriptor, and sceKernelGetKqueueFromEqueue returns its low 32 bits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 19:57:26 +01: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
orezraeyandClaude Opus 5.5 125a0d5c55 Merge main into fix/libkernel-ioctl-empty-request-measured-ps5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 19:45:25 -03: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 <noreply@anthropic.com>
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
fogydes 01252bf614 test(libkernel_sys): cover pointer validation in chroot, condattr and mapper param 2026-11-02 14:34:14 +05:30
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
2026-10-31 03:29:20 +00:00