fix(libSceNet): return EFAULT from sceNetSendmsg and sceNetSendto for unreadable guest memory #11472

Merged
ycbuzi merged 5 commits from upstream-pr/11472 into main 2026-11-02 10:28:20 +00:00
ycbuzi commented 2026-10-26 15:46:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-26T15:46:11Z.


What

sceNetSendmsg read the guest's NetMsghdr, its iovec table and each payload directly, and sceNetSendto read the destination address the same way. When any of those crossed into unreadable guest memory, the host process crashed with 0xc0000005 instead of the call failing with EFAULT, as reported with a reproduction in #11467 by @lgqdaxia.

  • sceNetSendmsg snapshots the header with GuestSocketReadGuest_nid_no_patch, then copies the iovec table (once the header's iov_length is in range) and each nonempty payload the same way. Any failed read returns NET_EFAULT and sends nothing. The checks keep main's order and results (EMSGSIZE for an out-of-range iov_length, EFAULT for a null table or base with a length). This matches FreeBSD's sys_sendmsg, which copyins the header, then copyiniovs the table, and fails with EFAULT when either copy or the payload's uiomove faults.
  • sceNetSendto copies the destination address (up to sizeof(sockaddr_storage) bytes) the same way before parsing it, and returns NET_EFAULT if it isn't readable, like FreeBSD's getsockaddr copyin. sceNetSendmsg passes its name through here, so this also covers @lgqdaxia's review point about msg->name.
  • The payload in sceNetSendto already failed cleanly with EFAULT from the host send, so it's unchanged. Other direct address reads (sceNetBind, sceNetConnect) aren't part of this.

New guest_net_sendmsg_fault_{payload,iovec,header,name} (core/libs/tests/GuestNetSendmsgFaults.cpp, built on the fixture in #11467). Each case maps three guest pages and makes one unreadable with sceKernelMprotect:

  • payload: an iovec whose 16 bytes cross into the unreadable page; sceNetSendto with the same range as the control.
  • iovec: an iovec table that crosses into it.
  • header: a NetMsghdr that crosses into it.
  • name: a destination address in it, through sceNetSendmsg and sceNetSendto.

Each case requires 0x8041010e with errno 14, then sends a marker datagram and requires it to be the first one received, so nothing was sent by the failed call. A readable sceNetSendmsg before and after must still send 8 bytes.

Tested

Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, on main c4669c9ca2.

  • The four new tests, guest_net_buffer_validation and the 11 net_dontwait_* tests pass, 3 of 3 (ctest --repeat until-fail:3).
  • All guest_net* and net_* tests (58 entries) pass 2 of 2, except guest_netctl_ap and guest_netctl_ap_dialog, whose executable I didn't build.
  • Red without the fix: with main's libSceNet/Export.cpp and this PR's test, each of the four cases fails on its own with FATAL: unhandled exception 0xc0000005 (payload exits 0xc0000409 after the handler, iovec, header and name as SegFault).
  • tools/check_conventions.py --base origin/main passes. It merges cleanly with #11037, the open PR that also touches sceNetSendto/sceNetSendmsg.
  • After merging main 48c160c58b (head 6e97111223): the four new tests pass 3 of 3, and the 56 guest_net* and net_* entries (without the two guest_netctl_ap ones) pass 2 of 2.
  • After merging main f5fefb982c (head 38c3845149, 0 behind): the four new tests pass 3 of 3, all 61 guest_net* and net_* entries pass 2 of 2 (now including the two guest_netctl_ap ones), and tools/check_conventions.py --base origin/main passes.
  • After merging main 420b6a064e (head 5f29795a8c, a clean merge; main has since moved 8 commits, none in libSceNet): the four new tests pass 3 of 3, all 61 guest_net* and net_* entries pass 2 of 2, and tools/check_conventions.py --base origin/main passes.
  • Not tested: Linux and macOS, where the CI jobs will run the new tests.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: Fixes #11467
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5020339493 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472). Originally posted by [ycbuzi](https://github.com/ycbuzi) on 2026-10-26T15:46:11Z. --- ### What `sceNetSendmsg` read the guest's `NetMsghdr`, its iovec table and each payload directly, and `sceNetSendto` read the destination address the same way. When any of those crossed into unreadable guest memory, the host process crashed with `0xc0000005` instead of the call failing with `EFAULT`, as reported with a reproduction in #11467 by @lgqdaxia. - `sceNetSendmsg` snapshots the header with `GuestSocketReadGuest_nid_no_patch`, then copies the iovec table (once the header's `iov_length` is in range) and each nonempty payload the same way. Any failed read returns `NET_EFAULT` and sends nothing. The checks keep `main`'s order and results (`EMSGSIZE` for an out-of-range `iov_length`, `EFAULT` for a null table or base with a length). This matches FreeBSD's `sys_sendmsg`, which `copyin`s the header, then `copyiniov`s the table, and fails with `EFAULT` when either copy or the payload's `uiomove` faults. - `sceNetSendto` copies the destination address (up to `sizeof(sockaddr_storage)` bytes) the same way before parsing it, and returns `NET_EFAULT` if it isn't readable, like FreeBSD's `getsockaddr` `copyin`. `sceNetSendmsg` passes its `name` through here, so this also covers @lgqdaxia's review point about `msg->name`. - The payload in `sceNetSendto` already failed cleanly with `EFAULT` from the host `send`, so it's unchanged. Other direct address reads (`sceNetBind`, `sceNetConnect`) aren't part of this. New `guest_net_sendmsg_fault_{payload,iovec,header,name}` (`core/libs/tests/GuestNetSendmsgFaults.cpp`, built on the fixture in #11467). Each case maps three guest pages and makes one unreadable with `sceKernelMprotect`: - `payload`: an iovec whose 16 bytes cross into the unreadable page; `sceNetSendto` with the same range as the control. - `iovec`: an iovec table that crosses into it. - `header`: a `NetMsghdr` that crosses into it. - `name`: a destination address in it, through `sceNetSendmsg` and `sceNetSendto`. Each case requires `0x8041010e` with errno 14, then sends a marker datagram and requires it to be the first one received, so nothing was sent by the failed call. A readable `sceNetSendmsg` before and after must still send 8 bytes. ### Tested Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, on `main` `c4669c9ca2`. - The four new tests, `guest_net_buffer_validation` and the 11 `net_dontwait_*` tests pass, 3 of 3 (`ctest --repeat until-fail:3`). - All `guest_net*` and `net_*` tests (58 entries) pass 2 of 2, except `guest_netctl_ap` and `guest_netctl_ap_dialog`, whose executable I didn't build. - **Red without the fix:** with `main`'s `libSceNet/Export.cpp` and this PR's test, each of the four cases fails on its own with `FATAL: unhandled exception 0xc0000005` (`payload` exits `0xc0000409` after the handler, `iovec`, `header` and `name` as `SegFault`). - `tools/check_conventions.py --base origin/main` passes. It merges cleanly with #11037, the open PR that also touches `sceNetSendto`/`sceNetSendmsg`. - After merging `main` `48c160c58b` (head `6e97111223`): the four new tests pass 3 of 3, and the 56 `guest_net*` and `net_*` entries (without the two `guest_netctl_ap` ones) pass 2 of 2. - After merging `main` `f5fefb982c` (head `38c3845149`, 0 behind): the four new tests pass 3 of 3, all 61 `guest_net*` and `net_*` entries pass 2 of 2 (now including the two `guest_netctl_ap` ones), and `tools/check_conventions.py --base origin/main` passes. - After merging `main` `420b6a064e` (head `5f29795a8c`, a clean merge; `main` has since moved 8 commits, none in `libSceNet`): the four new tests pass 3 of 3, all 61 `guest_net*` and `net_*` entries pass 2 of 2, and `tools/check_conventions.py --base origin/main` passes. - Not tested: Linux and macOS, where the CI jobs will run the new tests. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> Fixes #11467 - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-26 15:48:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T15:48:58Z.

Review: CHANGES_REQUESTED


The implementation and focused test cases address the reported unreadable-header, iovec, payload, and destination-address faults. I reviewed the exact head 5780180b94bb against live main da89f18ea7c1; the merge preview is clean, conventions and git diff --check pass, and I found no additional code defect in the changed paths.

I’m requesting one policy update before approval: this branch is still based on c4669c9ca207, while CONTRIBUTING.md requires branches to stay up to date with main. Please rebase or merge the current main. The hosted build/test jobs were skipped by path policy; I did not independently run the Windows test suite. The PR reports the new fault cases passing on Windows, with related network tests also passing.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5654866668 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5654866668). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T15:48:58Z. **Review:** CHANGES_REQUESTED --- The implementation and focused test cases address the reported unreadable-header, iovec, payload, and destination-address faults. I reviewed the exact head `5780180b94bb` against live `main` `da89f18ea7c1`; the merge preview is clean, conventions and `git diff --check` pass, and I found no additional code defect in the changed paths. I’m requesting one policy update before approval: this branch is still based on `c4669c9ca207`, while CONTRIBUTING.md requires branches to stay up to date with `main`. Please rebase or merge the current `main`. The hosted build/test jobs were skipped by path policy; I did not independently run the Windows test suite. The PR reports the new fault cases passing on Windows, with related network tests also passing.
MarcZX10 commented 2026-10-26 15:55:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T15:55:50Z.

Review: APPROVED


Re-reviewed exact head 5fee6793af3e after the requested sync. The merge base is current main da89f18ea7c1; the sync changes only unrelated paths, leaving this PR's production and test files unchanged. The author reports the four new fault tests passing 3/3 and 56 related network tests 2/2 on this head. Conventions and git diff --check pass, and the merge previews against current main and overlapping #11037 are clean. I did not independently run the Windows suite; product jobs are skipped by path policy. The previous branch-freshness request is resolved. Approved.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5654970891 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5654970891). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T15:55:50Z. **Review:** APPROVED --- Re-reviewed exact head `5fee6793af3e` after the requested sync. The merge base is current `main` `da89f18ea7c1`; the sync changes only unrelated paths, leaving this PR's production and test files unchanged. The author reports the four new fault tests passing 3/3 and 56 related network tests 2/2 on this head. Conventions and `git diff --check` pass, and the merge previews against current `main` and overlapping #11037 are clean. I did not independently run the Windows suite; product jobs are skipped by path policy. The previous branch-freshness request is resolved. Approved.
MarcZX10 commented 2026-10-26 17:02:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T17:02:17Z.

Review: CHANGES_REQUESTED


The implementation covers the issue's unreadable payload case and also validates the header, iovec table and destination address. The author reports the four boundary tests and related network tests passing on Windows; current conventions and diff checks pass, and the merge preview against live main is clean. However, the branch is 144 commits behind current main (merge base 5bdda3661), so it fails the repository's current-main sync check. Please rebase onto current main and rerun the focused checks. I found no additional code defect in the changed paths.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5655940839 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5655940839). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T17:02:17Z. **Review:** CHANGES_REQUESTED --- The implementation covers the issue's unreadable payload case and also validates the header, iovec table and destination address. The author reports the four boundary tests and related network tests passing on Windows; current conventions and diff checks pass, and the merge preview against live main is clean. However, the branch is 144 commits behind current main (merge base 5bdda3661), so it fails the repository's current-main sync check. Please rebase onto current main and rerun the focused checks. I found no additional code defect in the changed paths.
MarcZX10 commented 2026-10-26 17:23:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T17:23:43Z.

