Commit Graph
3100 Commits
Author SHA1 Message Date
slopgobblercobbler 405310c630 fix(libkernel): validate memory pointers and argument bounds in pthread barrier 2026-11-06 05:55:51 +01:00
Dean Galvin 4492567a14 Merge branch 'main' 2026-11-06 13:07:38 +13:00
Dean b077c1b3a0 Merge pull request #15890 from Retr0G28/fix/ioctl-scenet-socket
fix(libkernel): pass ioctl on a sceNetSocket socket to libSceNet
2026-11-06 12:17:31 +13:00
Dean ab9c66406f Merge pull request #14846 from JJenkx/windows/libkernel-poll-socket-close
fix(libkernel): notice a socket closed during poll or select
2026-11-06 12:16:30 +13:00
Dean fca1a701b3 Merge pull request #16073 from Ragbie/fix/blocking-receive-shut-rd
fix(libkernel): end a blocked receive on Windows when its socket is shut for reading
2026-11-06 09:52:31 +13:00
Dean 151a2cb6e2 Merge pull request #16075 from evanrk/fix/libkernel-sync-on-address-min-macos
fix(libkernel): compare a wait address's range end as uintptr_t on macOS
2026-11-06 08:57:43 +13:00
Dean eb14e8daf5 Merge pull request #16082 from oneandonlydean/fix/sandbox-cert-list-no-throw
fix(libkernel): never throw from the sandbox certificate list
2026-11-06 07:40:08 +13:00
Dean Galvin 7361a14382 fix(libkernel): remove the temporary certificate file after a failed rename
The temporary file is made read-only before the rename. When the rename
fails, Windows refuses to remove a read-only file, so the temporary copy
stayed in the cache directory. Give the owner write permission back
before removing it. The failure test now clears its cache directory,
including read-only files, before and after it runs, so it can run
again in the same directory.
2026-11-06 06:37:09 +13:00
Opensource55 dfc217b316 fix(libc): reopen a standard stream onto a directory on Windows
A guest that reopens `stdin`, `stdout` or `stderr` onto a directory in a read mode threw instead of
returning the stream, while the console answers that a directory opens in a read mode and the
debt entry already recorded the throw as the Windows difference.

The standard stream now goes through the same descriptor move a regular file uses: the directory
descriptor is opened, moved onto the standard descriptor, and libkernel's directory entry follows
it, so `fstat` of the guest descriptor reports a directory and the first read answers `EISDIR` with
the error indicator set, like every other directory stream. A failed open restores the previous
standard target.

`guest_freopen_host_standard` reopens `stdout` onto a directory, asserts `S_IFDIR` on the guest
descriptor, asserts the first read answers `EISDIR`, then reopens the same stream on a file path
and writes through it.
2026-11-06 01:09:06 +08:00
Dean Galvin 7974523c92 Merge branch 'main' 2026-11-06 04:40:14 +13:00
Dean Galvin bb225c2257 fix(libkernel): never throw from the sandbox certificate list
Writing and reading the cached CA_LIST.cer used the throwing filesystem
and stream calls. Tests that share the cache directory raced on the
rename over the cached file, and on Windows the resulting
filesystem_error cannot be delivered through libkernel frames, so the
test process died. Use the error_code overloads, read in chunks that
set the stream error state, treat a lost rename race as success when the
cached file already holds the bundle, and answer an unavailable list
with no file instead of caching the failure.

