Repository navigation
fix(libSceLibreSsl3): copy X509V3_EXT_d2i extension guest pointer safely - #22890
Gruzzberry wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The changed function copies the top-level extension through the guest-memory helper before reading it; no verified blocking defect was found in the inspected change.
What I ran
Reviewed head 0d2af5365fce6e8c8033b94f1c12611348565520 against the prepared diff; no build or test command was run. The author reports a syntax-only compile and convention check in the PR description; these were not run during this review.
Read description.md, commits.md, manifest.json, diff.patch, the complete changed file core/libs/prx/libSceLibreSsl3/src/X509V3ExtD2i.cpp, core/libs/prx/libSceLibreSsl3/include/Api.hpp (lines 80–115), core/libs/prx/libSceLibreSsl3/tests/X509V3ExtD2i.cpp (lines 1–180 and 300–370 and 405–450), core/libs/prx/libSceLibreSsl3/src/X509Crl.cpp (lines 350–374), and core/libs/prx/libc/src/General.cpp (lines 980–1010). No changed files were excluded; files.json was not listed in the prepared bundle.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | Changed file read in full |
| Build and tests | not run | Author-reported checks not independently run |
| Runtime guest-memory behavior | not run | No runtime test performed |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author-reported syntax-only compile, convention check, and duplicate check were not independently verified. Runtime behavior for unreadable guest pointers was not exercised. The prepared bundle did not include files.json, so its reviewed/excluded listing could not be checked directly.
To get this to a good state
Nothing is required.
|
The top-level copy is right and throwing on an unreadable extension matches the null check and the library convention, so no change there. Two things before this can go in. Please add a case to tests/X509V3ExtD2i.cpp that passes an unreadable extension pointer and expects std::invalid_argument. Also, the guard stops at the outer struct: extension->object->length, OBJ_obj2nid and Decode (encoded->length and encoded->data) still read the nested guest pointers directly, so a bad object or value pointer still crashes the host. Copying those headers through the same checked path would make the fix complete; GuestPtr(p).CopyIn with APS5_INVALID_ARG_EX, as in EcAsn1.cpp, would also replace the manual errno save and restore. |
ligmaSec
left a comment
There was a problem hiding this comment.
Built the submitted X509 extension decoder and ran the existing exact X509V3ExtD2i fixture on Linux. It passed the extension decoding and error cases with the pinned project libraries. I traced the added guest copy before the extension fields are used.
AI-assisted: yes.
What
X509V3_EXT_d2i reads the caller's X509_EXTENSION through a checked guest copy and throws std::invalid_argument (as for a null pointer) when it is unreadable. Valid-pointer behaviour is unchanged.
Tested
g++ -std=c++20 -fsyntax-only of X509V3ExtD2i.cpp with the repo include dirs: clean. tools/check_conventions.py --base upstream/main: passed. Duplicate check: script comparing against every open PR's changed files: clean. Not run on a title.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code