Review: APPROVED


The requested sync is resolved: exact head 6e9711122350 is 3 commits ahead and 0 behind current upstream/main (48c160c58b58), with a clean merge. The author reports the four new fault-boundary tests passing 3/3 and 56 related network tests passing 2/2 on this head. I did not independently rerun the Windows suite. Current conventions, eligibility, labels, and report checks pass; product and relinker jobs are skipped by path policy. My earlier review found no code defect in the changed paths, so I approve this synchronized head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5656210775 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5656210775). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T17:23:43Z. **Review:** APPROVED --- The requested sync is resolved: exact head `6e9711122350` is 3 commits ahead and 0 behind current `upstream/main` (`48c160c58b58`), with a clean merge. The author reports the four new fault-boundary tests passing 3/3 and 56 related network tests passing 2/2 on this head. I did not independently rerun the Windows suite. Current conventions, eligibility, labels, and report checks pass; product and relinker jobs are skipped by path policy. My earlier review found no code defect in the changed paths, so I approve this synchronized head.
MarcZX10 commented 2026-10-26 18:57:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T18:57:11Z.

Review: APPROVED


Reviewed head 6e97111223506513a54cd808eb9de456df50dd99. The guest-controlled header and iovec table are copied before inspection, each payload is copied through GuestSocketReadGuest_nid_no_patch, and the destination address is copied before parsing. The four boundary cases assert NET_EFAULT/errno 14 and verify no datagram was sent; the readable send path is checked before and after the fault cases.

