fix(libSceNpUtility): validate full 0x18-byte async request parameter in NpLookup and NpWordFilter #27923
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27923"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by gurtgg on 2026-11-27T20:31:58Z.
What
sceNpLookupCreateAsyncRequestandsceNpWordFilterCreateAsyncRequestincore/libs/prx/libSceNpUtility/Export.cppto validate the full0x18-byte async request parameter (ASYNC_REQUEST_PARAMETER_SIZE) instead of reading only the leading 8-bytestd::uint64_tsize header.CreateAsyncRequestusingCopyInPreservingErrnoso an async parameter struct crossing into unmapped/inaccessible guest memory returnsSCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT(0x80550704) while preservingerrno.Tested
CheckTruncatedAsyncParam(alongsideCheckLookupAsyncandCheckWordFilterAsync) incore/libs/tests/GuestNpUtilityOffline.cpp: places a validuint64_t(0x18)size header in the last 8 bytes of a readable page immediately followed by aPAGE_NOACCESS/PROT_NONEguard page, verifying bothsceNpLookupCreateAsyncRequestandsceNpWordFilterCreateAsyncRequestreturnSCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT(0x80550704) and preserveerrno(fails on unmodifiedmain, where both return a request id > 0).Checklist
main; no other open PR implements the same functionstools/check_conventions.pypasses)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repositorymainand passes after fixSummary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T20:37:32Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0781e6bd8c:tools/check_conventions.pypassed.guest_np_utility_offline_testsbuilt cleanly.guest_np_utility_offline):core/libs/prx/libSceNpUtility/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T20:47:35Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation and regression test support merging.
What I ran
Reviewed head
0781e6bd8cfe32fc22862bb817cc9e3df7c340c4. No commands or tests were run; I inspected the prepared diff and the changed code throughrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed
core/libs/prx/libSceNpUtility/Export.cppandcore/libs/tests/GuestNpUtilityOffline.cppat the pinned head, including all changed lines. The implementation copies the complete0x18-byte parameter with errno preservation and rejects inaccessible or incorrectly sized input. The added test covers a parameter ending at a guard page for both APIs and checks errno preservation.Not verified
Tests, builds, and platform behavior were not run. The review bundle lists both changed files as reviewed, with full text included; no changed files were excluded.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-11-28T05:06:10Z.
Review: APPROVED
Checked head
0781e6bd8c. All on Windows 11 with WinLibs GCC 15.2 (Release), applied tomaina163d4b886together with #27930, #27929, #27926, #27925, #27924, #27922, #27901, #27828, #27771, #27755, #27748, #27682, #27765.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded.guest_np_utility_offlinepasses, including the new guard-page case through itsVirtualProtectpath. In the full CPU suite (5,120 tests) the only failures are unrelated:windows_read_trap_unknownfails onmaintoo (fixed in #28028).frame_capture_minimize,jpeg_external_toolchainandguest_pthread_mutex_contentionare timeouts under load; they pass when run on their own.guest_audio_in_capturepasses 20/20 onmainand with #27922.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T09:13:12Z.
Review: COMMENTED
The Linux
GuestNpUtilityOfflinefixture passed with the exact exports. Both lookup and word-filter async request paths exercise the short-parameter rejection, preserve errno, and clean up their test contexts.AI-assisted: yes.