295 Commits
Author SHA1 Message Date
Dean e0a11b3fba Merge pull request #9515 from EagleBearerYS/fix/libkernel-getsockopt-net-sockets
fix(libkernel): getsockopt reads options of libSceNet sockets
2026-10-29 18:49:11 +13:00
Adrià 027989a44a Merge pull request #11858 from jotitadev/fix/macos-poll-hangup-both-directions
fix(libkernel): report POLLHUP on macOS only once both directions of a stream have ended
2026-10-28 18:20:12 +01:00
AdriàandClaude Sonnet 5.5 f87b6289ac fix(libkernel): export the kqueue descriptor check to libkernel_sys
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 08:43:15 +01:00
Yunus Shaikh 4432e8aa57 Merge main into fix/libkernel-getsockopt-net-sockets 2026-10-27 21:03:12 -07:00
Jota 8bed63610b fix(libkernel): report POLLHUP on macOS only once both directions of a stream have ended
XNU's poll reports POLLHUP as soon as either direction of a stream socket has ended, adds POLLPRI and POLLRDBAND to it and then drops POLLOUT. FreeBSD's sopoll_generic reports POLLHUP only once the receive and the send side are both shut, and Linux does the same, so on macOS a guest saw POLLIN|POLLHUP for a stream whose peer had only shut its sending side, and POLLHUP for one that had only shut its own.

When the host reports POLLHUP on a guest stream socket, ask it about each direction alone and keep POLLHUP only when both have ended, report the requested POLLOUT while the sending side is shut or writable, and leave urgent data to SIOCATMARK.
2026-10-27 06:55:16 -03:00
Evrim Cicek 3f67bbcd4e Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix/recvmsg-after-shut-rd
# Conflicts:
#	core/libs/prx/libkernel/Socket/src/Udp.cpp
#	docs/dev/debt/libkernel.md
2026-10-27 01:04:45 +03:00
Dean 94d981d20b Merge pull request #11194 from orezraey/fix/libkernel-socket-address-length-first-measured-ps5
fix(libkernel): check the socket address length before its family as measured on a PS5
2026-10-27 11:02:40 +13:00
Dean d018922066 Merge pull request #11141 from orezraey/fix/libkernel-recvmsg-timestamps-measured-ps5
fix(libkernel): report SCM_BINTIME and SCM_TIMESTAMP from recvmsg as measured on a PS5
2026-10-27 11:01:32 +13:00
Dean 5dd28e5682 Merge pull request #11135 from orezraey/fix/libkernel-dupfd-cloexec-measured-ps5
fix(libkernel): fail F_DUPFD_CLOEXEC and make F_DUP2FD_CLOEXEC ignore its target as measured on a PS5
2026-10-27 11:01:17 +13:00
Dean be0bbc6518 Merge pull request #11006 from harisibrar1/fix/so-acceptfilter-einval
fix(libkernel): fail SO_ACCEPTFILTER with EINVAL on a socket that is not listening
2026-10-27 10:59:07 +13:00
Dean 77d9056574 Merge pull request #10949 from AZLisme/feat/net-ipv6only
feat(libSceNet): support IPv6 dual-stack socket options
2026-10-27 10:57:32 +13:00
Dean 9021e9b66e Merge pull request #10621 from Retr0G28/fix/socketpair-fstat-inode
fix(libkernel): report NODEV and a per-socket inode from fstat on a socketpair end
2026-10-27 10:30:31 +13:00
Retr0 d99208fa84 Merge remote-tracking branch 'origin/main' into fix/socketpair-fstat-inode
# Conflicts:
#	core/libs/prx/libkernel/Socket/src/Udp.cpp
#	docs/dev/debt/libkernel.md
2026-10-26 21:09:20 +02:00
011010 9e23a9263c fix(libkernel): report urgent data in poll on macOS
XNU's poll never reports POLLPRI for out-of-band data, so a guest poll
that asks for it never sees the urgent byte: guest_poll aborts at the
OOB case and a title waiting on priority data would sleep to its
timeout.

On macOS the pending byte is read from SIOCATMARK, which reports it
without consuming it and has no descriptor limit, unlike the fd_set
probe this replaces. POLLRDBAND is set with POLLPRI as FreeBSD 11.4's
sopoll_generic does, and the wait takes the sliced path main already
uses for a kqueue wait, so it wakes on the next slice instead of at the
deadline.