The hosted eligibility, conventions, labels and report checks pass; the Linux and Windows product jobs were skipped by path policy. I did not rerun the Windows tests locally; the PR reports 3/3 runs of each new test on Windows after syncing to current main, plus 2/2 of the 56 related network tests. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5657425620 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5657425620). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T18:57:11Z. **Review:** APPROVED --- Reviewed head `6e97111223506513a54cd808eb9de456df50dd99`. The guest-controlled header and iovec table are copied before inspection, each payload is copied through `GuestSocketReadGuest_nid_no_patch`, and the destination address is copied before parsing. The four boundary cases assert `NET_EFAULT`/errno 14 and verify no datagram was sent; the readable send path is checked before and after the fault cases. The hosted eligibility, conventions, labels and report checks pass; the Linux and Windows product jobs were skipped by path policy. I did not rerun the Windows tests locally; the PR reports 3/3 runs of each new test on Windows after syncing to current `main`, plus 2/2 of the 56 related network tests. AI-assisted: yes.
jotitadev commented 2026-10-27 01:22:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T01:22:17Z.

Review: COMMENTED


First run on Linux, since the PR lists Linux as not tested and the product jobs were skipped by path policy.

Exact head 6e97111223506513a54cd808eb9de456df50dd99, merged on main cb45ae2dd. Linux x86_64 (bare metal, not WSL), i7-8700, Ubuntu 26.04, kernel 7.0, GCC 15.2, glibc 2.43, CMake 4.2.3, Ninja, Release, BUILD_TESTING=ON, full build.

  • The four guest_net_sendmsg_fault_* tests pass, 3 of 3 runs.
  • The 17 guest_net*|guest_sce_net* tests pass, including both guest_netctl_ap ones and guest_net_buffer_validation.
  • Full non-GPU suite on the same main without the PR: 1361/1361.
  • With only core/libs/prx/libSceNet/Export.cpp reverted to main (new tests kept), all four (payload, iovec, header, name) crash with SIGSEGV. So the unreadable header, iovec table, payload and destination address also crash on Linux, and each test catches its case there.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661175197 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5661175197). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T01:22:17Z. **Review:** COMMENTED --- First run on Linux, since the PR lists Linux as not tested and the product jobs were skipped by path policy. Exact head `6e97111223506513a54cd808eb9de456df50dd99`, merged on `main` `cb45ae2dd`. Linux x86_64 (bare metal, not WSL), i7-8700, Ubuntu 26.04, kernel 7.0, GCC 15.2, glibc 2.43, CMake 4.2.3, Ninja, Release, `BUILD_TESTING=ON`, full build. - The four `guest_net_sendmsg_fault_*` tests pass, 3 of 3 runs. - The 17 `guest_net*|guest_sce_net*` tests pass, including both `guest_netctl_ap` ones and `guest_net_buffer_validation`. - Full non-GPU suite on the same `main` without the PR: 1361/1361. - With only `core/libs/prx/libSceNet/Export.cpp` reverted to `main` (new tests kept), all four (`payload`, `iovec`, `header`, `name`) crash with SIGSEGV. So the unreadable header, iovec table, payload and destination address also crash on Linux, and each test catches its case there. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-27 09:41:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T09:41:04Z.

