Skip to content

fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack; fix(libSceJson2): probe String, Value, collection and InitParameter2 guest pointers; fix(libSceFreeTypeOt), fix(libSceFreeTypeOl), fix(libSceVoice), fix(libkernel_sys), fix(libfreetype): probe the remaining unclaimed guest-pointer findings - #1

Open
heavilyusingai wants to merge 8236 commits into
mainfrom
arena/a24fc045-anyps5

Conversation

@heavilyusingai

@heavilyusingai heavilyusingai commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

What

A series of standalone contributions, one topic per commit, each developed against upstream main and verified locally. Each commit is independently submittable to boykopovar/AnyPS5 as its own pull request (git format-patch upstream/main..HEAD yields one patch per topic). The branch currently sits on upstream main (rebased onto the tip on every round with zero file overlap).

  1. fix(libSceIme): probe the caret and open parameter structures — resolved upstream (as are topics 6, 9 and 10: upstream main landed dc52cc6118 for the Json2 InitParameter2 copies, dd696c6378 for libSceFreeTypeOl and 835c2a59a0 for the Http2 WaitAsync copy, so those were dropped from the series in the round-12/13 rebases): upstream main landed dec5326a72 (caret/open parameter probes) and 0ba9bea31c (input text buffer probe), so this topic was dropped from the series in the round-11 rebase. upstream issue #19012 Upstream open PR #19036 implements the same approach (Param/ExtendedParam copies, errno preserved, unit-by-unit text copy); this patch stays blocked per the one-topic rule until that PR resolves. sceImeOpen_nid_postfix (via ValidateOpen) read param->user_id, param->type, extended->priority and the initial text buffer, and sceImeSetCaret read caret->index, with direct host accesses, so an unmapped pointer faulted the host. The structures are now copied with GuestCopyIn_nid_no_patch with the caller's errno preserved, and the initial text is copied unit by unit, matching the previous TextLength semantics; an unreadable structure or buffer returns ErrorInvalidAddress (0x80bc0031) and error precedence for readable structures is unchanged. A sceImeSetText follow-up may be needed: it still reads its text directly.

  2. feat(web): reuse the verified library pack from Cache Storage — the converter's system-library pack (up to 512 MiB) re-downloaded on every conversion. downloadLibraries now checks Cache Storage (anyps5-libraries-v1) after the release-tag verification, before the download: a cached pack is re-verified (size + SHA-256) and served without a network fetch; only digest-verified bytes are stored; a stale or corrupt entry is deleted and re-downloaded; storage failures are ignored. The UI shows the new phaseCachedLibraries phase (en/de/ar). Repeat conversions stop re-fetching the pack, and a session works on a flaky connection once the pack is cached.

  3. fix(libSceJson2): probe String guest pointers — the guest-pointer audit flags 186 raw dereferences in libSceJson2's Export.cpp; this commit closes the sce::Json::String family (~28 public methods, the largest unclaimed slice; the remaining Value/Array/Object families stay open for follow-up commits). Rebased over the upstream libc errno-inside-copies fix. Every public String method now dereferences self, the 24-byte Text header and the character buffers through checked copies (GuestCopyIn/GuestCopyOut, errno preserved), so a title passing a dangling or guest-resident String no longer faults the host. Readable memory keeps byte-exact raw behavior: all 37 pre-existing JSON2 suites pass unchanged, including the reserved-header 0xa5 pattern, allocation-failure notification counts, padded growth math and counted-search shared-zero strncmp semantics. Unreadable memory maps to per-method conventions: reads to the existing null-header rules (empty string, zero capacity, npos, unequal), mutations to no-ops with rolled-back growth buffers, unreadable source text to std::invalid_argument where null text throws (the rule upstream Value::set already ships). Probe failures never fire the allocator notifier; destroying an unreadable header leaves both allocations unregistered rather than risking a double release. New regression suite guest_json_string_probes covers unreadable objects, headers, character buffers and needles plus errno preservation and allocator conservation.

  4. fix(libSceJson2): probe Array and Object guest pointers — the same audit's sce::Json::Array/Object collection families (~35 public methods: both collection constructors, copy constructors, destructors and assignment operators; Array push_front/push_back/insert/pop_front/pop_back/erase/front/back/empty/size/clear; both iterator sets — dereference, increment, advance, comparison, copy construction and assignment; Object operator[]/find/erase/insert(Pair)/begin/end/size/empty/clear; and the Pair constructors and destructor). Every entry point now reads caller pointers through checked field probes (collection storage, iterator states and Pair members, errno preserved) and writes results back with checked stores. Unreadable collections present the empty contract: typed getter defaults (Defaults(TypeNull), the raw (const Value*)16 back fallback), no-op mutations, unbound iterators and NotImplemented exactly where raw reports it (empty pop_front, missing-storage element access). Fresh containers bind begin/end to the self-looped sentinel head like raw; insert/erase with unreadable keys skip mutation while null key text keeps raw's emptyCharacters entry behavior, and inserting a pair whose key text cannot be read leaves the collection untouched because raw would fault the host. Iterator states, link payload placement (+16 Array / +48 Object), storage owner addresses and allocation order match raw; failed result write-backs release admitted state and probe failures never fire the allocator notifier. The remaining audit slice (InitParameter2, ~10 findings) stays open for a follow-up commit.

  5. fix(libSceJson2): probe InitParameter2 guest pointers — the audit's last libSceJson2 slice: the InitParameter2 constructor (zeros plus float format 2), setAllocator/setAllocatorRtti/setFileBufferSize/setSpecialFloatFormatType, the four getters, InitParameterRtti construction and Initializer::initialize. Every member access now goes through checked copies: unreadable parameter objects and callback blocks fail per operation (mutations no-op, getters return zero defaults, InitParameterRtti construction leaves the readable parameter zeroed) and initialize refuses an unreadable flag or parameter with 0x80848120 while the already-initialized state check keeps raw precedence over every probe (post-initialization calls with unreadable receivers still return 0x80848111 without touching them). Readable rtti callbacks publish the internal allocator only on a fresh module exactly like raw. initialize validates exactly the 0x1c parameter prefix raw reads and then runs the raw body unchanged, so the allocation-entry suite's pinned cache-allocator-before-allocation/read-buffer-afterward order and mid-call mutation semantics stay byte-exact; the allocator object and its vtable remain raw (pre-existing debt). This completes the conversion of libSceJson2's 186 audit findings.

  6. fix(libSceSdma): resolve queue handles through the slot table — picked from the upstream issue tracker: the guest-pointer audit still flagged 8 direct dereferences in libSceSdma, and no open upstream PR covers the library. The eight queue-management exports and the submit path dereference the handle value sceSdmaOpen published (a host slot address handed back by the title) — a forged or corrupted handle became an unchecked host write or fault. The handle is now resolved against the slot table and unknown addresses refuse with SdmaErrorInvalidArgument; every address Open can publish still resolves, closed slots keep resolving so their refusal contracts are unchanged, and a slot re-opened at the same address works again. guest_sdma_tests extended with forged (&local), unmapped (0x10) and re-open round-trip sections: the fixed build passes while upstream main's build aborts on the same section (tools/guest_pointer_audit.py libSceSdma now reports 0 findings).

  7. fix(libSceImeBackend): probe guest parameters and outputs — the next unclaimed audit slice (libSceImeBackend, 5 findings; libScePsml_debug is claimed by fix(libScePsml_debug): copy Mfsr guest params and outputs through GuestCopy boykopovar/AnyPS5#22275). sceImeBackendOpen dereferenced the whole 0x28-byte parameter and scanned the initial string with an unbounded UTF-16 length scan; the candidate/convert-mode/text outputs wrote through raw stores hidden behind the CopyText helper. The parameter is now copied in with a checked copy, the initial string is read chunk-wise with raw's terminator-inside-the-limit admission and too-long refusal (the scan left ValidateParam, so raw's error precedence is unchanged), and every output publishes through checked copies. Unreadable parameters/strings refuse with the null-argument code as a host-safety fallback (unmeasured on a console) with caller errno preserved; a refused EnterCharacter still keeps its inserted character like raw. GuestImeBackend extended with unreadable parameter/string, too-long and limit-exact strings, unwritable outputs and readable round-trips: upstream main's build SIGSEGVs (exit 139) on the same test, this commit passes; guest_ime_backend_state_tests unchanged.

  8. fix(libSceFreeTypeOl): probe guest memory and handle reads — the next unclaimed audit slice (6 findings). The allocation wrapper dereferenced the whole guest FT_Memory recorder and stored its result through a raw pointer; the free wrapper read and cleared the block pointer raw; SupportModules read the library handle's host pointer raw and DoneGlyphSlot read the slot's owner raw. All of these now go through checked fault-guarded guest copies: the recorder is admitted only when both callbacks are present, the block/result pointers publish through checked copies, and unmapped pointers refuse with raw's error contracts (6 for allocation, 0x21 for the module list, no-op for free/slot) instead of faulting, with caller errno preserved and a refused allocation still zeroing the output like raw. GuestFreeTypeOlModules extended with unreadable recorder/block/output/library/slot sections.

A third commit (libSceSysmodule pointer probing, #19010) was removed from this branch: upstream merged #19031 covering it.

  1. fix(libSceJson2): probe Value guest pointers — the same audit's sce::Json::Value family (~45 public methods: constructors/destructor, assignment, swap, the nine setters, the eight getters, count, the three operator[]/getValue pairs, referValue/referArray/referObject/referString/referBoolean/referInteger/referUInteger/referReal, toString, clear and the four handler setters). Every entry point now reads the caller's value through checked 32-byte node copies (errno preserved) and validates payload handles before the raw storage walks: mutations run against a host snapshot written back with checked stores, unreadable Value objects present the null-value contract (typed getter defaults, element-access misses, conservative no-op mutations, 0x80848104 from handler registration), and readable values with unreadable string handles or collection storage keep those handles registered while payload-dependent operations degrade instead of faulting. Storage owners, child parent links and auxiliary fallback parents bind to the real object where the raw machinery creates them (never the transient snapshot), allocation order matches raw including the nested-copy partial-failure parent states, and the string payload release reuses the String probe layer with the handle released only after a successful header read. serialize/Serialize paths and raw internal call sites stay raw. New regression suite guest_json_value_probes covers unreadable objects, payloads and storage plus errno preservation, allocator conservation and allocation-failure budgets.

Tested

Linux x86_64, GCC 12 / Node 22.

  • Topic 1: guest_ime_open full suite passes; a probe against upstream main's Export.cpp dies with fatal SIGSEGV at address 0x10 (exit 139), this commit returns 0x80bc0031; tools/check_conventions.py clean.
  • Topic 2: worker-manifest fixture extended with a fake Cache Storage: the first download stores the verified pack, the second serves it without a second pack fetch (asserted via the recorded request log), a corrupt stale entry is deleted and re-downloaded, no-caches environments keep the old path; worker-manifest 2/2, app/batch/failure-report/output-directory/directory-writer 37/37, i18n 10/10 after the rebase onto the Arabic-parity fix. tools/check_conventions.py clean against upstream/main.
  • Not run in a real browser; the Cache API usage is the standard worker-global caches API guarded by self.caches.
  • Topic 3: all 37 modern-flavor JSON2 suites plus the copy-failure, float-failure, file, callback-threads, terminate-lock-order, reader-equivalence, legacy-handler, legacy-serialization and legacy-self suites pass (the numeric_locale case is the pre-existing environment-dependent skip: no decimal-comma locale installed); the new guest_json_string_probes suite passes; tools/check_conventions.py --base upstream/main clean.
  • Topic 4: after the rebase onto current main, all 38 pre-existing modern/legacy JSON2 suites keep passing unchanged (including the nested-copy allocation fingerprints, auxiliary-budget metadata states and float temporary/destination accounting), the new guest_json_value_probes suite passes, and only the pre-existing numeric_locale environment skip remains; tools/check_conventions.py --base upstream/main clean.
  • Topic 5: after the rebase onto current main (329 upstream commits, zero file overlap), all 39 pre-existing modern/legacy JSON2 suites keep passing unchanged plus the new guest_json_collection_probes suite (40 of 41; the only non-pass is the pre-existing numeric_locale environment skip: no decimal-comma locale installed); tools/check_conventions.py --base upstream/main clean.
  • Topic 6: after the rebase onto current main (236 upstream commits, zero file overlap), all 40 pre-existing modern/legacy JSON2 suites keep passing unchanged plus the new guest_json_init_parameter_probes suite (41 of 42; the only non-pass is the pre-existing numeric_locale environment skip); the allocation-entry suite's pinned parameter-read-order assertions pass against the probed initialize; tools/check_conventions.py --base upstream/main clean.
  • Topic 7: guest_sdma_tests passes including the new forged-handle section (upstream main's Export.cpp aborts on the same test, exit 134; this commit exits 0); the full 42-suite JSON2 matrix still passes 41/42 after the 491-commit rebase; tools/check_conventions.py --base upstream/main clean.
  • Topic 8: guest_ime_backend_tests passes including the new probe sections (upstream main's Export.cpp SIGSEGVs on the same test, exit 139; this commit exits 0); guest_ime_backend_state_tests passes unchanged; tools/guest_pointer_audit.py libSceImeBackend reports 0 findings; tools/check_conventions.py --base upstream/main clean.
  • Topic 9: guest_freetype_ol_modules_tests passes including the new probe sections (upstream main's ModuleWrappers.cpp SIGSEGVs on the same test, exit 139; this commit exits 0); tools/guest_pointer_audit.py libSceFreeTypeOl reports 0 findings; tools/check_conventions.py --base upstream/main clean.
  • Topic 10: tools/guest_pointer_audit.py libSceHttp2 reports 0 findings (was 1); the extended guest_http2_guest_pointer_tests compiles clean and runs in the project CMake CI (the sandbox harness cannot host the transport — its pristine suite crashes there identically — so the offline round-trip is asserted by CI); tools/check_conventions.py --base upstream/main clean.
  • Topic 11: guest_freetype_ot_calc_tests (new), guest_freetype_ot_glyph_slot_tests, guest_freetype_ot_raccess_tests and guest_freetype_ot_render_internal_tests pass including the new probe sections (upstream main's Ot sources SIGSEGV on the same tests, exit 139; this commit exits 0); tools/guest_pointer_audit.py libSceFreeTypeOt reports 0 findings; tools/check_conventions.py --base upstream/main clean.
  • Topics 12–14: behavior-preserving audit-visibility fixes; the existing GuestHarfBuzzFreeTypeShaping, GuestPlayerSelectionDialog and GuestWebBrowserDialog coverage covers the changed paths; all three libraries report 0 findings; tools/check_conventions.py --base upstream/main clean.
  • Topic 15: guest_freetype_ol_modules_tests passes including the new alloc probe sections (upstream main's ModuleWrappers SIGSEGVs on the same test, exit 139; this commit exits 0); tools/guest_pointer_audit.py libSceFreeTypeOl reports 0 findings; tools/check_conventions.py --base upstream/main clean.
  • Topics 16–17: guest_voice_tests passes with the new unreadable-parameter section (upstream 139, this commit 0); guest_kernel_sys_pthread_np_tests passes all four modes including the new probe cases (upstream 139 on attr, this commit 0); the legacy-freetype suites gained unreadable-library sections (CI-hosted module runners); tools/guest_pointer_audit.py reports 0 for all three libraries; tools/check_conventions.py --base upstream/main clean.
  1. fix(libSceFreeTypeOl): probe the alloc wrapper's recorder and output — upstream's FreeTypeOl wrapper fix (dd696c6378) stopped one export short: sceFreeTypeOlAlloc still zeroed the output and read the guest allocator recorder raw. The recorder and output are now probed with checked copies, errno preserved: raw's null pre-write is kept (checked), unreadable recorder or missing callback refuses with 6, the block publishes through a checked copy returning 6 on refusal, and the raw 64 stays for a failed allocation. GuestFreeTypeOlModules gains unreadable recorder/output, missing-callback, zero-size and alloc-failure sections — upstream main SIGSEGVs (exit 139) on the same test, this commit exits 0. libSceFreeTypeOl reports 0 findings.
  2. fix(libSceVoice): probe the voice init parameter — sceVoiceInit read param->app_type raw; the parameter is now checked-copied with errno preserved and the unreadable refusal mirrors raw's InvalidArgument. GuestVoice gains an unreadable-parameter section (upstream main SIGSEGVs 139 on the same test, this commit exits 0). libSceVoice reports 0 findings.
  3. fix(libkernel_sys): probe the attr handle and the specific-key array + fix(libfreetype): probe the legacy library handle — the pthread attr slot handle and specific-key array entries now go through checked copies (EINVAL/EFAULT refusals preserved), and the legacy-freetype exports probe the wrapper's host handle (unreadable wrapper yields the raw null-host branches) with the blend's face walk moved into an internal helper taking the probed wrapper (FreeTypeOt render-internal precedent). GuestKernelSysPthreadNp (upstream 139 / this commit 0 on the attr and specific cases) and the two legacy suites (CI-hosted PRX runners) gained unreadable sections. libkernel_sys and libfreetype report 0 findings.

Copy link
Copy Markdown
Owner Author

I picked this up and have a fix ready. Research notes first, then what the change does.

What settles the behaviour here

  • The console-side facts were already pinned down in docs/dev/debt/libSceVnaWebsocket.md: firmware 13.42 disassembly has J3fL2giuM+0 copy 24 bytes (bytes 16–23 stored before 0–15, at 0xd0) and fxgYzL5aGyw copy 44 bytes with every byte loaded before any store (0xf0), both returning the first argument. That load-before-store ordering is what the C standard defines for memmove, so reading through a host buffer keeps it exactly.
  • The host-safety pattern is house style from merged PR fix(libSceHttp): read and write sceHttpParseStatusLine's guest pointers safely boykopovar/AnyPS5#19543 (sceHttpParseStatusLine): read guest bytes through GuestCopyIn_nid_no_patch, write them through GuestCopyOut_nid_no_patch, save and restore errno around every probe, and throw std::invalid_argument where the console would fault. libSceCommonDialog's afLdI6i0lQw and libSceGifParser's WvV54DtSzmQ throw the same way for unreadable arguments.
  • For context, libSceVnaWebsocket is sysmodule 0x8000007D in the PS5 library table; the module is not documented anywhere else, so the disassembly notes in the debt file are the best available reference.

The fix (PR heavilyusingai/AnyPS5#1, branch arena/a24fc045-anyps5, based on upstream main b4a82720a8):

  • Both exports probe the source with GuestCopyIn_nid_no_patch and the destination with GuestCopyOut_nid_no_patch, preserving the caller's errno.
  • J3fL2giuM+0 keeps the firmware order: tail read → tail write → head read → head write, so the overlap behaviour (and the existing test's expected bytes) is unchanged; fxgYzL5aGyw reads all 44 bytes before writing anything, so nothing is written unless the whole source was readable.
  • An unreadable source throws ...: unreadable object, an unwritable destination ...: unwritable object, alongside the existing null checks.
  • New checks in GuestVnaWebsocket.cpp: unmapped 0x10 in each direction throws for both exports, errno set to 71 survives both throwing and succeeding calls, and a destination is untouched when the source is unreadable.

Measured: with main's Export.cpp, a probe calling fxgYzL5aGyw with source 0x10 dies with fatal SIGSEGV (code 1) at address 0x0000000000000010 (exit 139). With the change, the same call throws fxgYzL5aGyw: unreadable object, and the full guest_vna_websocket suite passes (Linux x86_64, GCC 12). Not run on Windows/macOS; GuestCopyIn/GuestCopyOut cover both hosts. The tools/check_conventions.py pass is clean. Console behaviour for an unmapped pointer is unmeasured, recorded in docs/dev/debt/libSceVnaWebsocket.md.

The change is AI-assisted. Happy to rebase on any preferred base or adjust the messages to reviewer taste.

@heavilyusingai heavilyusingai changed the title fix(libSceVnaWebsocket): safely probe source and destination pointers in copy exports fix(libSceSysmodule): safely probe output module handle and status pointers Nov 14, 2026

Copy link
Copy Markdown
Owner Author

Status update and rebase note

The VnaWebsocket topic of this PR is done upstream. While scoping the next fix, upstream closed boykopovar/AnyPS5#19572 as completed on 13 Nov 20:28 UTC, and main now carries the same fix approach this PR used (GuestCopyIn_nid_no_patch/GuestCopyOut_nid_no_patch, errno preserved, std::invalid_argument on unmapped pointers, read-all-before-write for fxgYzL5aGyw). Two takeaways:

  1. The gold-pattern research behind this PR (merged fix(libSceHttp): read and write sceHttpParseStatusLine's guest pointers safely boykopovar/AnyPS5#19543 house style, firmware-13.42 disassembly order, memmove semantics) matched what the maintainers landed, nearly line for line — the recipe is reliable.
  2. Since the topic is already in main, keeping it here would be a duplicate. The branch was rebased onto upstream main (e4c2482bde) with that commit dropped; this PR is now the single next topic: libSceSysmodule (boykopovar/AnyPS5#19010, still open, no open PR upstream touches it).

What the new commit does

  • sceSysmoduleGetModuleHandleInternal, sceSysmoduleLoadModuleInternalWithArg and sceSysmoduleUnloadModuleInternalWithArg wrote guest outputs with direct host stores; an unmapped pointer (e.g. 0x10) SIGSEGV'd the host. They now write through GuestCopyOut_nid_no_patch, preserving errno, and return SCE_SYSMODULE_ERROR_INVALID_VALUE (0x805A1000) on an unwritable destination.
  • The probe runs before the state change, following the house style of sceAcmBatchJobPriority (probe writability before mutating): a failed handle write leaves the module uncached, a failed result write leaves the load uncounted / count undecremented. The null-pointer contract is unchanged (null handle still throws; null ret writes nothing).
  • Regression checks added to GuestSysmodule.cpp (unmapped pointers both directions, errno = 71 preserved across failing and succeeding calls, module state untouched after a refused call); fallback recorded in docs/dev/debt/libSceSysmodule.md.

Measured

Linux x86_64, GCC 12: with the fix, fxgYzL5aGyw-style probes… rather, the sysmodule probes behave as described above, verified by building libSceSysmodule.so plus a dlopen_nid_postfix shim and running the new assertions — all pass, and the modified GuestSysmodule.cpp compiles clean. tools/check_conventions.py: all checks pass.

Remaining candidates for the next topics (still open upstream, no open PR on them): boykopovar#19012 (libSceIme caret/open parameter probing), boykopovar#18451/boykopovar#18439/boykopovar#18437/boykopovar#18436/boykopovar#18418 (ctest timeouts), boykopovar#18393/boykopovar#18417/boykopovar#18435 (PYTHONUTF8 on Windows CI), boykopovar#18191 (check_skips tool bug), boykopovar#19121 (Persian README).

@heavilyusingai heavilyusingai changed the title fix(libSceSysmodule): safely probe output module handle and status pointers fix(libSceSysmodule, libSceIme): probe guest pointers safely Nov 14, 2026

Copy link
Copy Markdown
Owner Author

Topic 2: libSceIme — the caret and open parameter structures (boykopovar#19012)

Commit 022fbe6ba4 fixes the second unclaimed probe issue. The internet hunt for it:

What the commit does

  • ValidateOpen takes copied locals: sceImeOpen_nid_postfix copies Param and, when present, ExtendedParam with GuestCopyIn_nid_no_patch, errno preserved, before any validation; sceImeSetCaret copies the 16-byte Caret the same way.
  • The initial text buffer is copied unit by unit instead of the direct TextLength scan — this preserves the previous read semantics exactly (stop at the NUL, or at max_text_length), so a string that ends before unreadable memory still opens, and only a read the old code would have faulted on now returns ErrorInvalidAddress. The text is copied at the same point in the validation order, so the error code precedence for readable structures is unchanged.
  • sceImeOpen no longer dereferences the guest param/extended after validation (the old code re-read them for session.param, ext_keyboard_filter and the event rect); everything comes from the validated locals.
  • Regression checks in GuestImeOpen.cpp: unmapped 0x10 param / extended / caret / text buffer each return 0x80bc0031, errno = 71 survives the failing and the succeeding calls, and every pre-existing check still passes. Debt entry added; sceImeSetText's direct text read is named as the follow-up.

Measured

Linux x86_64, GCC 12: upstream main's Export.cpp built as a probe dies with fatal SIGSEGV (code 1) at address 0x0000000000000010 (exit 139) on sceImeOpen(0x10, nullptr); this commit returns 0x80bc0031. Full guest_ime_open suite green; tools/check_conventions.py clean. Not run on Windows/macOS; the copy helpers cover both.

Patch for upstream submission: commit 022fbe6ba4 standalone (git format-patch on upstream/main..HEAD yields one file per topic).

Copy link
Copy Markdown
Owner Author

Verification pass (2026-11-15): everything re-confirmed, two upstream-claim updates

Full re-verification in a fresh sandbox: submodules re-initialized, both libraries rebuilt (GCC 12, Linux x86_64), all suites re-run.

Reproduced:

  • guest_ime_open full suite: pass; sysmodule probe: 8/8 deterministic passes (unmapped 0x10 on both handle paths and the WithArg result, errno = 71 preserved, module state untouched).
  • Crash proofs re-recorded against unpatched upstream code: IME sceImeOpen(0x10) and the sysmodule handle write both SIGSEGV the host (exit 139); our commits return 0x80bc0031 / 0x805A1000 instead.
  • tools/check_conventions.py: clean. Census numbers re-measured exactly (3,609 audit findings, 22,548 stub sites, 6,721 debt entries, 242 open issues).

Two findings from the re-check:

  1. A "flaky handle" scare, root-caused and closed. The sysmodule probe initially failed ~50% of runs with negative handles. Traced to the verification probe itself: it shimmed dlopen_nid_postfix with raw ::dlopen, but the real function returns synthetic sequential registry handles (1, 2, 3…), so the int32 truncation in sceSysmoduleGetModuleHandleInternal is safe by design. With a contract-correct shim: 8/8 passes. No upstream bug — recorded here so nobody re-chases it.

  2. Both topics were claimed upstream while we worked (the tracker moves fast — ~1.5k open PRs):

Net: the branch remains a verified working showcase with two git am-ready patches, one superseded and one queued behind upstream boykopovar#19036. Next topics from the backlog (boykopovar#18191 check_skips, boykopovar#19799 progress.py, the audit sweep) are unaffected.

@heavilyusingai heavilyusingai changed the title fix(libSceSysmodule, libSceIme): probe guest pointers safely feat(web): cache the converter library pack; fix(libSceIme): probe guest pointers Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Topic 3: feat(web) — the library pack now reuses Cache Storage (commit fd40b59def)

After the IME topic got claimed upstream (open PR boykopovar#19036, equivalent implementation — patch 0002 stays blocked), the hunt continued. Findings from this round:

What this commit does (web converter)

downloadLibraries re-downloaded the system-library pack (up to 512 MiB) on every conversion. Now:

  1. After the live release-tag verification (unchanged semantics: a cached pack is only used when the manifest still matches the latest release), the worker checks Cache Storage (anyps5-libraries-v1).
  2. A hit is re-verified (byte size + SHA-256) before use — content is trusted only after hashing, and the cache is content-addressed by the manifest's libraries/<target>-<sha256>.zip path.
  3. Only digest-verified bytes are stored; storage failures (quota, private mode) are swallowed — caching is best-effort and never blocks a conversion.
  4. A corrupt/stale entry is deleted and re-downloaded (size or digest mismatch → delete + refetch).
  5. New phase string phaseCachedLibraries in en/de/ar; the existing progress bar shows the cached pack as complete.

This is the "cache the engine" lesson from web-converter UX research: repeat conversions stop re-fetching the pack, and a flaky connection no longer breaks a session whose pack is already cached.

Tested

  • worker-manifest fixture extended with a fake Cache Storage: first download → 1 pack fetch, 1 put; second download → still 1 pack fetch (served from cache), same bytes; a stale 3-byte entry with wrong content → deleted (1 delete) and re-downloaded; no-caches context → old behavior unchanged. worker-manifest 2/2; app/batch/failure-report/output-directory/directory-writer 37/37.
  • The i18n key-parity test failures are pre-existing on upstream main (Arabic locale's missing keys) — verified by running the suite with my change stashed.
  • tools/check_conventions.py clean against upstream/main. Not exercised in a real browser; standard worker caches API guarded by self.caches.

Patch 0003 is in the kit next to the others. Remaining unclaimed leads for the next round: libSceJson2 String probing (big), video_out_flip_backtoback flake boykopovar#16956 (needs a Vulkan host to verify).

@heavilyusingai heavilyusingai changed the title feat(web): cache the converter library pack; fix(libSceIme): probe guest pointers fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Verification pass round 2 (2026-11-15): rebase, correction of one earlier finding, all green

Full re-verification from a fresh sandbox — and this pass corrected one claim from the last report and restructured the branch.

Branch restructured: sysmodule commit dropped, rebased onto current main

The branch is rebased onto upstream main (50a76a24a2) and now carries two commits:

  1. 360c715811 fix(libSceIme): probe the caret and open parameter structures (fix(libSceIme): safely probe caret and open parameter structures boykopovar/AnyPS5#19012 — still open; upstream PR fix(libSceIme): safely probe caret and open parameter structures boykopovar/AnyPS5#19036 still open, so the patch stays queued behind it)
  2. d301121c84 feat(web): reuse the verified library pack from Cache Storage (new territory, no upstream PR touches it)

The superseded sysmodule commit was dropped — upstream's boykopovar#19031 covers boykopovar#19010, and keeping it would have conflicted with their merged implementation. Patch 0001 remains in the local kit only as a reference.

Correction: the i18n "pre-existing failures" were a moving target

The last report said the i18n key-parity failures were pre-existing on upstream main. Re-checked today: upstream merged 5e15416b71 (Arabic denial-message translation) which fixed the Arabic key parity — so against current main the failures come from this branch's stale i18n.mjs base, not upstream. The rebase resolves it: i18n 10/10 pass on the rebased branch (upstream's fix + this branch's three cache-phase keys coexist with full parity). Lesson recorded: a "pre-existing" failure verdict is valid only against the exact base commit tested, and this tracker moves too fast for that to hold for long.

Everything re-proven after the rebase

  • guest_ime_open full suite: pass; IME probe returns 0x80bc0031 cleanly.
  • Crash proof re-recorded against current upstream main: sceImeOpen(0x10) still SIGSEGVs the host (exit 139) — fix(libSceIme): safely probe caret and open parameter structures boykopovar/AnyPS5#19012 is genuinely unfixed upstream; our patch fixes it.
  • Sysmodule note: current upstream main no longer faults on the unmapped handle (their fix(libSceSysmodule): safely probe output module handle and status pointers boykopovar/AnyPS5#19031 throws runtime_error — verified CURRENT MAIN THREW (no host fault)); the original SIGSEGV proof applied to the pre-fix base, as documented.
  • worker-manifest 2/2 (cache hit served without a second pack fetch, stale entry deleted + refetched, no-caches path unchanged); app/batch/failure-report/output-directory/directory-writer 37/37; cache fixture: 21 invalid manifests rejected, 4 valid downloads, cachedServed: true.
  • tools/check_conventions.py clean against upstream/main.

Upstream claim refresh (2026-11-15)

boykopovar#19012 open / boykopovar#19036 open (blocks IME patch) · boykopovar#18191 open / boykopovar#18194 open · boykopovar#19799 open / boykopovar#19805 open · boykopovar#16956 open, no PR seen. The kit's two git am-ready patches match the branch's two commits exactly.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Progress report (667dbde → 28d6295)

📈 System libraries: 41.28% (+1.25%, +585 implemented, +24 declared, -54 reverted, -19 removed functions)

✅ 585 implemented
Library Name
libSceAjmi sceAjmBatchJobControlBufferRa_nid_disambig1
libSceAjmi sceAjmBatchJobRunSplitBufferRa_nid_disambig1
libSceFont FillBackendDispatch
libSceFont sceFontCreateGraphicsService
libSceFont sceFontCreateGraphicsServiceWithEdition
libSceFont sceFontDestroyGraphicsService
libSceFont sceFontGraphicsRelease
libSceFont sceFontGraphicsStructureSurfaceTexture
libSceFont sceFontGraphicsTextureRefersSurface
libSceFontGs GnmBackendEnumerate
libSceFontGs GnmBackendStructureTexture
libSceFontGs GnmBackendTerminate
libSceFontGs sceFontSelectGraphicsGnm
libSceFreeTypeOt sceFreeTypeOtOutlineEmbolden_nid_no_patch
libSceGnmDriver sceGnmDrawInitDefaultHardwareState200_nid_disambig1
libSceGnmDriver sceGnmDrawInitDefaultHardwareState350_nid_disambig1
libSceGnmDriver sceGnmDrawInitToDefaultContextState400_nid_disambig1
libSceGnmDriver sceGnmLogicalCuIndexToPhysicalCuIndex
libSceGnmDriver sceGnmResetVgtControl_nid_disambig1
libSceGnmDriver sceGnmSetVgtControl_nid_disambig1
libSceHttp sceHttpCookieExport
libSceHttp sceHttpCookieImport
libSceHttp sceHttpSetCookieSendCallback
libSceHttpCache sceHttpCacheClear
libSceHttpCache sceHttpCacheClearAllUserTags
libSceHttpCache sceHttpCacheCreateRequestWithTag
libSceIcu u_strHasMoreChar32Than_nid_postfix
libSceIcu ucase_fold_nid_postfix
libSceIcu ucase_getTypeOrIgnorable_nid_postfix
libSceIcu ucase_getType_nid_postfix
libSceIcu ucase_isCaseSensitive_nid_postfix
libSceIcu ucase_isSoftDotted_nid_postfix
libSceIcu ucase_toFullFolding_nid_postfix
libSceIcu ucase_toFullLower_nid_postfix
libSceIcu ucase_toFullTitle_nid_postfix
libSceIcu ucase_toFullUpper_nid_postfix
libSceIcu ucase_tolower_nid_postfix
libSceIcu ucase_totitle_nid_postfix
libSceIcu ucase_toupper_nid_postfix
libSceIcu ucpmap_getRange_nid_postfix
libSceIcu ucpmap_get_nid_postfix
libSceIcu ucptrie_close_nid_postfix
libSceIcu ucptrie_getRange_nid_postfix
libSceIcu ucptrie_getType_nid_postfix
libSceIcu ucptrie_getValueWidth_nid_postfix
libSceIcu ucptrie_get_nid_postfix
libSceIcu ucptrie_internalSmallIndex_nid_postfix
libSceIcu ucptrie_internalSmallU8Index_nid_postfix
libSceIcu ucptrie_internalU8PrevIndex_nid_postfix
libSceIcu ucptrie_openFromBinary_nid_postfix
libSceIcu ucptrie_toBinary_nid_postfix
libSceIcu ulist_addItemBeginList_nid_postfix
libSceIcu ulist_addItemEndList_nid_postfix
libSceIcu ulist_close_keyword_values_iterator_nid_postfix
libSceIcu ulist_containsString_nid_postfix
libSceIcu ulist_count_keyword_values_nid_postfix
libSceIcu ulist_createEmptyList_nid_postfix
libSceIcu ulist_deleteList_nid_postfix
libSceIcu ulist_getListFromEnum_nid_postfix
libSceIcu ulist_getListSize_nid_postfix
libSceIcu ulist_getNext_nid_postfix
libSceIcu ulist_next_keyword_value_nid_postfix
libSceIcu ulist_removeString_nid_postfix
libSceIcu ulist_resetList_nid_postfix
libSceIcu ulist_reset_keyword_values_iterator_nid_postfix
libSceIcu uloc_getLCID_nid_postfix
libSceIcu uloc_getLocaleForLCID_nid_postfix
libSceIcu umutablecptrie_buildImmutable_nid_postfix
libSceIcu umutablecptrie_clone_nid_postfix
libSceIcu umutablecptrie_close_nid_postfix
libSceIcu umutablecptrie_fromUCPMap_nid_postfix
libSceIcu umutablecptrie_fromUCPTrie_nid_postfix
libSceIcu umutablecptrie_getRange_nid_postfix
libSceIcu umutablecptrie_get_nid_postfix
libSceIcu umutablecptrie_open_nid_postfix
libSceIcu umutablecptrie_setRange_nid_postfix
libSceIcu umutablecptrie_set_nid_postfix
libSceIcu uprv_calloc_nid_postfix
libSceIcu uprv_int32Comparator_nid_postfix
libSceIcu uprv_uint16Comparator_nid_postfix
libSceIcu uprv_uint32Comparator_nid_postfix
libSceJsc _ZN3JSC14ProtoCallFrame14needArityCheckEv
libSceJsc _ZN3JSC4Yarr10parseFlagsEN3WTF10StringViewE
libSceJsc _ZN3WTF12randomNumberEv
libSceJsc _ZN3WTF14FileSystemImpl12readFromFileEiPci
libSceJsc _ZN3WTF14FileSystemImpl15getFileDeviceIdERKNS_7CStringE
libSceJsc _ZN3WTF16weakRandomUint32Ev
libSceJsc _ZN3WTF20ObjectIdentifierBase26generateIdentifierInternalEv
libSceJsc _ZN3WTF20ObjectIdentifierBase36generateThreadSafeIdentifierInternalEv
libSceJsc _ZN3WTF29cryptographicallyRandomNumberEv
libSceJsc _ZN3WTF31integerToSixCharacterHashStringEj
libSceJsc _ZN3WTF4SHA111computeHashERSt5arrayIhLm20EE
libSceJsc _ZN3WTF6Logger9observersEv
libSceJsc _ZN3WTF7CPUTime3getEv
libSceJsc _ZN3WTF8Internal9appendHexEPhjmjNS_17HexConversionModeE
libSceJsc _ZN3WTF8pageMaskEv
libSceJsc _ZNK3JSC14ProtoCallFrame9codeBlockEv
libSceJsc _ZNK3WTF9MediaTimeneERKS0_
libSceJson2 _ZN3sce4Json6StringC1ERKS1_
libSceJson2 _ZN3sce4Json6StringC1Ev
... 485 more
⚪ 21 behaviourally empty (constant return or throw)
Library Name
libSceFontGs GnmBackendTerminate
libSceHttp sceHttpSetCookieSendCallback
libSceLibreSsl3 EcContextClear
libSceLibreSsl3 EcContextInitialize
libSceNKWebKit _ZN7WebCore12SettingsBase26defaultMinimumZoomFontSizeEv
libSceNKWebKit _ZN7WebCore12SettingsBase28defaultTextAutosizingEnabledEv
libSceNKWebKit _ZN7WebCore12SettingsBase35defaultContentChangeObserverEnabledEv
libSceNKWebKit _ZN7WebCore12SettingsBase37defaultDownloadableBinaryFontsEnabledEv
libSceNKWebKit _ZN7WebCore17LibWebRTCProvider15webRTCAvailableEv
libSceNKWebKit _ZN7WebCore17LibWebRTCProvider24registerWebKitVP9DecoderEv
libSceNKWebKit _ZN7WebCore17LibWebRTCProvider29setH264HardwareEncoderAllowedEb
libSceNKWebKit _ZN7WebCore21NetworkStorageSession22processMayUseCookieAPIEv
libSceNKWebKit _ZN7WebCore36registerMemoryReleaseNotifyCallbacksEv
libSceNpCppWebApi _ZN3sce2Np9CppWebApi6Common11TransactionINS2_12IntrusivePtrINS1_7Matches2V122GetMatchDetailResponseEEENS4_INS2_18ResponseHeaderBaseEEEEC1Ev
libSceNpCppWebApi _ZN3sce2Np9CppWebApi6Common11TransactionINS2_12IntrusivePtrINS1_7Matches2V122GetMatchDetailResponseEEENS4_INS2_18ResponseHeaderBaseEEEED1Ev
libSceNpCppWebApi _ZN3sce2Np9CppWebApi6Common15TransactionBaseINS2_12IntrusivePtrINS1_7Matches2V122GetMatchDetailResponseEEENS4_INS2_18ResponseHeaderBaseEEEE5startEPNS2_10LibContextE
libSceNpCppWebApi _ZN3sce2Np9CppWebApi6Common15TransactionBaseINS2_12IntrusivePtrINS1_7Matches2V122GetMatchDetailResponseEEENS4_INS2_18ResponseHeaderBaseEEEE6finishEv
libSceNpCppWebApi _ZN3sce2Np9CppWebApi7Matches2V18MatchApi14getMatchDetailEiRKNS4_25ParameterToGetMatchDetailERNS1_6Common11TransactionINS8_12IntrusivePtrINS3_22GetMatchDetailResponseEEENSA_INS8_18ResponseHeaderBaseEEEEE
libSceNpCppWebApi _ZN3sce2Np9CppWebApi7Matches2V18MatchApi25ParameterToGetMatchDetailD1Ev
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi6Common11TransactionINS2_12IntrusivePtrINS1_7Matches2V122GetMatchDetailResponseEEENS4_INS2_18ResponseHeaderBaseEEEE11getResponseERS8_
libkernel_sys sceKernelEnableDmemAliasing2
🆕 24 declared as stubs
Library Name
libSceFontGs GnmBackendUnported
libSceIcu u_countChar32_nid_postfix
libSceIcu u_memchr32_nid_postfix
libSceIcu u_strchr32_nid_postfix
libSceIcu u_strrchr32_nid_postfix
libSceMediaFrameworkInterface sceMediaFwAddEsvmDecoder2
libSceMediaFrameworkInterface sceMediaFwAudioSyncFlush
libSceMediaFrameworkInterface sceMediaFwChangeVideoOutputMode
libSceMediaFrameworkInterface sceMediaFwChangeVideoOutputMode2
libSceMediaFrameworkInterface sceMediaFwInitializeCdm
libSceMediaFrameworkInterface sceMediaFwMediaKeySystemAccessCreateMediaKeys2
libSceMediaFrameworkInterface sceMediaFwMediaKeysSetServerCertificate2
libSceMediaFrameworkInterface sceMediaFwRegisterSrcAllocateStateChangeCallback
libSceMediaFrameworkInterface sceMediaFwReleaseVideoFrame
libSceMediaFrameworkInterface sceMediaFwRequestMediaKeySystemAccess2
libSceMediaFrameworkInterface sceMediaFwSetAudioTagFeature
libSceMediaFrameworkInterface sceMediaFwSetUniversalEsvm
libSceMediaFrameworkInterface sceMediaFwSourceBufferCanSwitchToType
libSceMediaFrameworkInterface sceMediaFwSyncVideo
libSceNpCppWebApi _ZN3sce2Np9CppWebApi6Common12IntrusivePtrINS1_7Matches2V122GetMatchDetailResponseEED1Ev
libSceNpCppWebApi _ZN3sce2Np9CppWebApi6Common12IntrusivePtrINS1_7Matches2V124UpdateMatchDetailRequestEE5resetEPS6_
libSceNpCppWebApi _ZN3sce2Np9CppWebApi6Common12IntrusivePtrINS1_7Matches2V124UpdateMatchStatusRequestEE5resetEPS6_
libc WideTimePutDoPut
libc _ZNSt8time_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE7_GetcatEPPKNSt6locale5facetEPKS5__nid_postfix
⚠️ 54 went back to stubs
Library Name
libSceFreeType FT_Add_Default_Modules_nid_postfix
libSceFreeType FT_Get_Module_nid_postfix
libSceFreeType FT_Get_Renderer_nid_postfix
libSceFreeType FT_Library_SetLcdFilterWeights_nid_postfix
libSceFreeType FT_Library_SetLcdFilter_nid_postfix
libSceFreeType FT_Remove_Module_nid_postfix
libSceIcu ucfpos_close_nid_postfix
libSceIcu ucfpos_constrainCategory_nid_postfix
libSceIcu ucfpos_constrainField_nid_postfix
libSceIcu ucfpos_getCategory_nid_postfix
libSceIcu ucfpos_getField_nid_postfix
libSceIcu ucfpos_getIndexes_nid_postfix
libSceIcu ucfpos_open_nid_postfix
libSceIcu uloc_canonicalize
libSceIcu uloc_getBaseName
libSceIcu uloc_getCountry
libSceIcu uloc_getLanguage
libSceIcu uloc_getScript
libSceJson2 _ZN3sce4Json6String6appendEPKc
libSceJson2 _ZN3sce4Json6String6appendERKS1_
libSceJson2 _ZNK3sce4Json6String7compareEPKc
libSceJson2 _ZNK3sce4Json6String7compareERKS1_
libSceJson2 _ZNK3sce4Json6StringeqEPKc
libSceJson2 _ZNK3sce4Json6StringeqERKS1_
libSceLibcInternal inet_aton_nid_postfix
libSceLibcInternal inet_network_nid_postfix
libSceLibreSsl SSL_CIPHER_get_bits_nid_postfix
libSceLibreSsl SSL_CIPHER_get_name_nid_postfix
libSceLibreSsl SSL_CIPHER_get_version_nid_postfix
libSceLibreSsl3 X509_ALGOR_get0_nid_postfix
libSceLibreSsl3 tls_config_parse_protocols_nid_postfix
libSceNpTrophy sceNpTrophyGroupArrayGetNum
libSceNpTrophy sceNpTrophyNumInfoGetTotal
libSceNpTrophy sceNpTrophySetInfoGetTrophyFlagArray
libSceNpTrophy sceNpTrophySetInfoGetTrophyNum
libc getsubopt_nid_postfix
libcairo cairo_matrix_init
libcairo cairo_matrix_init_identity
libcairo cairo_matrix_init_translate
libcairo cairo_matrix_invert
libcairo cairo_matrix_multiply
libcairo cairo_matrix_rotate
libcairo cairo_matrix_scale
libcairo cairo_matrix_transform_distance
libcairo cairo_matrix_transform_point
libcairo cairo_matrix_translate
libcairo cairo_region_get_rectangle
libcairo cairo_region_union_rectangle
libcairo cairo_set_dash
libcairo cairo_surface_create_for_rectangle
libcairo cairo_surface_create_similar
libfreetype FT_Gzip_Uncompress_nid_postfix
libkernel getsockopt_nid_postfix
libkernel setsockopt_nid_postfix
🗑️ 19 removed
Library Name
libSceLibcInternal _ZNKSt5ctypeIwE10do_toupperEPwPKw_nid_postfix
libSceLibcInternal _ZNKSt5ctypeIwE10do_toupperEw_nid_postfix
libSceLibcInternal _ZNKSt5ctypeIwE11do_scan_notEsPKwS2__nid_postfix
libSceLibcInternal _ZNKSt5ctypeIwE5do_isEPKwS2_Ps_nid_postfix
libSceLibcInternal _ZNKSt5ctypeIwE5do_isEsw_nid_postfix
libSceLibcInternal _ZNKSt8time_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE3putES3_RSt8ios_basewPK2tmcc_nid_postfix
libSceLibcInternal _ZNKSt8time_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewPK2tmcc_nid_postfix
libSceLibcInternal __std_atomic_wait_direct_16_nid_postfix
libSceLibcInternal __std_atomic_wait_direct_8_nid_postfix
libSceLibcInternal libSceLibcInternalInventory_196_nid_no_patch
libSceLibcInternal libSceLibcInternalInventory_238_nid_no_patch
libSceLibcInternal libSceLibcInternalInventory_243_nid_no_patch
libSceLibcInternal libSceLibcInternalInventory_251_nid_no_patch
libSceLibcInternal sceLibcInternalPending3_014_nid_no_patch
libSceLibcInternal sceLibcInternalPending3_015_nid_no_patch
libSceLibcInternal sceLibcInternalPending3_020_nid_no_patch
libSceLibcInternal sceLibcInternalPending3_022_nid_no_patch
libSceLibcInternal sceLibcInternalPending4_071_nid_no_patch
libSceNpPartner001 libSceNpPartner001Unknown_pQfYTZHznMc_nid_no_patch

Changed libraries (implemented exports)

Library Before After Change
libc 1775/1779 (99.78%) 1786/1793 (99.61%) -0.17%
libcairo 90/161 (55.90%) 115/161 (71.43%) +15.53%
libfontconfig 23/53 (43.40%) 24/53 (45.28%) +1.89%
libfreetype 16/26 (61.54%) 16/26 (61.54%) +0.00%
libkernel 717/767 (93.48%) 715/767 (93.22%) -0.26%
libkernel_sys 187/820 (22.80%) 191/820 (23.29%) +0.49%
libSceAjmi 4/24 (16.67%) 6/26 (23.08%) +6.41%
libSceFont 153/240 (63.75%) 160/241 (66.39%) +2.64%
libSceFontGs 4/6 (66.67%) 8/10 (80.00%) +13.33%
libSceFreeType 142/152 (93.42%) 136/152 (89.47%) -3.95%
libSceFreeTypeOt 141/199 (70.85%) 142/199 (71.36%) +0.50%
libSceGnmDriver 35/67 (52.24%) 41/72 (56.94%) +4.71%
libSceHttp 107/123 (86.99%) 110/123 (89.43%) +2.44%
libSceHttpCache 13/30 (43.33%) 16/30 (53.33%) +10.00%
libSceIcu 208/2757 (7.54%) 251/2762 (9.09%) +1.54%
libSceJsc 65/737 (8.82%) 82/737 (11.13%) +2.31%
libSceJson2 134/223 (60.09%) 132/223 (59.19%) -0.90%
libSceJxr 118/143 (82.52%) 128/143 (89.51%) +6.99%
libSceLibcInternal 425/1130 (37.61%) 478/1131 (42.26%) +4.65%
libSceLibreSsl 302/473 (63.85%) 304/473 (64.27%) +0.42%
libSceLibreSsl3 582/701 (83.02%) 598/705 (84.82%) +1.80%
libSceMediaFrameworkInterface 0/177 (0.00%) 0/191 (0.00%) +0.00%
libSceMouse 12/29 (41.38%) 16/29 (55.17%) +13.79%
libSceMove 12/21 (57.14%) 15/21 (71.43%) +14.29%
libSceNKWebKit 2998/11258 (26.63%) 3133/11261 (27.82%) +1.19%
libSceNpCppWebApi 1342/1778 (75.48%) 1477/1822 (81.06%) +5.59%
libSceNpPartner001 3/4 (75.00%) 4/4 (100.00%) +25.00%
libSceNpRemotePlaySessionSignaling 8/14 (57.14%) 10/14 (71.43%) +14.29%
libSceNpSessionSignaling 26/31 (83.87%) 27/31 (87.10%) +3.23%
libSceNpTrophy 26/110 (23.64%) 22/110 (20.00%) -3.64%
libSceNpTus 137/142 (96.48%) 139/142 (97.89%) +1.41%
libSceNpUniversalDataSystem 72/93 (77.42%) 73/93 (78.49%) +1.08%
libSceNpWebApi2 34/45 (75.56%) 35/45 (77.78%) +2.22%
libSceOpusCeltEnc 8/15 (53.33%) 9/15 (60.00%) +6.67%
libSceOpusSilkEnc 8/15 (53.33%) 9/15 (60.00%) +6.67%
libScePosixForWebKit 31/38 (81.58%) 33/38 (86.84%) +5.26%
libSceRudp 33/35 (94.29%) 34/35 (97.14%) +2.86%
libSceSaveData.native 56/120 (46.67%) 59/120 (49.17%) +2.50%
libSceSystemGesture 23/24 (95.83%) 24/24 (100.00%) +4.17%
libSceSystemService 154/617 (24.96%) 156/617 (25.28%) +0.32%
libSceUlt 79/96 (82.29%) 82/96 (85.42%) +3.12%
libSceUsbStorage 12/47 (25.53%) 14/47 (29.79%) +4.26%
libSceVideoRecordingP 9/26 (34.62%) 10/26 (38.46%) +3.85%
libwebrtc 182/412 (44.17%) 217/412 (52.67%) +8.50%

@heavilyusingai heavilyusingai changed the title fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack; fix(libSceJson2): probe String guest pointers Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Contribution 3: fix(libSceJson2): probe String guest pointers (50337bc)

The guest-pointer audit flags 186 findings in libSceJson2's Export.cpp — every public sce::Json::String, Value, Array, Object, iterator and InitParameter2 method dereferences caller-supplied pointers raw. This commit closes the String family (~28 methods) as the first slice; the remaining families are ready for follow-up commits.

Why the String family first

  • sce::Json::String is the entry type for almost every JSON workflow (parsers fill Strings, Value::referString/getString return them, keys are Strings), so titles exercise these calls constantly.
  • The family has the strongest existing test coverage in the tree (allocator contracts, search semantics, alias behavior), which pins byte-exact compatibility while the dereferences are reworked.
  • sce::Json::String objects themselves live in title memory: struct String { Text* text; } with Text { char* characters; u32 length; u32 capacity; u64 reserved; } — the header and characters come from the title's registered allocator, so every dereference in these methods touches guest-owned memory.

Design

  • New probe layer in Export.cpp: ProbeSelf/ProbeHeader/ProbeRange/ProbeZString (errno-preserving GuestCopyIn/GuestCopyOut), plus probed Grow/Clear/Assign/Append/Construct/Destroy mirrors. The raw helpers are untouched — Value/Array/Object/parser paths keep them until their own slices.
  • Failure mapping follows each method's existing null convention (no new exception types): reads on unreadable memory return what a null header returns (empty string, zero capacity/length, npos, empty() == true); mutators no-op; growth rollbacks release the new buffer; unreadable source text throws std::invalid_argument — exactly the rule upstream already ships for Value::set ("unreadable text"); probe failures never fire the allocator's OOM notifier and never enter AllocationOperation failure accounting.
  • Exact-parity details the existing tests forced: header reserved bytes (offsets 16–23) survive every write-back because writes are field-wise, not struct-wise; operator=/copy-ctor assign header.length bytes (View semantics) while append(const String&)/compare/eq/find(String&) use C-string-prefix (strlen) semantics — both preserved; counted find/rfind keep the needle's own NUL comparable so strncmp stops at a shared zero; forward find still scans from position past embedded NULs (the scan window is copied chunk-wise and degrades at the first unreadable page, where raw would have crashed); c_str() still returns the string's own characters pointer (ABI) and only the header read is probed.

Verification (Linux x86_64, GCC 12)

  • All 37 pre-existing modern-flavor JSON2 suites pass unchanged, plus the built-in-Export suites (copy_failure, float_failure, file, callback_threads, terminate_lock_order, reader_equivalence, legacy_handlers, legacy_serialization, legacy_self, param_parser) and the modern termination/initialization-exception matrices (spot-checked positions). The only failure in the tree is the pre-existing environment-dependent numeric_locale skip (no decimal-comma locale installed in the sandbox).
  • New guest_json_string_probes suite (registered in CMake as guest_json_string_probes): unreadable String object / Text header / character buffer / needle mappings for every method, errno preservation after every probe failure (asserted errno == 71 like the IME suite), allocator conservation (unreadable-header destruction registers nothing, growth rollbacks release through the owning allocator), budget-failure interaction (exactly one notifier call from the allocation failure, zero from probes), and a zero-length-source assignment through the View-length contract.
  • tools/check_conventions.py --base upstream/main: all checks passed. Debt doc gains a dedicated sce::Json::String guest-pointer probing entry.

Follow-ups (not in this commit)

  • Value (~40 methods), Array + iterators, Object + Pair, InitParameter2 families — same probe layer applies; the raw helpers stay in place for them.
  • sceImeSetText text-copy follow-up from topic 1 still stands.

Copy link
Copy Markdown
Owner Author

Rebased onto the current upstream main (eef73731fc, 2026-11-15): 21 upstream commits merged since the previous base (b7aeb6f406) — SaveData sync-param guest-copy (boykopovar#20859), core-online guest-copy (boykopovar#20829), NP-common ring-buffer (boykopovar#20826), audio-in status lock (boykopovar#20825), LibreSSL RSA-PSS bounds (boykopovar#20824), net DHCP (boykopovar#20822), VideoOut cursor/VRR (boykopovar#18885, boykopovar#18881), ICU test guest pointers (boykopovar#20844) and more. Zero file overlap with this branch (libSceJson2, libSceIme, demo/web, their tests and debt docs untouched), so the rebase is conflict-free.

Patch-ids are unchanged (966daa19959d148b IME, dac6de96ee13aa2e web), so all previously reported verification carries over; the new fix(libSceJson2) commit has patch-id 0d3f460dcd2bb5800d84308a0dec8b46000fe5ab. After the rebase the whole harness was rebuilt against the updated libc/libkernel sources and re-run: 37 modern-flavor JSON2 suites + the string-probes suite + the built-in-Export suites (copy-failure, float-failure, file, callback-threads, terminate-lock-order, reader-equivalence, legacy handlers/serialization/self, param parser) all pass; tools/check_conventions.py --base upstream/main clean. The only failing case remains the pre-existing environment-dependent numeric_locale skip (no decimal-comma locale in the sandbox).

Local-kit patches regenerated (0001 IME, 0002 web cache, 0003 JSON2 String probes) against the new base.

@heavilyusingai
heavilyusingai force-pushed the arena/a24fc045-anyps5 branch 2 times, most recently from 4fb03f0 to 7e2507b Compare November 16, 2026 09:48
@heavilyusingai heavilyusingai changed the title fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack; fix(libSceJson2): probe String guest pointers fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack; fix(libSceJson2): probe String and Value guest pointers Nov 16, 2026

Copy link
Copy Markdown
Owner Author

Rebased this branch onto current main (e4caa07950, 148 changed files, zero overlap with the four topics — verified per file) and extended it with a fourth topic: fix(libSceJson2): probe Value guest pointers (7e2507b367, patch-ids of the first three topics unchanged: IME 966daa19959d148b, web dac6de96ee13aa2e, JSON2 String 0d3f460dcd2b).

Topic 4 closes the audit's sce::Json::Value family (~45 public methods: constructors/destructor, assignment, swap, the nine setters, the eight getters, count, the three operator[]/getValue pairs, the six refer* accessors, toString, clear and the four handler setters). The interesting parity work was in the allocation-trace suites: raw Clear/SetType/AssignPayload/AssignNode were re-hosted as probed replicas that keep the exact nested-copy partial-failure parent states (children stay unbound when a copy fails mid-way, bind through the storage owner when it succeeds) and the auxiliary/fallback/handler-record admission states, while every first dereference of a guest payload pointer is checked so a corrupted value can no longer fault the host. The string payload release reuses the String probe layer; storage owners and child links bind to the real object where the raw machinery creates them, never to the transient snapshot. serialize/Serialize paths and raw internal call sites stay raw (serialize* was not flagged by the audit).

Local results: all 38 pre-existing modern/legacy JSON2 suites unchanged (the only failure remains the pre-existing numeric_locale environment skip), new guest_json_value_probes suite green, tools/check_conventions.py --base upstream/main clean. Remaining audit slices in this library (Array/Object collections, iterators, InitParameter2) stay open for follow-up commits.

@heavilyusingai heavilyusingai changed the title fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack; fix(libSceJson2): probe String and Value guest pointers fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack; fix(libSceJson2): probe String, Value and collection guest pointers Nov 16, 2026

Copy link
Copy Markdown
Owner Author

Round 5 — Array/Object collection probes (commit 5/5 of the JSON2 audit series)

Rebased onto upstream main f2a25e5b42 (329 new commits since the previous base, zero file overlap; all four prior patch-ids verified stable with git patch-id --stable), then added the collection slice:

  • New commit fix(libSceJson2): probe Array and Object guest pointers closes the audit's sce::Json::Array/Object families (~35 public methods — collection constructors/assignment/destructors, Array push/insert/pop/erase/front/back/size/clear, both iterator sets, Object operator[]/find/erase/insert(Pair)/begin/end/size/empty/clear, and the Pair constructors/destructor). The remaining InitParameter2 slice (~10 findings) stays open for a follow-up commit.
  • Contract: checked field probes with write-back everywhere; unreadable collections present the empty contract (typed getter defaults, no-op mutations, unbound iterators, NotImplemented exactly where raw reports it); fresh containers bind begin/end to the self-looped sentinel head like raw; insert/erase with unreadable keys skip mutation while null key text keeps raw's emptyCharacters behavior; a pair whose key text cannot be read leaves the collection untouched because raw would fault. Iterator states, link payload offsets (+16 Array / +48 Object), owner addresses and allocation order match raw; failed result write-backs release admitted state; probe failures never notify the allocator.
  • Verification: 40 of 41 JSON2 suites pass (all 39 pre-existing suites unchanged plus the new guest_json_collection_probes; the only non-pass is the pre-existing numeric_locale environment skip — no decimal-comma locale installed in the sandbox). tools/check_conventions.py --base upstream/main clean. Technical-debt entry added to docs/dev/debt/libSceJson2.md (940 chars).

The debt-doc Array/Object entry is at line 22; the PR description now carries the topic-5 summary and tested note.

@heavilyusingai heavilyusingai changed the title fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack; fix(libSceJson2): probe String, Value and collection guest pointers fix(libSceIme): probe guest pointers; feat(web): cache the converter library pack; fix(libSceJson2): probe String, Value, collection and InitParameter2 guest pointers Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Round 6 — InitParameter2 probes (commit 6/6; the libSceJson2 audit series is complete)

Rebased onto upstream main 521fb7fec4 (236 new commits since the previous base, zero file overlap; all five prior patch-ids verified stable with git patch-id --stable), then added the final JSON2 slice:

  • New commit fix(libSceJson2): probe InitParameter2 guest pointers closes the remaining audit findings: the InitParameter2 constructor, the four setters, the four getters, InitParameterRtti construction, InitParameterRtti2::setAllocatorRtti and Initializer::initialize. All member accesses go through checked copies; unreadable parameter objects and callback blocks no-op mutations, return zero defaults from getters, and initialize refuses unreadable flags/parameters with 0x80848120 while the already-initialized state check keeps raw precedence over every probe.
  • One real parity defect was caught by the matrix and fixed before shipping: the first initialize draft snapshotted the whole 40-byte parameter, which broke the allocation-entry suite's pinned read order (raw caches allocator/user data before the allocation and re-reads fileBufferSize from guest memory afterward, so an allocate callback can mutate it mid-call). The shipped probe validates exactly the 0x1c prefix raw reads and then runs the raw body unchanged — the suite passes again byte-exact. The allocator object and its vtable remain raw (pre-existing allocation-callback debt, noted in the debt entry).
  • Verification: 41 of 42 JSON2 suites pass (all 40 pre-existing suites unchanged plus the new guest_json_init_parameter_probes; the only non-pass is the pre-existing numeric_locale environment skip). tools/check_conventions.py --base upstream/main clean. Debt entry added (954 chars). With this commit, all 186 libSceJson2 audit findings are converted: String (✓), Value (✓), Array/Object/iterators/Pair (✓), InitParameter2 (✓).

Copy link
Copy Markdown
Owner Author

Round 7 — rebase, re-verification, and a tracker-picked fix (commit 7/7)

oneandonlydean and others added 28 commits November 22, 2026 14:47
…changed-test-scope

docs(build): explain Windows AGC changed-test coverage
…on-launch-guard

fix(tools): guard replay comparison launches on Windows
…rify-submodules

fix(tools): verify submodule revisions after rebases
…getgain-measured-1360

docs(debt): record the 13.60 measurements of the GetGain and GetRerouteCount validation paths
…close-service-tail-1360

docs(debt): record that sceAudioInClose reaches the audio service for a free slot
…null-values

fix(libSceNKWebKit): treat a NULL JSValueRef as null in the JavaScriptCore C API
…rt-scan

perf(tools): speed up file scanning and entry labeling in debt_report
…lize-private-data

fix(libSceNKWebKit): keep private data readable in finalize when a context group is destroyed
…bigint-proxy-types

fix(libSceNKWebKit): report a BigInt as an object type and stop unwrapping proxies in JSValueIsArray
…hared-device-invalid-state

fix(libSceAudioIn): answer invalid state for shared-device handles outside the port table
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Every public sce::Json::Value entry point now reads the caller's value
through checked 32-byte node copies and validates payload handles before
the raw storage walks. Mutations run against a host snapshot written back
with checked stores; unreadable values present the null-value contract
and readable values with unreadable payloads degrade per operation
instead of crashing the host. Storage owners, child parent links and
auxiliary fallback parents bind to the real object where the raw
machinery creates them, allocation order matches raw including the
nested-copy partial-failure states, and string payload release reuses
the String probe layer. serialize paths and raw internal call sites keep
raw handling. A value-probes suite covers the contract.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Every public sce::Json::Array, Object, iterator and Pair entry point now
reads caller pointers through checked field probes and writes results
back with checked stores. Unreadable collections present the empty
contract (typed getter defaults, no-op mutations, unbound iterators and
NotImplemented where raw reports it), fresh containers bind begin/end to
the self-looped sentinel head, insert/erase with unreadable keys skip
mutation, and inserting a pair whose key cannot be read leaves the
collection untouched instead of faulting. Iterator states, link
payloads, owner addresses and allocation order match raw; failed result
writes release admitted state and probe failures never notify the
allocator. Registered GuestJsonCollectionProbes covers the contract.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Queue commands receive the slot address sceSdmaOpen published through a
checked copy-out, then dereference it raw. A forged or corrupted handle
turned into an unchecked host write or fault. The eight queue-management
exports and the submit path now resolve the handle against the slot
table and refuse unknown addresses with SdmaErrorInvalidArgument; every
address Open can publish still resolves, closed slots keep resolving so
their refusal contracts are unchanged, and a slot re-opened at the same
address works again. GuestSdma covers the forged and unmapped handles
beside the existing null and closed contracts.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
sceImeBackendOpen dereferenced the whole 0x28-byte parameter structure
and scanned the initial string with an unbounded UTF-16 length scan, and
the candidate, convert-mode and text outputs wrote through raw stores
the audit could not see past the CopyText helper. The parameter is now
copied in with a checked guest copy, the initial string is read
chunk-wise through the same copies with raw's terminator-inside-the-limit
admission and too-long refusal, the string scan left ValidateParam so
raw's error precedence is unchanged, and every output (candidate list,
candidate select, convert mode and the CopyText destinations) publishes
through checked copies. Unreadable parameters and strings refuse with
the null-argument code as a host-safety fallback (unmeasured on a
console), preserving caller errno; a refused EnterCharacter still keeps
its inserted character like raw. GuestImeBackend covers the unreadable
parameter and string, the too-long and limit-exact strings, the
unwritable outputs and the readable round-trips.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The Ot exports dereferenced guest-resident freetype mirrors and
published outputs through raw stores: the vector and metrics math read
their operands and wrote their results directly, the service lookup
walked descriptor arrays and compared guest strings raw, the render and
glyph-slot entry points read handle fields raw, and the resource-fork
scanner wrote its outputs through unchecked pointers. Every access now
goes through GuestCopyIn/GuestCopyOut with the caller's errno preserved:
refusals mirror raw's contracts (invalid-argument throws where raw
faulted, no-op returns where raw no-opped, the raccess outputs throw
like raw's null check, and the count is published before a refused
offsets pointer so callers can observe the ordering), and the queue of
computed values is only stored after the publish succeeds.

GuestFreeTypeOtCalc is a new suite covering the calc trio's readable
round-trips and refusals; GuestFreeTypeOtGlyphSlot, GuestFreeTypeOtRaccess
and GuestFreeTypeOtRenderInternal gain unreadable-pointer sections.
Upstream main's build SIGSEGVs (exit 139) on the same tests; this commit
exits 0. tools/guest_pointer_audit.py libSceFreeTypeOt reports 0 findings.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…robe

hb_ft_face_create_cached checked the guest face record and published the
cached-face generic back through a file-local errno wrapper the audit
cannot classify. The flagged publish sites now call the checked guest
copy and writability probes directly with the caller's errno preserved,
so the audit sees the checked path; behavior is unchanged.

tools/guest_pointer_audit.py learns GuestWritable_nid_no_patch: the
fault-guarded writability probe belongs in the checked-call family
alongside GuestCopyIn/GuestCopyOut, so an address taken for a probed
write counts as checked. libharfbuzz reports 0 findings; the
GuestHarfBuzzFreeTypeShaping cached-face coverage is unchanged.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ram base

scePlayerSelectionDialogParamInitialize derived the magic from the
address of the base member, phrased as a raw member access on the guest
parameter. The same address now comes from the parameter itself plus the
member offset, and the initializer still publishes the whole structure
through a checked copy. Behavior is unchanged; the existing
GuestPlayerSelectionDialog initialize round-trip and unreadable-parameter
refusal cover the path. libScePlayerSelectionDialog reports 0 findings.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… pointer

sceWebBrowserDialogGetResult published the canceled result through the
address of the result member, phrased as a raw member access on the guest
result pointer. The slot address now comes from the pointer itself plus
the member offset, and the write still goes through the checked copy
helper with the arg-null refusal on failure. Behavior is unchanged; the
existing GuestWebBrowserDialog refused-output coverage covers the path.
libSceWebBrowserDialog reports 0 findings.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Upstream's wrapper-pointer fix stopped one export short:
sceFreeTypeOlAlloc still zeroed the output through a raw store, read the
guest allocator recorder raw and published the block through a raw
pointer. The recorder and output are now probed with checked guest
copies, the caller's errno preserved: the raw-matching null pre-write is
kept (checked), an unreadable recorder or missing alloc callback refuses
with 6, and the allocated block publishes through a checked copy that
returns 6 on refusal, leaving the raw-matching 64 for an allocation the
allocator itself reports as failed. GuestFreeTypeOlModules gains the
unreadable recorder, missing callback, unreadable output, zero-size and
alloc-failure sections. Upstream main's ModuleWrappers SIGSEGVs (exit
139) on the same test; this commit exits 0. libSceFreeTypeOl reports 0
findings.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
sceVoiceInit read the guest VoiceInitParam's app_type raw. The parameter
is now copied in with a checked guest copy with the caller's errno
preserved; an unreadable parameter refuses with the raw InvalidArgument
contract instead of faulting, and the app-type validation and stored
app type come from the local copy. GuestVoice gains an unreadable
parameter section: upstream main's Export.cpp SIGSEGVs (exit 139) on the
same test, this commit exits 0. libSceVoice reports 0 findings.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
pthread_attr_setstackaddr dereferenced the guest attr slot raw and
pthread_get_specificarray_np wrote its key array entries raw. The slot
handle is now read through the checked copy helper with the caller's
errno preserved (an unreadable slot refuses with the raw EINVAL contract,
the probed handle's host record stays direct library state), and the
array entries publish one at a time through checked copies that return
the raw EFAULT contract on refusal. GuestKernelSysPthreadNp gains
unreadable-slot and unreadable-array sections in the attr and specific
cases: upstream main's Export.Discovery.cpp SIGSEGVs (exit 139) on the
same cases, this commit exits 0. libkernel_sys reports 0 findings.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
FT_Set_Default_Properties, freetypeLegacyBitmapBlend and
freetypeLegacyLibrarySetLcdGeometry read the guest library wrapper's
host handle raw, and the blend path walked the wrapper's face list raw
to sync the blended bitmap. The handle is now probed with a checked
guest copy with the caller's errno preserved — an unreadable wrapper
yields the raw null-host branches instead of a fault — and the face
walk moved into an internal helper taking the probed wrapper, matching
the FreeTypeOt render-internal precedent. GuestLegacyFreeTypeLibrary
and GuestLegacyFreeTypeBitmapBlend gain unreadable-library sections;
both suites run in the project CMake CI (the sandbox harness hosts
their module-loading form). libfreetype reports 0 findings.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The service lookup compared guest strings through a hand-rolled
per-unit copy into fixed stack buffers. The same bound and refusal now
come from libc's CopyGuestString_nid_no_patch, the bounded checked
helper the other libraries already use for guest identifiers, removing
the local helper and the string comparison; an identifier without a
terminator inside the bound still refuses the lookup, so the existing
boundary case is unchanged. Also drops a dead test lambda and a weak
either-way assertion from the calc suite. Behavior is unchanged: all
FreeTypeOt probe suites pass and the audit stays at 0 findings.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Upstream's InitParameter2 guest-copy fix landed the LoadGuest-based
getters this series' rebases kept; the four raw definitions this
series' Value commit had conflicted against are now dead duplicates
and are removed.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ts safely

freeaddrinfo walked the guest-supplied result chain raw: the nodes are
host allocations handed to the guest by getaddrinfo, and a forged chain
faulted the host on the first unreadable member before corrupting it
further with blind frees. Each node is now fault-guard probed before its
strings are freed and the walk stops on an unreadable node. getnameinfo
published the host and service strings through raw memcpy stores into
the guest buffers; both outputs now go through checked copies that
return the function's own buffer-error code on refusal, leaving neither
output partially written. getaddrinfo reused its parameter names for the
host-side copies, which the audit reads as raw string calls; the copies
now carry their own names and the numeric parsing uses them.

GuestPosixResolver is a new offline suite covering the numeric
getaddrinfo round trips, the errno-preserving unreadable hints, node
string, chain node, host output and service output refusals: upstream
main's Resolver.cpp SIGSEGVs (exit 139) on the same test, this commit
exits 0. libScePosixForWebKit reports 0 findings.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…vent exports

Every exported function that reads or writes guest memory now goes through
checked GuestCopyIn/GuestCopyOut probes with the caller's errno preserved:
buffer attribute setters build locals and publish, attribute option and
registration paths probe into locals, status getters publish snapshots,
SysMode firmware answers answer 0 on unreadable modes, and GetEventCount
probes the event payload. Refusals surface the library's INVALID_ADDRESS
or INVALID_VALUE error instead of faulting on guest pointers.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>

Copy link
Copy Markdown
Owner Author

Round 15 — sync to 7281ddca51 (467 upstream commits)

Branch force-pushed as e2e0c13391; series still 18 commits.

Check Result
Rebase 18/18 replayed, zero conflicts
Patch-ids all 18 unchanged — the sync is a pure fast-forward of the base
Audit VideoOut 0, PosixForWebKit 0, and all 11 previously-cleared libraries still 0
JSON2 matrix PASS=40 FAIL=1 (known env-only numeric_locale skip)
VideoOut probes 4/4 exit 0
Small-library probes voice, ksys_np ×4, ftol_modules, ftot_{calc,glyphslot,raccess,render} — all exit 0
check_conventions.py all checks passed
Census 2,399 / 2,016

Overlap handled: upstream landed 80b80da009 (libScePosixForWebKit EAI_ADDRFAMILY/EAI_NODATA → EAI_NONAME) in the same file as our topic-19 probes. The rebase merged both: the probes and the FreeBSD error mapping coexist, no function was dropped. libkernel_sys/Export.Discovery.cpp and tools/guest_pointer_audit.py also overlapped and merged cleanly; our conversions remain audit-clean under upstream's newer, faster audit (which also now reports C++-mangled member exports — a pre-existing 19-entry sub-class in libSceJson2 unaffected by our earlier work).

Claim sweep for the next slice: the census's big remaining slices are all actively claimed — NpCppWebApi 538 (boykopovar#21551), libc 300, NKWebKit 264, NpCommon 229 (boykopovar#22389/boykopovar#24452), webrtc 184, LibreSsl 121+102 (51 open fix PRs), Icu 101 (12), FreeType 78 (6), NpManager 60 (boykopovar#21547/boykopovar#22504), libkernel 52 (boykopovar#24470), Font 46 (7), LibcInternal 40, Agc 37 (8), Jsc 32 (7). Mid-size leftovers are claimed too: Ampr 11 (boykopovar#20633), Psml_debug 8 (boykopovar#22275), Http 8, Usbd 9, Ngs2.native 5 (boykopovar#23227/boykopovar#22860/boykopovar#21141), Ajm.native 6, AppContent 5, GnmDriver 19 (boykopovar#24455), AgcDriver 15 (boykopovar#23432 covers only Submit's queue context; the Eq/Configuration/Resource/Unimplemented getters remain). No duplicate work is being opened; the next slice will pick from the genuinely unclaimed residue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.