Commit Graph
1411 Commits
Author SHA1 Message Date
Dean 9e70d97449 Merge pull request #13953 from pushkarreddyy/fix/ksem-getvalue-efault
fix(libkernel): return EFAULT from ksem_getvalue for invalid memory pointers
2026-11-05 08:19:49 +13:00
Dean 045eda43dc Merge pull request #12854 from slopgobblercobbler/fix/libkernel-mincore-error-parity
fix(libkernel): enforce FreeBSD 11.4 error precedence and vector copyout in mincore
2026-11-05 08:19:30 +13:00
Dean 5e2f04007b Merge pull request #9326 from erickerxhalli/feat/libkernel-mutex-prioceiling
feat(libkernel): implement pthread_mutex_getprioceiling and setprioceiling
2026-11-05 08:19:17 +13:00
Dean df721d53f2 Merge pull request #7192 from Jev1337/feat/libkernel-host-fault-exception-handlers
feat(libkernel): deliver host faults to sceKernelInstallExceptionHandler handlers
2026-11-05 08:19:08 +13:00
pushkarreddyy ad7b2988b5 docs(libkernel): document EFAULT memory validation fallback in ksem_getvalue 2026-11-04 23:13:27 +05:30
Dean 92cdaf6337 Merge pull request #11624 from Felipebmaitan/feat/windows-guest-gs-state
feat(libkernel): maintain per-thread guest GS bases on Windows
2026-11-05 06:35:52 +13:00
Dean 6863f295a9 Merge pull request #10749 from ycbuzi/refactor/siginterrupt-libc-internal
refactor(libSceLibcInternal): serve siginterrupt from libSceLibcInternal
2026-11-05 06:35:30 +13:00
hugodearaujo 3a781a01fa docs(debt): state that APR priorities are unordered and a wait by id covers one buffer 2026-11-03 20:51:59 -03:00
hugodearaujo f06738e1c8 docs(debt): record the APR submit priority queues 2026-11-03 20:15:59 -03:00
Jevro1337andClaude Opus 5.5 e1d324824c docs(libkernel): state the open gaps of fault delivery first
Cut the two longest exception handler entries under the 1000 character
limit: the mapping entry keeps the unverified protection fault signal and
what counts as title code, the Linux entry keeps what a later guest signal,
the conversion stubs and older glibc change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 21:01:18 +01:00
Jevro1337andClaude Opus 5.5 2c7e139d93 perf(libkernel): find the object of a faulting address with _dl_find_object
dladdr1 searches the object's symbol table, which made every host fault
chained past an installed handler about 8 us slower on Linux. glibc 2.35
and later answer the same question with _dl_find_object, which is also
async-signal-safe; older glibc keeps dladdr1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 21:01:18 +01:00
Jevro1337andClaude Opus 5.5 33ec8a1b92 test(libkernel): cover exception handlers that return without fixing the fault
A handler that returns the context unchanged runs again on the same fault,
a handler that fixes the page with mprotect and returns lets the store
complete, and a handler that removes itself and returns ends the process
with the fault (checked in a child process, so a loop fails on a timeout).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 21:01:17 +01:00
Jevro1337andClaude Opus 5.5 ab363feecc feat(libkernel): deliver host faults to sceKernelInstallExceptionHandler handlers
A handler installed for SIGILL, SIGFPE, SIGBUS or SIGSEGV now receives
the faults raised in title code instead of the process ending, with
mc_trapno, mc_addr and mc_err filled as FreeBSD 11's amd64 trap() does.
On Windows the crash reporter's vectored handler offers unclaimed faults
to libkernel, which redirects the thread to a stub that runs the handler
outside the exception dispatcher; on Linux chained host signal handlers
classify faults by REG_TRAPNO.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 21:01:15 +01:00
Felipebmaitan 41bbc32070 chore: refresh GS state with current main 2026-11-03 14:34:25 -03:00
bluandClaude Opus 5.5 24497b2406 Merge branch 'main' into refactor/siginterrupt-libc-internal
Resolves docs/dev/debt/libkernel.md: main's sigaction entry (SIGPIPE outside Windows) and this branch's signal entry, which points to libSceLibcInternal for siginterrupt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 10:23:38 -07:00
Dean 31ab214934 Merge pull request #11002 from SandstromPL/fix/libkernel-guest-sigpipe
fix(libkernel): let a guest ignore or catch SIGPIPE on Linux
2026-11-04 05:43:27 +13:00
Dean 206e72c90b Merge pull request #15137 from pushkarreddyy/feat/libkernel-sandbox-app0-alias
feat(libkernel): alias title sandbox app0 path to application directory
2026-11-03 21:11:30 +13:00
Dean 8b82678900 Merge pull request #10025 from mehmetbayoglu/fix/libkernel-amm-prt-zero-page
fix(libkernel): map unbacked AMM PRT pages to one read-only zero page on Windows
2026-11-03 21:09:48 +13:00
Dean 91ca312437 Merge pull request #9242 from DavidSamir/feat/libkernel-sys-tcgetsid
feat(libkernel): implement tcgetsid
2026-11-03 21:09:31 +13:00
Dean a74a4c370c Merge pull request #14310 from XatiX/fix/libkernel-net-socket-forwards
fix(libkernel): forward socket calls on sceNetSocket descriptors to libSceNet
2026-11-03 21:08:43 +13:00
Dean 8835460b5e Merge pull request #7532 from hugodearaujo/fix/linux-guest-main-stack
fix(linux): enter the guest entry on a main stack at the console's address
2026-11-03 21:07:51 +13:00
Dean Galvin a39b825599 Merge commit 'd1ae628bc2f62459cce1e9872ba5632c938c71f2' into HEAD
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-11-03 18:18:49 +13:00
Dean a03cc0dde6 Merge pull request #14885 from oneandonlydean/carry-7135
fix(libkernel): follow kern_cpuset for the base cpuset, level checks and interrupt targets
2026-11-03 18:14:20 +13:00
Dean b955001c4d Merge pull request #15030 from Gruzzberry/fix/sysctl-overcommit-eperm
fix(libkernel): fail a vm.overcommit write with EPERM
2026-11-03 18:13:26 +13:00
Dean e41879d2b7 Merge pull request #14876 from roboterspinne/fix/libkernel-ipv6-unspecified-connect
fix(libkernel): connect an AF_INET6 socket to ::1 when the address is unspecified, as FreeBSD does
2026-11-03 18:11:16 +13:00
Dean 7a3d08c1c3 Merge pull request #14875 from roboterspinne/fix/libkernel-tcp-multicast-address
fix(libkernel): fail bind and connect of a stream socket to a multicast address with EAFNOSUPPORT
2026-11-03 18:11:11 +13:00
Dean 79b49a50c6 Merge pull request #14710 from ahmadmuj/fix/anyps5-apr-guest-copyout
fix(libkernel): return EFAULT from APR file size and stat queries for an unwritable output
2026-11-03 18:09:40 +13:00
Dean 48dd279a37 Merge pull request #13950 from pushkarreddyy/fix/usercontext-efault
fix(libkernel): return EFAULT from context operations for invalid memory pointers
2026-11-03 18:09:35 +13:00
Dean 10921ef452 Merge pull request #12560 from Kikoarl/fix/win32-verbatim-path-dos-devices
fix(libkernel): preserve DOS device names and trailing dots or spaces on Windows
2026-11-03 18:09:19 +13:00
Dean Galvin df788026b6 fix(libkernel): refuse cpuset sizes the console rejects and record the EPERM difference
cpuset_getaffinity and cpuset_setaffinity return ERANGE from 24 bytes, as a PS5 payload process did (rooklz sweep, #7135 comment 6391606624: 8 to 16 accepted, below 8 and from 24 up ERANGE), and throw for the unmeasured 17 to 23, as pthread_getaffinity_np does. The tests that used 32 bytes use 16 and pin 7, 24, 32 and 64 to ERANGE. The setter entry records that the console answers EPERM for a CPU outside the process's set where this clips and returns 0.
2026-11-03 15:15:35 +13:00
Dean Galvin cc73f16c59 fix(libkernel): answer CPU_LEVEL_ROOT and test the cpuset sizes the console accepts
cpuset_getaffinity at CPU_LEVEL_ROOT returns 0xffff, as a PS5 payload process read it (rooklz, #7135 comment 6390891591), instead of throwing; the target is checked as at the other levels. The level 2 base-set test now passes 8 and 16 bytes, which the console accepts (it returns ERANGE from 24 bytes), instead of depending on the 32 bytes it rejects. The debt entry records the root measurement and that the title root set is unmeasured.
2026-11-03 15:11:23 +13:00
memob c73b65f4b9 docs(libkernel): record the per-page view cost of AMM PRT zero pages 2026-11-02 19:55:26 -05:00
memob 37881a5da0 fix(libkernel): map unbacked AMM PRT pages to one read-only zero page on Windows
Unbacked PRT pages were private read-only commits, so every page that was
read took its own host page. They are now views of one pagefile-backed
section created read-only, so the range costs one page however large and
no view of it can be made writable. Host imports treat such views as
read-only memory instead of asking for a read-write alias.
2026-11-02 19:31:59 -05:00
Dean Galvin 2d8e93e6b4 Merge commit '88bb16c20e757658078b3efce912c96b1b03502a' into HEAD
# Conflicts:
#	core/libs/prx/libkernel_sys/Export.Discovery.cpp
#	core/libs/prx/libkernel_sys/include/Api.hpp
2026-11-03 11:45:12 +13:00
Dean Galvin 843f35fa2a Merge commit '88bb16c20e757658078b3efce912c96b1b03502a' into HEAD
# Conflicts:
#	core/libs/prx/libkernel_sys/Export.Discovery.cpp
#	core/libs/prx/libkernel_sys/include/Api.hpp
2026-11-03 11:45:11 +13:00
Dean 5cb015caaa Merge pull request #15179 from EagleBearerYS/docs/libkernel-setaffinity-measured-sizes
docs(libkernel): record the measured pthread_setaffinity_np set sizes
2026-11-03 11:43:17 +13:00
Dean 3ade074e69 Merge pull request #14417 from roboterspinne/fix/libkernel-aio-efault
fix(libkernel): return EFAULT from AIO poll, cancel and delete for invalid memory
2026-11-03 11:36:00 +13:00
Dean 99e565963e Merge pull request #10319 from MarrasFederico/fix/open-create-trailing-slash
fix(libkernel): report lookup errors when creating through a trailing slash
2026-11-03 11:34:52 +13:00
Kikoarl ae9a8b093d fix(libkernel): preserve DOS device names and trailing dots or spaces on Windows 2026-11-02 21:16:21 +01:00
Yunus Shaikh 93a3f5e0d2 docs(libkernel): give the measured affinity set sizes their own debt entry 2026-11-02 11:56:00 -08:00
Dean 36896d8a7f Merge pull request #14206 from JJenkx/windows/libkernel-select-close-race
fix(libkernel): fail a select with EBADF when its pipe closes during the wait on Windows
2026-11-03 08:46:47 +13:00
Dean b0c4915518 Merge pull request #14039 from EagleBearerYS/fix/kernel-getaffinity-console-sizes
fix(libkernel): follow the console's set sizes in pthread_getaffinity_np
2026-11-03 08:45:45 +13:00
pushkarreddyy 9b436c4e81 docs(debt): document title sandbox app0 path alias 2026-11-02 23:22:18 +05:30
XatiXandClaude Opus 5.5 7a4fa3865b fix(libkernel): keep the libkernel contract on forwarded socket calls
bind, getsockname, sendto and recvfrom validate as for a libkernel socket
before they reach libSceNet, so a forwarded descriptor reports the same
errors. recvfrom keeps its guest address handling and MSG_WAITALL, and a
zero-length datagram receive does not wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 17:33:10 +00:00
Dean bc12e15225 Merge pull request #13695 from Retr0G28/fix/ioctl-fioclex-socket
fix(libkernel): set and clear close-on-exec with FIOCLEX and FIONCLEX on a socket
2026-11-03 06:31:41 +13:00
Federico Marras d683cc901a Merge main into fix/open-create-trailing-slash 2026-11-02 18:25:10 +01:00
pushkarreddyy f87223af5e docs(libkernel): document syscall mechanism and UC_COPY_SIZE read in user context operations 2026-11-02 22:17:28 +05:30
pushkarreddyy 6d8c169216 docs(libkernel): document EFAULT memory validation fallback in user context operations 2026-11-02 22:17:28 +05:30
Dean 98efa281cc Merge pull request #12826 from Nixitov/feat/libkernel-dmem-for-app
feat(libkernel): export sceKernelAllocateDirectMemoryForApp and sceKernelProtectDirectMemoryForPID
2026-11-03 05:14:04 +13:00
Dean 4f64f81ef7 Merge pull request #15051 from xXPBSXx/docs-kernel-coredump-register-stack
docs(debt): give the stack bounds of sceCoredumpRegisterCoredumpHandler and what titles pass
2026-11-03 02:41:15 +13:00