The new test blocks the cache directory and the cached file in turn and
expects the open to fail with ENOENT, then to succeed once unblocked.
2026-11-06 04:30:33 +13:00
Evan KleinandClaude Opus 5.5 302d5a32fc fix(libkernel): compare a wait address's range end as uintptr_t on macOS
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 09:55:32 -05:00
Evrim Cicek 11f2ffcc40 fix(libkernel): end a blocked receive on Windows when its socket is shut for reading 2026-11-05 17:48:43 +03:00
Dean f305293bb0 Merge pull request #15698 from javierUDP/fix/macos-exec-path-after-stack-move
fix(libkernel): keep the process start block mapped when the main stack moves
2026-11-06 01:29:35 +13:00
Dean Galvin e627498b24 Merge branch 'main' 2026-11-06 00:51:30 +13:00
Dean 9c267bcb55 Merge pull request #12646 from slopgobblercobbler/fix/libkernel-socket-ioctl-efault
fix(libkernel): return EFAULT from socket ioctl for invalid memory pointers
2026-11-06 00:05:12 +13:00
Dean 2ad4212034 Merge pull request #12139 from dantdmdarealguy/fix/getdents-removed-entries-windows
fix(libkernel): leave out directory entries removed while getdents lists them on Windows
2026-11-06 00:04:44 +13:00
Dean f4b501eb20 Merge pull request #11894 from xXPBSXx/test/posix-cond-broadcast
test(libkernel): cover pthread_cond_broadcast
2026-11-06 00:04:35 +13:00
Dean 946bde70ed Merge pull request #11579 from plexerPK/codex/nanosleep-guest-request
fix(libkernel): copy nanosleep requests before reading guest fields
2026-11-06 00:04:17 +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
Dean 2238042b81 Merge pull request #15705 from oneandonlydean/rr/pr3-gpu
feat(run-report): count milestones, frames, GPU and shader diagnostics
2026-11-05 21:24:14 +13:00
Dean 1fe3ee8d1a Merge pull request #14235 from oneandonlydean/rr/pr2-writer
feat(run-report): write the run report when a game ends
2026-11-05 21:24:09 +13:00
JJenkx c5675c432b Merge remote-tracking branch 'origin/main' into windows/libkernel-poll-socket-close
# Conflicts:
#	core/libs/prx/libkernel/Socket/src/Udp.cpp
#	core/libs/tests/GuestPoll.cpp
2026-11-05 00:18:31 -05:00
Dean 1e24993fa3 Merge pull request #11223 from Ragbie/fix/poll-after-shut-rd
fix(libkernel): report a socket shut for reading in poll and select and wake their waiters
2026-11-05 17:28:28 +13:00
Dean 051d531d1b Merge pull request #14493 from AlexWhitehouse/fix/libkernel-windows-sparse-truncate
fix(libkernel): leave Windows truncate extensions as sparse holes
2026-11-05 17:27:50 +13:00
Dean 430a9b5473 Merge pull request #14620 from Danigamer05/feat/libc-timespec-getres-20261101
feat(libc): forward time resolution queries to the kernel
2026-11-05 17:27:46 +13:00
Dean 56d300218d Merge pull request #14320 from DeveshB-1/fix/notification-request-efault
fix(libkernel): return EFAULT from sceKernelSendNotificationRequest for invalid memory
2026-11-05 16:59:38 +13:00
Dean a82a382fa8 Merge pull request #13336 from malekaifa/fix/sync-on-address-unreadable
fix(libkernel): return EFAULT for unreadable wait addresses
2026-11-05 12:42:55 +13:00
Retr0 69470e7075 fix(libkernel): pass ioctl on a sceNetSocket socket to libSceNet 2026-11-05 00:11:22 +02:00
Dean Galvin 987911807e fix(libkernel): keep the deferred module start state in HostThreadLocal
The deferred-dependency start state in InitializeDeferredModule (the
resolving vector and the started-results map) were thread_local objects with
destructors. On Windows a thread_local destructor in a module runs after
emulated TLS has freed the object, and prx_thread_local_destructors fails on
main for it. Hold both in HostThreadLocal like the other prx modules; the
trivial depth counter stays thread_local. Behaviour is unchanged.
2026-11-05 10:05:01 +13:00
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
Dean 3288b21f88 Merge pull request #15370 from oneandonlydean/fix/windows-deferred-dependency-start
fix(relinker): restore the Windows deferral of #12621 and start deferred dependencies first
2026-11-05 08:18:30 +13:00
pushkarreddyy f21820ab90 fix(libkernel): release semaphore lock before copying out count in ksem_getvalue 2026-11-04 23:13:27 +05:30
pushkarreddyy 7ed73d755a fix(libkernel): return EFAULT from ksem_getvalue for invalid memory pointers 2026-11-04 23:13:26 +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
Dean a7d4ba2186 Merge pull request #9948 from ntamas94/fix/ps4-net-sockinfo-kernel-sockets
fix(libSceNet): describe sockets made with socket() in sceNetGetSockInfo
2026-11-05 06:34:36 +13:00
Dean eaf2579d0a Merge pull request #9929 from sandivd/fix/libc-syslog-program-name
fix(libc): restore syslog program-name fallback
2026-11-05 06:34:29 +13:00
Dean 0db469c769 Merge pull request #9019 from yabanana/feat/kernel-sys-pwrite
feat(libkernel_sys): implement pwrite through the shared POSIX provider
2026-11-05 06:34:17 +13:00
Dean dd38a35e13 Merge pull request #15649 from hugodearaujo/fix/apr-priority-queues
fix(libkernel): give each APR submit priority its own queue
2026-11-04 21:31:36 +13:00
Dean Galvin ecfea85fcd Merge branch 'main' into fix/libc-syslog-program-name 2026-11-04 21:00:07 +13:00
javierUDP dd5ee9e4c6 fix(libkernel): keep the process start block mapped when the main stack moves
On macOS under Rosetta, Aps5StartGuest moves the main thread off the host
stack and releases the old range to the guest arena. dyld keeps its own
pointers into the process start block at the top of that range and offers
no call that redirects them, where argv and environ have one:
_NSGetExecutablePath copies the path string out of the block on every
call, so the first call after the move read unmapped memory and the
process died with KERN_PROTECTION_FAILURE. A title does not have to call
it: libxpc reaches it from xpc_connection_resume, and ShaderCacheDirectory
calls it for the shader disk cache.

