Commit Graph
1264 Commits
Author SHA1 Message Date
Dean aae9f379ed Merge pull request #6950 from MarcZX100/codex/carry-connect-listener
fix(libkernel): return EOPNOTSUPP when connecting to a listener
2026-10-17 18:00:50 +13:00
Adrià 37f0253ce8 Merge pull request #5980 from Ondra97/codex/fix-ftruncate-invalid-descriptor
fix(libkernel): reject invalid ftruncate descriptors safely
2026-10-17 06:53:47 +02:00
Adrià 8730dde45f Merge pull request #5973 from pipe1os/feat/libkernel-kevent-pipe-read
feat(libkernel): support EVFILT_READ on the read end of a pipe
2026-10-17 06:53:33 +02:00
Adrià a7f27eb352 Merge pull request #6070 from fdfawef324/claude/libkernel-windows-precise-poll-waits
fix(libkernel): use precise waits for select and poll on pipes on Windows
2026-10-17 06:53:29 +02:00
Dean dfdc3dec4d Merge pull request #5280 from santhoshkumar-dev/codex/sandbox-ca-trust
feat(libkernel): serve the sandbox CA bundle from host TLS roots
2026-10-17 16:35:44 +13:00
Dean f99f3d1dca Merge pull request #6694 from MarcZX100/codex/coredump-config-dump-mode-6688
fix(libkernel): export sceCoredumpConfigDumpMode as an explicit stub
2026-10-17 16:34:12 +13:00
Santhosh Kumar eb26fb97f8 fix(libkernel): filter sandbox TLS roots and preserve path overrides 2026-10-17 02:25:41 +00:00
screammandClaude Fable 5.1 9f4a8d6ec5 feat(libkernel): serve the console CA list from the host trust store
Titles that bundle OpenSSL load the console's CA file from the sandbox
directory and fail every HTTPS request without it. ProsperoRadio
(PPSA99001, libcurl 8.18.0 + OpenSSL 3.5.2) on main + #4796 + #4525:

  [ProsperoRadio][http] https://all.api.radio-browser.info/json/servers: Problem with the SSL CA cert (path? access rights?) (error adding trust anchors from file: /gkbHtXc3Wq/common/cert/CA_LIST.cer)