recv(MSG_OOB | MSG_PEEK) was measured to consume the byte on macOS
27.0.1 and kevent with NOTE_OOB does not fire there, which is why the
probe is SIOCATMARK. The select and libSceNet poll paths still miss
urgent data on macOS and are recorded in the debt entry.
2026-10-26 13:00:51 -06:00
AZLisme ada64cab1e fix(net): preserve IPv6 socket option bridges in patched modules 2026-10-26 19:16:52 +08:00
AZLisme e846e0c7b2 fix(libSceNet): guard socket option guest outputs 2026-10-26 19:16:52 +08:00
Dean 9ab54a34b8 Merge pull request #11251 from orezraey/fix/libkernel-tcp-maxseg-measured-ps5
fix(libkernel): refuse TCP_MAXSEG before a connection and raise it to 216 as measured on a PS5
2026-10-26 22:11:42 +13:00
orezraeyandClaude Opus 5.5 85a1bf2b31 Merge main into fix/libkernel-dupfd-cloexec-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 23:27:02 -03:00
harisibrar1 7746b7a6f9 Merge remote-tracking branch 'origin/main' into fix/so-acceptfilter-einval 2026-10-25 21:44:28 -04:00
harisibrar1andClaude Opus 5.5 ce11ee1487 fix(libkernel): answer SO_ACCEPTFILTER on a datagram socket with EINVAL on Windows
Winsock does not answer SO_ACCEPTCONN on a datagram socket, so the
listening check returned the host error (ENOPROTOOPT). A datagram socket
can never listen, so it fails with EINVAL without asking the host, as
FreeBSD 11.4 does. Reported by @wachi35676.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 20:18:12 -04:00
orezraeyandClaude Opus 5.5 19566dbee8 fix(libkernel): set MSG_CTRUNC for an empty recvmsg control buffer as FreeBSD 11.4 does
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 21:05:10 -03:00
harisibrar1 7784604b0b Merge remote-tracking branch 'origin/main' into fix/pselect-pending-signal-eintr
# Conflicts:
#	core/libs/prx/libkernel/System/src/Signals.cpp
2026-10-25 19:35:03 -04:00
Dean 380ffe3a3a Merge pull request #10456 from alnsx/codex/fix-select-redirected-input
fix(libkernel): poll files on standard descriptors as vnodes
2026-10-26 12:09:32 +13:00
orezraeyandClaude Opus 5.5 ea02895cc0 fix(libkernel): refuse TCP_MAXSEG before a connection and raise it to 216 as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 19:35:33 -03:00
Evrim Cicek e5d82680e9 fix(libkernel): wake read waiters on every descriptor of a socket shut for reading 2026-10-26 01:09:24 +03:00
Evrim Cicek 1c5e876164 fix(libkernel): report EV_EOF and wake read waiters when a socket is shut for reading 2026-10-26 01:09:17 +03:00
Evrim Cicek cf57327015 fix(libkernel): drop the data a socket held before shutdown(SHUT_RD) in every receive path 2026-10-26 01:08:17 +03:00
Adrià 07da04f947 Merge pull request #9625 from rooklz/fix/macos-shutdown-already-shut
fix(libkernel): treat a socket direction that is already shut as shut on macOS hosts
2026-10-25 22:23:52 +01:00
orezraeyandClaude Opus 5.5 2d50330245 fix(libkernel): check the socket address length before its family as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:19:43 -03:00
orezraeyandClaude Opus 5.5 0868498fc2 fix(libkernel): make F_DUP2FD_CLOEXEC duplicate without the target as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:04:25 -03:00
orezraey ea98a6e5f1 fix(libkernel): fail F_DUPFD_CLOEXEC with EOPNOTSUPP as measured on a PS5 2026-10-25 18:04:25 -03:00
Adrià 9dbc017c71 Merge pull request #9512 from EagleBearerYS/fix/libkernel-poll-socket-hup
fix(libkernel): clear POLLOUT from a hung-up socket in poll on Linux
2026-10-25 21:16:45 +01:00
orezraeyandClaude Opus 5.5 49bcd7549e fix(libkernel): report SCM_BINTIME and SCM_TIMESTAMP from recvmsg as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 16:30:34 -03:00
Yunus Shaikh 7c36d37671 fix(libkernel): clear POLLOUT from a hung-up socket in poll on Linux
FreeBSD's pollscan clears POLLOUT whenever POLLHUP is set, for every
descriptor. 64ca6e332 applied that to pipes, but a stream socket whose
peer has closed and whose own sending side is shut down still reported
POLLOUT next to POLLHUP, because Linux's poll sets both. Linux sets
POLLHUP only once both directions are shut, the same condition as
FreeBSD, so poll now clears POLLOUT from any entry that reports POLLHUP
there.
2026-10-25 19:01:02 +01:00
Adrià FranchandClaude Sonnet 5.5 44393a3350 fix(net): reach the guest read through a _nid_no_patch export
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 18:56:25 +01:00
Braxton Atkinson 67c149465e feat(net): store DNS overrides and match firmware argument checks
Apply the firmware 13.42 module-probe report in PR #9506: all four DNS calls check initialization first; getters return EINVAL for null outputs or nonzero flags; setters reject flags before reading guest memory. Keep the checked input copy and document EFAULT as host safety, not firmware behavior. Use the current public Net.hpp declarations in the regression.