Review: CHANGES_REQUESTED


Follow-up on the current repository state: this PR is still based on main at 48c160c58b, while the current upstream tip is 801d5b9bc1 (1,275 commits ahead). Both core/libs/prx/libSceNet/Export.cpp and its CMakeLists.txt changed on main since that base, so the submitted change and test registration need to be rebased and rechecked against the current files before merge. The current PR remains mergeable, and I found no new defect in the send-side copy logic on the submitted head; this request is for the required current-main integration and retest. The reported Linux full-build evidence is useful: the exact submitted head passed the four fault cases 3/3, with a baseline control crashing all four. Please rerun the relevant focused tests and overlap/conventions checks on the rebased head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5665013756 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5665013756). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T09:41:04Z. **Review:** CHANGES_REQUESTED --- Follow-up on the current repository state: this PR is still based on `main` at `48c160c58b`, while the current upstream tip is `801d5b9bc1` (1,275 commits ahead). Both `core/libs/prx/libSceNet/Export.cpp` and its `CMakeLists.txt` changed on `main` since that base, so the submitted change and test registration need to be rebased and rechecked against the current files before merge. The current PR remains mergeable, and I found no new defect in the send-side copy logic on the submitted head; this request is for the required current-main integration and retest. The reported Linux full-build evidence is useful: the exact submitted head passed the four fault cases 3/3, with a baseline control crashing all four. Please rerun the relevant focused tests and overlap/conventions checks on the rebased head.
MarcZX10 commented 2026-10-29 07:56:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T07:56:02Z.

