Commit Graph
8814 Commits
Author SHA1 Message Date
Adrià b87d3d87e2 Merge pull request #11080 from slopgobblercobbler/fix/savedata-ps4-null-argument-validation
fix(libSceSaveData.native): validate null arguments in sceSaveDataDirNameSearchPs4 and sceSaveDataMount
2026-10-27 08:46:03 +01:00
milescoviello 03ce876c46 Merge remote-tracking branch 'upstream/main' into docs/entitlement-key-call-sites
# Conflicts:
#	docs/dev/debt/libSceNpEntitlementAccess.md
2026-10-27 07:45:25 +00:00
Emanueleandmugurc 86cdfb8647 feat(libkernel): thread-local storage for Mach-O guests
FreeBSD code reaches its thread pointer through %fs and macOS cannot set
the fs base. The macOS relinker turns each %fs access of a guest image
into a stub that reads the thread pointer from a pthread key and calls
Aps5GuestTlsAllocate on a thread's first access, registers the TLS
descriptor of an image with Aps5GuestTlsRegister, and routes
__tls_get_addr to Aps5GuestTlsGetAddr. No library provided them, so a
relinked executable could not start.

- Aps5GuestTlsRegister validates the descriptor the relinker wrote and
  creates the key; its destructor frees the block of a thread.
- Aps5GuestTlsAllocateThreadPointer allocates the block (the TLS template
  followed by zeros, then a 0x100-byte thread control block whose first
  word points at itself, as on FreeBSD) and stores the thread pointer
  under the key.
- Aps5GuestTlsAllocate is the entry the stubs call: rax holds the
  descriptor and returns the thread pointer, every other register is
  preserved, the upper halves of the ymm registers only where AVX exists.
- Aps5GuestTlsGetAddr returns the block of the thread plus the offset.