Rebased onto upstream e7e3e9c198. Ubuntu 24.04, GCC 13.3, Release: actual libc/libkernel/libSceNet libraries and both focused test executables built. guest_sce_net passes. A separate harness linked against those unmodified libraries passes initialization, errno, invalid flags, unreadable-input flag precedence, null clearing and unchanged-output checks. The full guest_net_dns_info test is blocked here: process_vm_readv is denied with EPERM by the execution environment. No full DNS regression pass is claimed. Public-header audit, conventions, test registration and whitespace checks pass.

The resolver still uses host DNS; IPv6 host-server discovery and firmware server-count behavior remain debt. Firmware evidence: https://github.com/boykopovar/AnyPS5/pull/9506#issuecomment-6390574180

AI-assisted: yes
2026-10-25 18:56:14 +01:00
Adrià f55190f7e3 Merge pull request #9477 from EagleBearerYS/fix/libkernel-udp-unreachable-port
fix(libkernel): stop Winsock failing an unconnected datagram receive after an unreachable port
2026-10-25 18:04:34 +01:00
alnsx 7eecb44157 chore: merge main after socket debt corrections 2026-10-25 12:23:32 -04:00
harisibrar1andClaude Opus 5.5 e829b5c331 fix(libkernel): fail SO_ACCEPTFILTER with EINVAL on a socket that is not listening as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 09:15:05 -04:00
Yunus Shaikh 00924d8f9f Merge main into fix/libkernel-getsockopt-net-sockets
Main extends the libkernel debt entry on libSceNet sockets with poll and
fcntl, where this branch adds getsockopt to the same entry; the merge keeps
both.
2026-10-25 03:59:43 -07:00
orezraeyandClaude Opus 5.5 20b38adb09 Merge main into fix/libkernel-socket-address-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 07:53:50 -03:00
alnsx d5ed8797cc chore: merge main and use canonical test declarations 2026-10-25 05:46:51 -04:00
Dean 9a2020c220 Merge pull request #10425 from Retr0G28/fix/sendfile-nonregular-einval
fix(libkernel): fail sendfile with EINVAL for a file that is not a regular file
2026-10-25 19:29:21 +13:00
Dean b5f669fd0d Merge pull request #10777 from harisibrar1/fix/select-clear-bits-past-nfds
fix(libkernel): clear select bits from nfds to the end of their word
2026-10-25 19:04:39 +13:00
harisibrar1 b8b42143b1 Merge main e7e3e9c198 into fix/pselect-pending-signal-eintr 2026-10-25 01:24:28 -04:00
orezraeyandClaude Opus 5.5 65e712b9c6 Merge main into fix/libkernel-socket-address-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 23:32:33 -03:00
slopgobblercobbler 7239ebb63e fix(libkernel): validate address family against socket family in bind 2026-10-25 02:14:14 +01:00
Yunus Shaikh fc47c2f491 Merge main into fix/libkernel-getsockopt-net-sockets
Main's #10706 declares getsockopt_nid_postfix and sceNetGetsockopt in the libraries' public headers, so this branch's local declarations of them in GuestSceNet.cpp and libSceNet's Export.cpp go.
2026-10-24 17:34:28 -07:00
Dean b7865bbb6b Merge pull request #8344 from Retr0G28/fix/socketpair-getpeername-enotconn
fix(libkernel): return ENOTCONN from getpeername once a socketpair peer closed
2026-10-25 13:28:30 +13:00
harisibrar1andClaude Opus 5.5 a63d961916 fix(libkernel): clear select bits from nfds to the end of their word as FreeBSD copies them out
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 19:55:07 -04:00