Review: CHANGES_REQUESTED


Re-review — changes requested

The latest author report resolves the previous test request on the submitted head: four fault tests passed 3/3 and the related Windows network suite passed 2/2. My earlier source review found no defect in the guest-copy and EFAULT handling.

Current-main integration

The reviewed head is 38c384514945ec400fad63bfcf1ab63d78c94418, based on f5fefb982c53672bda23767304f97aac2eec5207. Current main is 4c7d275bef89d309313d16bc2bc05d37a1b50be2. The current merge preview is clean, but main has since changed 145 lines in core/libs/prx/libSceNet/Export.cpp, which this PR also changes. CONTRIBUTING requires keeping the branch up to date with main.

Please integrate current main and rerun the four guest_net_sendmsg_fault_* tests on the updated head. The existing independent Linux run is useful but predates the latest branch sync; please rerun the four tests on Linux as well so the current integrated copy path is covered on both platforms.

Checks

  • git diff --check: passed against current main.
  • tools/check_conventions.py: passed against current main.
  • Hosted Windows passed; Linux/product and specialized jobs are skipped.
  • I did not build or run these tests locally.

I found no new code defect; this request is for the required current-main integration and focused retest.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5694456441 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5694456441). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T07:56:02Z. **Review:** CHANGES_REQUESTED --- # Re-review — changes requested The latest author report resolves the previous test request on the submitted head: four fault tests passed 3/3 and the related Windows network suite passed 2/2. My earlier source review found no defect in the guest-copy and `EFAULT` handling. ## Current-main integration The reviewed head is `38c384514945ec400fad63bfcf1ab63d78c94418`, based on `f5fefb982c53672bda23767304f97aac2eec5207`. Current `main` is `4c7d275bef89d309313d16bc2bc05d37a1b50be2`. The current merge preview is clean, but `main` has since changed 145 lines in `core/libs/prx/libSceNet/Export.cpp`, which this PR also changes. CONTRIBUTING requires keeping the branch up to date with `main`. Please integrate current `main` and rerun the four `guest_net_sendmsg_fault_*` tests on the updated head. The existing independent Linux run is useful but predates the latest branch sync; please rerun the four tests on Linux as well so the current integrated copy path is covered on both platforms. ## Checks - `git diff --check`: passed against current `main`. - `tools/check_conventions.py`: passed against current `main`. - Hosted Windows passed; Linux/product and specialized jobs are skipped. - I did not build or run these tests locally. I found no new code defect; this request is for the required current-main integration and focused retest.
MarcZX10 commented 2026-10-29 21:27:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:27:33Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The Windows rerun covers head 5f29795a8c231f504c971aa7296acec256e4da71, but the available Linux fault-test run is on earlier head 6e97111223506513a54cd808eb9de456df50dd99, before the libSceNet source changes merged into this head.

What I ran

Compared exact PR head 5f29795a8c231f504c971aa7296acec256e4da71 against live main 1a4d8fd28bafe20792aa9f99bd6e09ab53c43687 on Linux x86-64 using Git and GitHub CLI. The merge preview is clean and git diff --check passes. I also ran the repository convention check. I did not build or run tests locally.

git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-11472-head
git diff --check refs/remotes/upstream/main...refs/review/pr-11472-head
python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/review/pr-11472-head
gh pr checks 11472 --repo boykopovar/AnyPS5