Co-authored-by: mugurc <[email protected]>
2026-10-27 08:42:04 +01:00
Adrià dd6d71ba13 Merge pull request #11050 from harisibrar1/feat/libressl-asn1-string-to-utf8
feat(libSceLibreSsl): report ASN1_STRING_to_UTF8 errors through the ASN.1 error queue
2026-10-27 08:38:38 +01:00
Adrià e5779c0a84 Merge pull request #10790 from leorossi2005/feat/netctl-get-nat-info
feat(libSceNetCtl): implement sceNetCtlGetNatInfo
2026-10-27 08:38:33 +01:00
Dean Galvin 1affd8f731 fix(libSceFreeTypeOl): drop the exports open pull requests already implement
Remove 32 stubs whose NIDs are implemented by other open pull requests
(FreeType functions in #9398 #9399 #9404 #9410 #9465 #9588 #9792 #9924 #9933
#10579 #10588 #10591 #10600 #10601 #10602 #10606 #10613 #10616 #10897) and
correct the count in the debt entry.
2026-10-27 20:33:45 +13:00
Dean Galvin f407d1bd2b fix(libSceIcu): drop the stubs open PRs implement
Remove the 36 stubs whose NIDs open PRs #10962-#10967, #11115, #11118, #11122, #11132 and #11136 add to libSceIcu, leaving 112.
2026-10-27 20:32:39 +13:00
JaceTheBluandClaude Opus 5.5 c6522d4bce feat(libSceLibreSsl): add the LibreSSL object table and implement i2t_ASN1_OBJECT
i2t_ASN1_OBJECT threw and was declared without parameters. It now
prints an object's long name, or its short name, or its dotted OID, as
OBJ_obj2txt does in LibreSSL 2.5.4, the version string the module
holds: the NID is the object's own or found by the same binary search
over the same order, an unassigned NID reports OBJ_R_UNKNOWN_NID for
each name lookup, a truncated subidentifier returns 0 after the parts
already written, and arcs past 64 bits are printed exactly.

The 956 objects (short and long names, NID, OID) and their search order
are generated from 2.5.4's objects.txt and obj_mac.num with its own
objects.pl and obj_dat.pl, so d2i code can later hand out the same
static objects LibreSSL does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 08:30:25 +01:00
GruzzberryandClaude Sonnet 5.5 4d8fa35a5e fix(libkernel): fail sysctl and sysctlbyname with EFAULT on an unreadable or unwritable pointer
FreeBSD 11.4's sys___sysctl and userland_sysctl copy the name and the
old length in, and copy the value and the length out, so a bad pointer
gives EFAULT in that order. sysctl dereferenced them directly, and
sysctlbyname read its name with strcmp.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 08:30:17 +01:00
Adrià 8df2c3ed0e Merge pull request #11259 from orezraey/docs/libc-reallocalign-measured-ps5
docs(libc): record reallocalign to size 0 as measured on a PS5
2026-10-27 08:29:28 +01:00
Adrià 57e44c4b3d Merge pull request #11257 from orezraey/docs/libkernel-accept-option-inheritance-measured-ps5
docs(libkernel): record the socket options an accepted socket inherits as measured on a PS5
2026-10-27 08:28:31 +01:00
Adrià edabe9efa1 Merge pull request #11255 from Michael-KD/docs/vcc-descriptor-tuples-measured
docs(shader): record the VCC descriptor tuples measured on RDNA2
2026-10-27 08:28:15 +01:00
Adrià 42317c7f32 Merge pull request #11256 from Michael-KD/docs/array-comparison-through-2d-measured
docs(shader): record 2D-array comparison samples measured on RDNA2
2026-10-27 08:27:36 +01:00
Adrià 5c356f41c3 Merge pull request #11048 from imellag/feat/libkernel-macos-main-thread
feat(libkernel): start the guest off the main thread on macOS
2026-10-27 08:27:20 +01:00
Adrià b9a946180a Merge pull request #11046 from simnJS/claude/sweet-faraday-oqfsm5
feat(libSceUsbStorage): pass the host's USB FAT and exFAT volumes through
2026-10-27 08:27:14 +01:00
Adrià a0aafc1dba Merge pull request #11253 from orezraey/docs/libkernel-module-process-info-measured-ps5
docs(libkernel): record the text location, unwind info, SoC id and model queries as measured on a PS5
2026-10-27 08:26:53 +01:00
Adrià 8787ae1bb3 Merge pull request #11245 from AlexFigas/docs/libc-isfinitel-bundled-code
docs(debt): close the __isfinitel entry with the bundled libc.prx code
2026-10-27 08:23:28 +01:00
roboterspinne 0326845257 docs(relinker): record measured dyld behaviour for macOS fixups
The debt entry on pointer fixups in executable segments claimed that
dyld refuses them, which no run had shown. It now states what was
measured on an M1 Pro running macOS 27.0.1 under Rosetta 2: dyld_info
reports both cases, the PF_R|PF_W|PF_X case loads and runs, and a
fixup into a PF_R|PF_X segment ends with SIGBUS in dyld. The
interpreter_in_code fixture keeps a read-only data PT_LOAD for the
Windows runs, so PE output still covers a RELATIVE into it.
2026-10-27 08:18:50 +01:00
roboterspinne e5297264e3 fix(relinker): reject macOS fixups outside writable segments
The macOS image writer emitted dyld rebase and bind opcodes for any
target inside a segment, so an R_X86_64_RELATIVE into an R-X PT_LOAD
became a rebase into a read-execute segment. dyld-1378 refuses fixups
in segments without write access (enforceFixupsInWritableSegments), so
Locate now throws when the target segment lacks VM_PROT_WRITE. Such
inputs now fail the macOS conversion instead of writing an output that
dyld would not load.
2026-10-27 08:18:50 +01:00
Emanuele 896ae02ab5 fix(libkernel): address the macOS stack protection review 2026-10-27 08:16:36 +01:00
Emanuele 62d80b578f fix(libkernel): protect guest stack pages through the write watch on macOS 2026-10-27 08:16:36 +01:00
Emanuele f7f88a4886 fix(libkernel): wire a remapped locked range again on macOS
- mlock on macOS skipped every page the locked ranges recorded, but a
  mapping that replaces a locked range in place leaves the record behind
  without wires, so a later mlock returned 0 and wired nothing. Within a
  recorded range it now wires again the host regions whose wire count is
  0. The mlock test locks, remaps the range fixed and locks again.
- munlock and munlockall on macOS hold the locked-range lock across the
  host unwire and the record update, so a concurrent mlock cannot see a
  range as wired while it is being unwired.
- sceKernelVirtualQuery limits the host region it reports to the write
  watch run that holds the address, so the permissions it reports hold
  for the whole extent.
- The libc debt entry says what the mapping paths do: they register the
  range again, and GuestWriteWatchProtectionChanged has no caller yet.
2026-10-27 08:16:36 +01:00
Emanuele f2e8d5a3eb fix(libkernel): address the macOS memory protection review
- mlock on macOS wires only the pages libkernel has not wired yet. XNU
  counts each wire of a page, and the locked ranges merge overlapping
  locks, so a page locked twice stayed wired after munlock and
  munlockall. The mlock test checks the wire count on macOS.
- mprotect changes a watched page through GuestWriteWatchProtect, which
  applies the host protection and records it under the write watch's
  lock, so a collection on another thread cannot run between the two.
  The write watch test covers it.
- sceKernelVirtualQuery takes a watched page's write permission from the
  write watch for memory outside the guest allocation registry.
- GuestAllocationsGuestPages counts an image segment up to the end of
  its last host page, as the image page collection does.
- The macOS includes stay in main's include block, so the host code
  other pull requests add there still sees them; the unused Mach-O
  headers and the end trim, which never changed the protected spans,
  are gone, and the guest page size is passed in.
- The libc and libkernel debt entries describe what is wired now.
2026-10-27 08:16:36 +01:00
Emanueleandmugurc 190ed6c8fb feat(libkernel): guest memory protection and VirtualQuery on macOS hosts
- mprotect: the guest rounds a range to its 16 KiB pages. A Mach-O image
  is loaded at a multiple of the host page size only (4 KiB under
  Rosetta), so the pages are counted from where the ELF address 0 of the
  image holding the range was loaded, and a rounded edge smaller than a
  guest page that lies in the gap between two segments, where no host page
  exists, is left out. The write watch is told the new protection.
- sceKernelVirtualQuery reads the region with mach_vm_region.
- sceKernelMunlockall unlocks the ranges libkernel locked, one by one:
  macOS has no munlockall, which fails there with ENOSYS and would
  overwrite errno.
- The stack protect test reads page protections with mach_vm_region.

This is mugurc's f66a4df741 from his macOS series, without the mlock
check that #10889 adds.

Co-authored-by: mugurc <[email protected]>
2026-10-27 08:16:35 +01:00
milescovielloandClaude Opus 5.5 acd5ee3ff5 docs(libSceGameLiveStreaming): note the status fields three titles read
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 07:09:42 +00:00
xXPBSXx 9dc6ed12c2 Merge main (81267b2204) into libm/sinh-msun 2026-10-27 08:09:31 +01:00
milescovielloandClaude Opus 5.5 3e1dfe558f docs(libSceSigninDialog): note the result size and field three titles use
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 07:08:04 +00:00
Dean 81267b2204 Merge pull request #8725 from orezraey/fix/libkernel-sync-on-address-measured-ps5
fix(libkernel): follow sceKernelSyncOnAddressWait and Wake as measured on a PS5
2026-10-27 20:03:20 +13:00
Adrià eadb951c9d Merge pull request #11209 from voidlakhan/fix/np-universal-data-system-null-argument
docs(libSceNpUniversalDataSystem): record unverified null argument behavior
2026-10-27 08:02:56 +01:00
Dean 6af5e2de7f Merge pull request #10563 from bipinkrish/feat/opus-encoder-libraries
feat(core): implement the Opus encoder libraries
2026-10-27 20:02:48 +13:00
GruzzberryandClaude Sonnet 5.5 6b6ec00fad feat(libkernel_sys): implement kldsym argument checks
Follow FreeBSD 11.4's sys_kldsym: EFAULT for an unreadable lookup
structure, EINVAL for a wrong version or command, EFAULT or
ENAMETOOLONG for the symbol name, ENOENT for a negative file id. Any
other lookup throws, as no kernel module is modelled. Adds
GuestCopyIn_nid_no_patch for the checked structure read.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 08:01:39 +01:00
Adrià f1adec7eb1 Merge pull request #11230 from orezraey/docs/libkernel-sync-timeouts-eventflag-measured-ps5
docs(libkernel): record timed self-locks, event flag open and create, and the reltimed calls as measured on a PS5
2026-10-27 08:00:27 +01:00
xXPBSXxandClaude Sonnet 5.5 a695743b3d fix(libc): set ERANGE when sinh overflows
The host sinh set errno to ERANGE on overflow and sinhf does, but the msun port
returned the overflowed value with errno untouched. The overflow path of
sinh_nid_postfix sets ERANGE again; msun itself sets no errno.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 07:59:34 +01:00
Adrià b241428c63 Merge pull request #10984 from EagleBearerYS/fix/count-throwing-done-exports
fix(prx): report four exports that always throw as not implemented
2026-10-27 07:59:18 +01:00
Adrià bf83eae375 Merge pull request #10947 from roboterspinne/fix/relinker-windows-tls-template-imports
fix(relinker): reject Windows executable imports bound into the TLS template
2026-10-27 07:59:13 +01:00
Adrià 63d5eb00e4 Merge pull request #10892 from EagleBearerYS/feat/scefont-glyph-render-image-v2
feat(libSceFont): render generated glyphs with sceFontGlyphRenderImage
2026-10-27 07:59:02 +01:00
Adrià b806f1a7a0 Merge pull request #11217 from AlexFigas/docs/libc-dinkumware-division-evidence
docs(debt): cut the long-double Dinkumware entry to _LLog with the bundled libc.prx code
2026-10-27 07:58:44 +01:00
xXPBSXx fccdc6d687 Merge main (951e5963a4) into libm/sinh-msun 2026-10-27 07:58:16 +01:00
MarcZX10 280afbe043 docs(libSceGnmDriverForNeoMode): say that sceGnmRegisterOwner returns Failure instead of throwing 2026-10-27 06:57:40 +00:00
MarcZX10 1725aef9dc docs(libSceGnmDriverForNeoMode): record the single-source shadPS4 signatures of the declared stubs 2026-10-27 06:57:21 +00:00
xdCloudy 1e1d2368d0 docs: distinguish known exports from unverified ABI 2026-10-27 19:57:19 +13:00
Dean Galvin e78f746c20 fix(libSceIcu): drop the two exports main already has 2026-10-27 19:57:19 +13:00
xdCloudy 5b924dc09a feat(libSceXml): declare pending exports 2026-10-27 19:57:19 +13:00
xdCloudy 90ac7f3100 feat(libSceNpCommon): declare 150 additional PS5 exports 2026-10-27 19:57:19 +13:00
xdCloudy 834739e3fd feat(libSceCommonDialog): declare pending exports 2026-10-27 19:57:19 +13:00
xdCloudy 458a997895 docs: distinguish known exports from unverified ABI 2026-10-27 19:57:19 +13:00
xdCloudy 2e2e6f2775 feat(libSceIcu): declare 150 PS5 3.20 exports 2026-10-27 19:57:19 +13:00
iAbdulrrahman c8b4b292a9 feat(libkernel_sys): implement genuine console and platform identity queries 2026-10-27 09:55:24 +03:00
milescovielloandClaude Opus 5.5 d386018d18 docs(libSceSaveData.native): scope the result checks to the instructions after each call
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 06:47:46 +00:00
Adrià FranchandClaude Sonnet 5.5 7bc24e2311 docs(libSceNpUniversalDataSystem): link CreateHandle to Handle.cpp
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 07:47:28 +01:00