Release the old stack only up to the pages that hold the block, and only
while argv still points into the stack. They are the top two pages, 8 KiB
of the 8372224-byte stack here, so a title that fixes a mapping over that
range now fails with a host region overlap; the rest is free as before.

guest_main_stack_move asked for a 64 KiB guest mapping aligned down from
a local of main, which falls inside the kept pages. It now probes the
64 KiB below them, requires the kept pages to be refused, and calls
_NSGetExecutablePath after the move, which segfaults without this change.
2026-11-04 04:22:23 -03:00
Dean Galvin 0003ec72c7 Merge rr/pr2-writer into rr/pr3-gpu 2026-11-04 20:21:16 +13:00
Dean Galvin b5f5c7fd1f Merge branch 'main' into rr/pr2-writer 2026-11-04 20:19:15 +13:00
Dean 0a15ebf864 Merge pull request #12149 from AlexFigas/feat/libc-underscore-setjmp
feat(libc): export _setjmp and _longjmp
2026-11-04 18:34:14 +13:00
Dean b593093818 Merge pull request #12146 from AlexFigas/feat/libc-shared-mutex
feat(libc): implement the _Smtx shared mutex calls over libkernel's rwlocks
2026-11-04 18:34:09 +13:00
Cesar MoraandClaude Opus 5.5 468c07712c feat(libs): let relinked Linux games opt into mimalloc
With APS5_MIMALLOC set, libkernel restarts the title with
libmimalloc.so from libs/ first in LD_PRELOAD, as it does on macOS
with DYLD_INSERT_LIBRARIES. The macOS restart becomes one
implementation with platform pieces (MimallocRestart.cpp): on Linux
the executable is the target of /proc/self/exe and the arguments
those of /proc/self/cmdline. The restart is a priority 101
constructor, so it runs before libkernel's other initializers. It
gives the standard streams back from an ANYPS5_LOG_FILE copy before
execv, which also fixes the macOS restart under that variable, and
refuses a path the preload list cannot hold.

The build copies libmimalloc.so beside the libraries except in ASan
and TSan builds, the Linux release archives ship it, and the restart
tests run on Linux too, with a new case for ANYPS5_LOG_FILE.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015W3M6NbYpmwWkzkL8YNLaF
2026-11-03 23:18:20 -06:00