Results

Check Result
Merge preview with live main Clean; tree 952fd6a238cc1ca9ae3f461b4ee3edbb20b3c72e
git diff --check Passed; no output
check_conventions.py Passed
Hosted checks Windows, conventions, labels, report and eligibility pass; Linux and specialized jobs are skipped
Windows fault/network tests Author reports the four fault tests 3/3 and all 61 related network tests 2/2 on exact head 5f29795a8c
Linux fault tests The independent 3/3 report is on older head 6e97111223. The Export.cpp and CMake files differ between that head and 5f29795a8c, so it does not verify the exact submitted integration
Current-main path comparison No libSceNet source or CMake paths changed on main after the branch's 420b6a064e merge; the live-main merge preview is clean
Unedited local output
952fd6a238cc1ca9ae3f461b4ee3edbb20b3c72e
All conventions checks passed.

git diff --check produced no output and exited successfully. The path comparison found no matching libSceNet paths.

Findings

Blocking

  • The Linux regression evidence predates the submitted source integration. The current head includes main's later libSceNet/Export.cpp and CMake changes relative to Linux-tested head 6e97111223; the current-head Windows run does not exercise Linux guest-memory protection behavior. Please run guest_net_sendmsg_fault_{payload,iovec,header,name} on exact head 5f29795a8c231f504c971aa7296acec256e4da71 (and keep the existing baseline negative control), or obtain an exact-head Linux report from another tester. The existing Linux report remains useful for the earlier implementation.

Non-blocking

  • The exact-head Windows report, clean current-main merge preview, convention pass, and earlier Linux negative control provide useful coverage. I found no additional source-level defect in the reviewed send-side copy logic.

Sources

Not verified

I did not build or run the Linux tests locally, verify the author's Windows logs independently, or test on macOS or console hardware. Linux product CI is skipped for this PR.

To get this to a good state

Run the four focused fault tests on exact head 5f29795a8c231f504c971aa7296acec256e4da71 on Linux, include validation of the existing baseline control, and update the Tested section. I will recheck the exact new head and rerun the available non-build checks.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5705198388 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5705198388). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T21:27:33Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The Windows rerun covers head `5f29795a8c231f504c971aa7296acec256e4da71`, but the available Linux fault-test run is on earlier head `6e97111223506513a54cd808eb9de456df50dd99`, before the `libSceNet` source changes merged into this head. ## What I ran Compared exact PR head `5f29795a8c231f504c971aa7296acec256e4da71` against live `main` `1a4d8fd28bafe20792aa9f99bd6e09ab53c43687` on Linux x86-64 using Git and GitHub CLI. The merge preview is clean and `git diff --check` passes. I also ran the repository convention check. I did not build or run tests locally. ```sh git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-11472-head git diff --check refs/remotes/upstream/main...refs/review/pr-11472-head python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/review/pr-11472-head gh pr checks 11472 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Merge preview with live `main` | Clean; tree `952fd6a238cc1ca9ae3f461b4ee3edbb20b3c72e` | | `git diff --check` | Passed; no output | | `check_conventions.py` | Passed | | Hosted checks | Windows, conventions, labels, report and eligibility pass; Linux and specialized jobs are skipped | | Windows fault/network tests | Author reports the four fault tests 3/3 and all 61 related network tests 2/2 on exact head `5f29795a8c` | | Linux fault tests | The independent 3/3 report is on older head `6e97111223`. The `Export.cpp` and CMake files differ between that head and `5f29795a8c`, so it does not verify the exact submitted integration | | Current-main path comparison | No `libSceNet` source or CMake paths changed on `main` after the branch's `420b6a064e` merge; the live-main merge preview is clean | <details><summary>Unedited local output</summary> ```text 952fd6a238cc1ca9ae3f461b4ee3edbb20b3c72e All conventions checks passed. ``` `git diff --check` produced no output and exited successfully. The path comparison found no matching `libSceNet` paths. </details> ## Findings ### Blocking - **The Linux regression evidence predates the submitted source integration.** The current head includes main's later `libSceNet/Export.cpp` and CMake changes relative to Linux-tested head `6e97111223`; the current-head Windows run does not exercise Linux guest-memory protection behavior. Please run `guest_net_sendmsg_fault_{payload,iovec,header,name}` on exact head `5f29795a8c231f504c971aa7296acec256e4da71` (and keep the existing baseline negative control), or obtain an exact-head Linux report from another tester. The existing Linux report remains useful for the earlier implementation. ### Non-blocking - The exact-head Windows report, clean current-main merge preview, convention pass, and earlier Linux negative control provide useful coverage. I found no additional source-level defect in the reviewed send-side copy logic. ## Sources - [Contribution and current-main rule at `1a4d8fd28bafe20792aa9f99bd6e09ab53c43687`](https://github.com/boykopovar/AnyPS5/blob/1a4d8fd28bafe20792aa9f99bd6e09ab53c43687/CONTRIBUTING.md#L57) - [Current implementation and tests at `5f29795a8c231f504c971aa7296acec256e4da71`](https://github.com/boykopovar/AnyPS5/tree/5f29795a8c231f504c971aa7296acec256e4da71) - [Earlier Linux-tested head `6e97111223506513a54cd808eb9de456df50dd99`](https://github.com/boykopovar/AnyPS5/tree/6e97111223506513a54cd808eb9de456df50dd99) ## Not verified I did not build or run the Linux tests locally, verify the author's Windows logs independently, or test on macOS or console hardware. Linux product CI is skipped for this PR. ## To get this to a good state Run the four focused fault tests on exact head `5f29795a8c231f504c971aa7296acec256e4da71` on Linux, include validation of the existing baseline control, and update the Tested section. I will recheck the exact new head and rerun the available non-build checks.
MarcZX10 commented 2026-10-31 09:28:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T09:28:23Z.