SwanStation (PPSA98510) stops on the same file (#5001).

The guest path resolver now accepts exact-path providers, and libkernel
registers one for /<sceKernelGetFsSandboxRandomWord()>/common/cert/CA_LIST.cer.
On first use it writes a PEM bundle once per process to
cert_cache/CA_LIST.cer in the run directory, read-only: on Windows the
current user's ROOT and CA system stores, elsewhere SSL_CERT_FILE or the
first distro bundle that exists. Without a certificate the path keeps
resolving under the guest root and does not exist, as before. Every other
path under the sandbox word is unchanged. The console file's format and
the rest of its common/cert directory are unverified and recorded in
docs/dev/debt/libkernel.md.

With this change, #4796, #4525 and #5025 on Windows 11, 60 s each:

  [ProsperoRadio][http] 11846160 bytes in 1458 ms: 1161 passes, 803 waits (679 woken) for 1428 ms
  [ProsperoRadio][catalog] page offset=0 bytes=11846160 objects=10000 accepted=9549 total=9549
  ...
  [ProsperoRadio][catalog] page offset=60000 bytes=1712035 objects=1494 accepted=1436 total=59371

  [SwanStationPS5] update: latest 1.2.5, this 1.1.3, available
  [SwanStationPS5] gamedb: index written

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-17 02:24:02 +00:00
Dean 72a848ca52 Merge pull request #4533 from Roojool/contrib/g07-pthread-getname
fix(libkernel): answer pthread_getname_np for a joined thread with ESRCH
2026-10-17 13:05:38 +13:00
Adrià 5b70a50680 Merge pull request #5955 from fma-rc/fix/libkernel-linux-guest-module-protect
fix(libkernel): register a relinked guest module's image when Linux protects its pages
2026-10-16 23:29:46 +02:00
Hussein Kadhim 0d188ba6bd fix(libkernel): validate the address before refusing connect on a listening socket
FreeBSD reads and checks the address (getsockaddr) before soconnect refuses a listening socket with EOPNOTSUPP, so a null or short address on a listener fails with the address error. Move the listener check after the address is read and keep it ahead of the family check.
2026-10-16 20:50:53 +00:00
Hussein Kadhim 80a7ccddf2 fix(libkernel): fail connect on a listening socket with EOPNOTSUPP
FreeBSD's soconnectat refuses a socket with SO_ACCEPTCONN set with EOPNOTSUPP (45). The host answers EINVAL on Windows and EISCONN on Linux, so connect() on a listening stream socket returned the host's error. Answer EOPNOTSUPP for a listening stream socket before the address is read.
2026-10-16 20:50:44 +00:00
Adrià 2fab88d102 Merge pull request #5945 from ErenYeager1836/feat/libkernel-sysctl-pagesize
feat(libkernel): report hw.pagesize through sysctl and sysctlnametomib
2026-10-16 22:31:11 +02:00
Adrià a067dc2418 Merge pull request #5938 from xXPBSXx/fix/libkernel-close-waits-positioned-transfer
fix(libkernel): make close wait for a positioned transfer on the same descriptor
2026-10-16 22:31:04 +02:00
Adrià 93eca8f7be Merge pull request #5902 from pushkarreddyy/feat/libkernel-setrlimit-nofile
feat(libkernel): allow lowering rlim_cur for RLIMIT_NOFILE in setrlimit
2026-10-16 21:54:11 +02:00
Adrià bafd3227a6 Merge pull request #5901 from KernelPanicNT/feat/libkernel-coredump-thread-context-info
feat(libkernel): answer sceCoredumpGetThreadContextInfo outside the coredump handler
2026-10-16 21:54:05 +02:00
Adrià bc9833e39b Merge pull request #5887 from leorossi2005/feat/libkernel-umtx-microsecond-timeout
feat(libkernel): support microsecond timeout in size-0 _umtx_op
2026-10-16 21:43:51 +02:00
Adrià 1391ea30b6 Merge pull request #5831 from ahmad3a4/fix/libkernel-append-atomic-windows
fix(libkernel): append O_APPEND writes atomically on Windows
2026-10-16 21:23:47 +02:00
Adrià 9158f031ca Merge pull request #5835 from AlexOfTheForest/feat/app0-zarchive
feat: read title files from a read-only app0.zar (ZArchive) layer
2026-10-16 21:23:25 +02:00
Adrià 4ff1e8864d Merge pull request #5141 from 0xRickx/fix/refused-loopback-connect
fix(libkernel): refuse a loopback TCP connect at once on Windows
2026-10-16 21:23:06 +02:00
Nithishvelan M 76e05544a9 feat(libkernel): report hw.pagesize through sysctl and sysctlnametomib 2026-10-16 20:55:46 +02:00
Adrià FranchandClaude 5484500734 fix(libkernel): drop the second positioned lock in NativePositionedTransfer
Its callers (NativePositioned_nid_no_patch, the vectored transfer) already hold the
non-recursive per-descriptor lock, so locking again deadlocked every positioned transfer.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-16 20:52:19 +02:00
xXPBSXxandClaude Sonnet 5.5 f2649c3301 fix(libkernel): make close wait for a positioned transfer on the same descriptor
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 20:52:15 +02:00
Ahmad e8c97bf926 fix(libkernel): append O_APPEND writes atomically on Windows
On Windows the C runtime appends by seeking to the end and then writing,
so concurrent appends through different descriptors overwrite each other
and lose data. Write and writev on an O_APPEND descriptor now go through
WriteFile at the end-of-file offset, which Windows appends atomically,
and writev gathers its buffers into one append as FreeBSD writes the
whole vector at the end.
2026-10-16 20:25:29 +02:00
Alexej Szpevák d97d6efb1b fix(libkernel): refuse descriptor calls on app0.zar files
flock, fstatfs, ftruncate, fsync, fdatasync, getdirentries, fchmod, futimes and mmap on an archived descriptor acted on its null device and succeeded or failed with an unrelated errno. They now throw NotImplemented, each covered by the kernel archive test; mmap is noexcept, so its refusal is checked through the terminate handler.
2026-10-16 20:03:32 +02:00
Alexej Szpevák 9b911ed510 feat(libkernel): serve app0.zar files through the file calls
sceKernelOpen and open give an archived file a read-only null-device descriptor. Reads, positioned, vectored and AIO reads, seeks, fstat and FIONREAD are served from the archive; dup, dup2 and F_DUPFD share the position. sceKernelStat and sceKernelCheckReachability see archived paths.

Writing opens fail with EROFS, O_CREAT|O_EXCL with EEXIST and O_DIRECTORY on a file with ENOTDIR. Opening an archived directory or one merged with the disk throws until getdents can list it.
2026-10-16 20:03:32 +02:00
Adrià FranchandClaude e1efda1274 fix(build): link the fixed-base loader test with ld.bfd
wild 0.10.0 gives no canonical PLT entry to a DSO function whose address a
non-PIE executable takes (wild-linker/wild#2469, fixed after the release by
#2480), so the absolute personality pointer in .eh_frame names a local stub
and every exception reaching main is unhandled.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-16 17:05:56 +02:00
pushkarreddyy 2de10e35ff feat(libkernel): allow lowering rlim_cur for RLIMIT_NOFILE in setrlimit 2026-10-16 20:33:46 +05:30
Felipe Arce 647b5a1c97 refactor(libkernel): share the Windows pipe query between poll and kevent
PipeReadiness and PipeReadState both opened the pipe handle and asked
NtQueryInformationFile for its access mask and local information. Both
now go through QueryPipe, which keeps each caller's error prefix.
2026-10-16 10:44:12 -03:00
TamaleroandClaude Opus 5.5 ae5046eeb2 feat(libkernel): add sceCoredumpConfigDumpMode as a throwing stub
PPSA16833 imports it from libkernel, and its executable does not load
while no library exports the NID. The signature is unknown, so it throws
if called, like sceCoredumpWriteUserString.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:57:24 -07:00
Felipe Arce 46d49131e7 feat(libkernel): support EVFILT_READ on the read end of a pipe
kevent threw for any descriptor that is not a guest socket. The read end
of a pipe now gets the descriptor knote, following FreeBSD 11's
filt_piperead: data is the number of buffered bytes and EV_EOF is set
once the write end is closed. GuestSockets::Ready falls back to the new
PipeReadState for a descriptor that is not a socket, and WaitAny waits on
the pipe with ppoll on Linux or in 1 ms WSAPoll slices on Windows, only
when the queue holds a pipe. On Windows the equeue waker now starts
Winsock itself, since a queue can wait on a pipe before any socket exists.
2026-10-15 21:56:19 +00:00
Adrià f35c13fc95 Merge pull request #5833 from Ondra97/codex/fix-windows-vector-io-lock
fix(libkernel): serialize Windows vectored file transfers
2026-10-15 23:15:38 +02:00
Adrià f10fd23b60 Merge pull request #5865 from billythemenace2/fix/kernel-flexible-memory-size-zero
fix(kernel): read a zero flexibleMemorySize in param.json as the default budget
2026-10-15 23:01:24 +02:00
Adrià f27697f083 Merge pull request #5847 from akkadbakkad89/feat/kevent-ev-flags
feat(libkernel): implement kevent EV_DISABLE, EV_DISPATCH and EV_FORCEONESHOT
2026-10-15 23:01:10 +02:00
Adrià 02a1b772ed Merge pull request #5770 from simonbronk/fix/kernel-mprotect-undefined-bits
fix(libkernel): drop undefined protection bits in sceKernelMprotect
2026-10-15 17:53:02 +02:00
Adrià 0b5d774545 Merge pull request #5704 from fogydes/fix/libkernel-app-metadata-concurrency
fix(libkernel): protect app metadata state across threads and validate icon stream read
2026-10-15 17:04:22 +02:00
RickandClaude Opus 5.5 831c583003 fix(libkernel): refuse a closed loopback TCP port at once on Windows
Windows answers a SYN to a closed port with a RST and then retransmits
the SYN, so connect to a closed loopback port takes about 2 s before
ECONNREFUSED; FreeBSD fails at once. PS5VR (PPSA99177) makes about 33
such connects to 127.0.0.1:17600 and reaches its home screen 45 s late.

When no socket listens on the destination port (GetExtendedTcpTable),
a loopback connect now sets SIO_TCP_INITIAL_RTO with no SYN
retransmissions and fails at once. A port with a listener keeps the
retransmissions: Windows also answers a SYN to a full accept backlog
with a RST, and the retransmission connects once the server accepts,
as the console's does after FreeBSD drops the SYN.

guest_refused_connect requires ECONNREFUSED in under a second for a
closed port through libkernel connect and sceNetConnect, and a second
connect to a listener with backlog 1 to succeed once the server accepts
the first, through both.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 17:04:20 +02:00
Adrià d8862a63ba Merge pull request #5703 from EagleBearerYS/fix/libkernel-protect-reserved-host-stack
fix(libkernel): commit a reserved host stack before protecting it
2026-10-15 17:04:17 +02:00
Adrià 3751c55111 Merge pull request #5700 from specbug/fix/default-scope-guest-symbols
fix(libkernel): resolve renamed guest exports in the default scope
2026-10-15 17:04:10 +02:00
Adrià 162adb9da8 Merge pull request #5669 from MarcZX100/codex/signal-mask-128
fix(libkernel): honor all guest signal mask words
2026-10-15 17:03:59 +02:00
Adrià 8a253707e6 Merge pull request #5663 from al3w0f205/feat/libkernel-munlockall
feat(libkernel): add munlockall export
2026-10-15 17:03:54 +02:00
Adrià 9490a6da68 Merge pull request #5617 from Dripl1x/feat/socket-timeouts
feat(libkernel): apply SO_RCVTIMEO and SO_SNDTIMEO on a guest socket
2026-10-15 17:03:37 +02:00
Adrià 63b377b51b Merge pull request #5612 from JJenkx/feat/private-mutex-sharing
fix(libkernel): store mutex process-sharing attributes
2026-10-15 17:03:30 +02:00
Adrià 281336041a Merge pull request #5754 from fogydes/fix/libkernel-eventflag-clear-pattern-and-attr-validation
fix(libkernel): reject unknown event flag creation attributes
2026-10-15 15:58:10 +02:00
Ondra97 65e95f7139 fix(libkernel): serialize Windows vectored file transfers 2026-10-15 15:48:10 +02:00
fogydes 2210200232 fix(libkernel): reject unknown event flag creation attributes 2026-10-15 18:14:45 +05:30
fogydes c836b3b55b fix(libkernel): protect app metadata state across threads and validate icon stream read 2026-10-15 17:46:34 +05:30
Adrià 1036905b5f Merge pull request #5565 from Dripl1x/feat/socket-options-nodelay-nosigpipe-nbio
feat(libkernel): answer TCP_NODELAY, SO_NOSIGPIPE and SO_NBIO on a guest socket
2026-10-15 14:11:15 +02:00
Adrià 264a528877 Merge pull request #5556 from Nixitov/feat/rtprio-thread
feat(libkernel): implement rtprio_thread and the pthread concurrency controls
2026-10-15 14:10:58 +02:00
Adrià Franch 0a7193b5cd fix(libkernel): sigsuspend swaps and restores all four mask words 2026-10-15 13:54:05 +02:00