Review: APPROVED


Reviewed — looks good

The previously blocking Linux evidence gap is resolved: the four fault tests and the negative control were reported on exact head 5f29795a8c231f504c971aa7296acec256e4da71.

What I ran

Reviewed exact head 5f29795a8c231f504c971aa7296acec256e4da71. GitHub reports PR base 420b6a064eadaa7c5e50b080c7fad59c41150b4b; current main was bd9039ca20905c71c0eb77a4a0f5194f0ef98838. The merge preview against current main was clean. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5; I did not build locally.

python3 /root/.codex/skills/anyps5-pr-review/scripts/pr_snapshot.py 11472 --repo boykopovar/AnyPS5
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11472 --no-negative-controls --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-11472
git diff --check refs/remotes/upstream/main...refs/remotes/upstream/pr-11472
python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/remotes/upstream/pr-11472 --title 'fix(libSceNet): return EFAULT from sceNetSendmsg and sceNetSendto for unreadable guest memory' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-11472/pr-body.md
git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr-11472
git diff --name-only 420b6a064eadaa7c5e50b080c7fad59c41150b4b..refs/remotes/upstream/main -- core/libs/prx/libSceNet

Results

Check Result
Diff check and conventions Passed against current main.
Merge preview Clean against current main.
Current-main changes since PR base The module's CMake/export files changed, but the inspected changes add inventory exports and IPv6 constants; they do not alter the send/copy paths. The merge preview is clean, so these changes do not invalidate the exact-head Linux report.
No-build precheck Diff, conventions/template, and live mergeability passed. ABI/test-quality helper rows could not run because the isolated checkout lacks local-only scripts; no ABI change is in scope.
Linux regression evidence Another contributor reports all four guest_net_sendmsg_fault_* tests passed 3/3 on the exact PR head, the 39-entry network test family passed, and reverting Export.cpp made all four fault tests crash.
Windows regression evidence The author reports the four fault tests passed 3/3 and 61 related network tests passed 2/2 on the same head.
Hosted CI Windows, conventions, labels, report, and eligibility passed; Linux product and specialized jobs were skipped.
Local build / tests Not run.
Selected unedited command output

Conventions:

All conventions checks passed.

Merge preview:

773f02c8ff0506a1f096abeee2ceb41330207811

Negative control

Assertion Mutation Result
Each unreadable guest-memory path returns EFAULT without sending a datagram. Linux tester reports reverting Export.cpp to main while retaining the tests. Author-reported: all four focused tests crash with SIGSEGV on exact head; not independently run here.

Findings

Blocking

None found. The requested Linux run is on the exact submitted head, and the current-main merge preview is clean.

Non-blocking

The current main contains later changes in the same module, limited here to inventory exports and IPv6 constants. I found no overlap with the reviewed send-side copy logic, so I am not asking for a rebase solely to update the branch.

Sources

Not verified

I did not independently build or run tests. The Linux and Windows test results are reports from other contributors; macOS and console behavior were not verified. Linux product CI is skipped for this PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5722170166 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11472#pullrequestreview-5722170166). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T09:28:23Z. **Review:** APPROVED --- # Reviewed — looks good The previously blocking Linux evidence gap is resolved: the four fault tests and the negative control were reported on exact head `5f29795a8c231f504c971aa7296acec256e4da71`. ## What I ran Reviewed exact head `5f29795a8c231f504c971aa7296acec256e4da71`. GitHub reports PR base `420b6a064eadaa7c5e50b080c7fad59c41150b4b`; current `main` was `bd9039ca20905c71c0eb77a4a0f5194f0ef98838`. The merge preview against current `main` was clean. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5; I did not build locally. ```sh python3 /root/.codex/skills/anyps5-pr-review/scripts/pr_snapshot.py 11472 --repo boykopovar/AnyPS5 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11472 --no-negative-controls --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-11472 git diff --check refs/remotes/upstream/main...refs/remotes/upstream/pr-11472 python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/remotes/upstream/pr-11472 --title 'fix(libSceNet): return EFAULT from sceNetSendmsg and sceNetSendto for unreadable guest memory' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-11472/pr-body.md git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr-11472 git diff --name-only 420b6a064eadaa7c5e50b080c7fad59c41150b4b..refs/remotes/upstream/main -- core/libs/prx/libSceNet ``` ## Results | Check | Result | |---|---| | Diff check and conventions | Passed against current `main`. | | Merge preview | Clean against current `main`. | | Current-main changes since PR base | The module's CMake/export files changed, but the inspected changes add inventory exports and IPv6 constants; they do not alter the send/copy paths. The merge preview is clean, so these changes do not invalidate the exact-head Linux report. | | No-build precheck | Diff, conventions/template, and live mergeability passed. ABI/test-quality helper rows could not run because the isolated checkout lacks local-only scripts; no ABI change is in scope. | | Linux regression evidence | Another contributor reports all four `guest_net_sendmsg_fault_*` tests passed 3/3 on the exact PR head, the 39-entry network test family passed, and reverting `Export.cpp` made all four fault tests crash. | | Windows regression evidence | The author reports the four fault tests passed 3/3 and 61 related network tests passed 2/2 on the same head. | | Hosted CI | Windows, conventions, labels, report, and eligibility passed; Linux product and specialized jobs were skipped. | | Local build / tests | Not run. | <details><summary>Selected unedited command output</summary> Conventions: ```text All conventions checks passed. ``` Merge preview: ```text 773f02c8ff0506a1f096abeee2ceb41330207811 ``` </details> ## Negative control | Assertion | Mutation | Result | |---|---|---| | Each unreadable guest-memory path returns `EFAULT` without sending a datagram. | Linux tester reports reverting `Export.cpp` to `main` while retaining the tests. | Author-reported: all four focused tests crash with `SIGSEGV` on exact head; not independently run here. | ## Findings ### Blocking None found. The requested Linux run is on the exact submitted head, and the current-main merge preview is clean. ### Non-blocking The current `main` contains later changes in the same module, limited here to inventory exports and IPv6 constants. I found no overlap with the reviewed send-side copy logic, so I am not asking for a rebase solely to update the branch. ## Sources - [Implementation, CMake, and tests at the exact reviewed head](https://github.com/boykopovar/AnyPS5/tree/5f29795a8c231f504c971aa7296acec256e4da71/core/libs) - [Exact-head Linux test report and negative control](https://github.com/boykopovar/AnyPS5/pull/11472#issuecomment-6520121223) - [Contribution rules at the checked current main](https://github.com/boykopovar/AnyPS5/blob/bd9039ca20905c71c0eb77a4a0f5194f0ef98838/CONTRIBUTING.md) ## Not verified I did not independently build or run tests. The Linux and Windows test results are reports from other contributors; macOS and console behavior were not verified. Linux product CI is skipped for this PR.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11472
No description provided.