feat(libSceNet): support IPv6 dual-stack socket options #10949

Merged
AZLisme merged 3 commits from upstream-pr/10949 into main 2026-10-26 21:57:33 +00:00
AZLisme commented 2026-10-25 11:20:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AZLisme on 2026-10-25T11:20:02Z.


What

sceNetSetsockopt and sceNetGetsockopt support IPv6-level IPV6_V6ONLY through the shared option backend, including IPv4-mapped TCP/UDP traffic on dual-stack sockets. The contract follows FreeBSD 11.4 ip6_ctloutput; console verification and the existing null-buffer policy remain debt.

Address the guest-output review by staging IPv6 readback and opening GuestArena::HostWrite for exactly the bounded option bytes and the full length output before either caller buffer is modified. A rejected guard returns guest EFAULT (0x8041010e, errno 14). The shared socket-option copy helper applies the same guards to kernel callers and returns errno 14 on rejection. The existing kernel null-value length reset is guarded too.

Rebased onto 4b1a9a3b2f51efe6fcde289ba0788f3cfffe2f32, the actual merge of #9525, preserving upstream SO_TYPE/SO_ACCEPTCONN, SO_PROTOCOL, keepalive and nodelay behavior and their complete tests.

Use exported extern "C" GuestSocketSetIpv6LevelOption_nid_no_patch and GuestSocketGetIpv6LevelOption_nid_no_patch bridges for the Net-to-kernel boundary, addressing the patched-module review. The bridges delegate to the existing option backend and preserve its input, error and output-guard behavior. Their declarations have one canonical header reachable through libkernel.hpp.

#9525 merged as 4b1a9a3b2f51 at 2026-10-26 11:01:28 UTC, with author head ea7109554ca5c49458c7250bedf486720079b21c. This rebase fulfills the agreed #9525-first order. Its GuestNetSocketState.cpp and complete guest_net_socket_state registration are retained byte-for-byte; the full upstream Net CMake remains intact with both IPv6 test blocks added. The IPv6 implementation, guest-output guards, exported C bridges and real patched-module test remain intact too. The checklist retains #9525 to record the fulfilled dependency.

Tested

Maintainer CI update for unchanged head ada64cab1e4b:

40390920026/a1 completed SUCCESS (six jobs succeeded, two skipped). Base b9c30ee5054d; ordered inputs #10949 ada64cab1e4b, #11025 65172ff41479, #10907 476b63dd4581, #10988 a9051f9aacb2, #10991 882a3e39b67d. Linux: 2,311 passed, 93 validated expected skips, zero failed / 2,404. Windows: 1,694 passed, 816 validated expected skips, zero failed / 2,510. All 65 header cases passed on each platform.

40392894595/a1 completed FAILURE (eleven jobs succeeded, Windows failed). Base 43c084150717; ordered inputs #9867 b70c7ceb63ca, #10949 ada64cab1e4b, #11025 65172ff41479, #10925 f4296894ac39, #10988 a9051f9aacb2. Linux: 2,312 passed, 93 validated expected skips, zero failed / 2,405, including all 65 header cases. Windows: 1,630 passed, 816 observed skips, one timeout and 64 Not Run / 2,511. public_headers timed out at 30.01 seconds, preventing its 64 dependent compilation cases from running; the skip validator did not execute. No compiler/declaration diagnostic established the timeout's cause or attribution to Net.

All nine selected network/option/module cases passed on both platforms in both batches, including ordinary/patched IPv6 checks and patched_libraries. Raw source guards and five successful merges bind each job to its listed inputs. The second batch remains failed despite its Linux success.

Source and the #9525 dependency are unchanged; these results cover only the stated composites, and all earlier evidence and failure history below retain their original scopes.

Current preserving-rebase head: ada64cab1e4b7b29594b7f273adb5f0527adca43, based on actual merged main 4b1a9a3b2f51efe6fcde289ba0788f3cfffe2f32. Linux x86-64, GCC 16.2.1, Release: 51/51 selected CTests passed, without skips, with explicit /dev/null stdin. These are all current Net and NetCtl CTests plus the kernel socket regressions, guest_recvmsg_memory and the actual patched-library loader. The complete new socket-state fixture, protocol/nodelay/keepalive tests, both IPv6 fixtures, mapped-output guards and callback/network regressions all execute.

Freshly built libc, libkernel, libkernel_sys, libSceLibcInternal, Net, NetCtl, PosixForWebKit and SpSysCallWrapper from this exact source. Current upstream PosixForWebKit requires libkernel_sys, so the actual bounded closure is eight patched PRXs, all loaded successfully. The ignored component driver uses the normal module CMake bodies, exact normal helper functions and real source-built NID patcher with production copy/patch and libc-export exclusion rules. Its local libs target covers those eight modules; the checked-in fixture still depends on the repository's full libs target. This is not a full 368-library product run. The fresh build compiled 217 objects; all 340 actual project inputs and 47 produced module/patcher/fixture artifacts are bound to this head. Existing source-built ZArchive/zstd archives were reused after rechecking 78 source/header inputs and both archive hashes. No core PRX was imported.

The initial broad run retained 50 passes and one guest_sce_net failure with inherited regular-file stdin. That unchanged fixture assumes stdin is not read-ready at its standard-descriptor select assertion. A separate fresh exact-parent build and the rebased build both fail with regular heredoc stdin and both pass with /dev/null character stdin; actual child descriptor types/paths were captured. A private diagnostic-only copy observes select returning 3/read-mask 1/write-mask 6 for regular stdin and 2/read-mask 0/write-mask 6 for /dev/null. No production behavior or assertion was changed. The final unchanged 51-case suite uses the explicitly recorded /dev/null context and passes completely; the initial failure and all four original-fixture parent/branch controls remain preserved. These controls cover that one parent fixture, not a full 51-case parent baseline.

The full public-header audit passed (368 umbrellas / 12,228 guest exports), as did eight standalone repeated-inclusion units and one combined typed composition unit. Normal registration auditing found 312 generated executable targets and no unregistered target; only 30 selected fixture targets were built and 51 cases executed. Conventions and whitespace checks pass. Source and loader evidence retains both C bridges and binds the new fixture to the newly built patched providers. The source-preserving rebase has independent peer review; author-run Windows/macOS, full-product and physical PS5 execution are not claimed. Please rerun maintainer full Linux/Windows CI on this head and re-review before merging.

An independent Windows report by ycbuzi covers exact ada64cab1e merged onto main 2cce8bc51d: Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release. patched_libraries, net_ipv6only and net_ipv6only_patched each passed 2/2 with ctest --repeat until-fail:2; Net and its importers loaded successfully. Keeping the PR tests while substituting main's five production files made both IPv6 fixtures fail. oneandonlydean acknowledged that this covers the Windows error-127 load failure, while rebase review and full Linux/Windows CI remain pending. This is attributed native Windows component evidence, separate from author-run Linux checks and hosted full-product CI.

Historical pre-parent validation follows; it does not qualify the new rebase:

Historical pre-parent bridge-fix head: 4bc97938d2edbfbc0b3a860ec55fc1a5ae4eef64, a child of e8a1b7642cf4a4c36704064224f1abe17dab31d5. The branch ancestor remains 4017310678562c63594d99b8f45db2d68b9aaa6c; this revision has not been rebased onto the later static-check base below. Linux x86-64, GCC 16.2.1, Release: 7/7 selected CTests passed, with no skips.

Freshly built the actual libc, libkernel, libSceLibcInternal, Net, NetCtl, PosixForWebKit and SpSysCallWrapper library CMake bodies and the source-built NID patcher. The private component driver stages these seven real patched PRXs with the production copy/patch commands and actual libc export exclusions. It defines its local libs target over this bounded closure; the checked-in test depends on the repository's ordinary full libs target. This local run is not the full 368-library product build. Normal CTest registration auditing found 304 generated executable targets and no unregistered target; it does not mean all 304 were built or executed.

The seven executed cases were patched_libraries, net_ipv6only_patched, net_ipv6only, guest_net_protocol, guest_net_buffer_validation, guest_socket_options and guest_socket_options_multicast. The unchanged loader test reported seven patched libraries loaded and zero failures. The new standalone fixture links no guest PRX, resolves guest functions by their production NIDs, and exercises TCP/UDP V6ONLY setters/getters, Boolean normalization, capacities 0–8, canaries, invalid lengths and unchanged option state. Actual loader traces bind its Net, kernel and libc to the staged patched directory. Both raw C bridge exports/imports remain intact after patching. A controlled substitution of the previously qualified E8 patched Net into the same new dependency closure makes this fixture fail on the unresolved C++ getter; this is an old-consumer control, not a complete parent-tree baseline.

The fresh build took 209 steps and compiled 187 objects; all 307 actual project source/header inputs match this committed head. Existing source-built ZArchive/zstd archives were reused after rechecking their 78 source/header inputs and archive hashes; no core PRX was imported. The full public-header audit passed (368 umbrellas / 12,192 guest exports), as did three standalone repeated-inclusion/type composition units, registration, conventions and whitespace checks. Socket tests required execution outside the local network-restricted sandbox after ordinary host IPv4/IPv6 sockets also returned EPERM; that restricted attempt is retained separately from the successful run.

A static merge with main 5b5d24cb223ede690fe5eab1fe2f7a1736b801a5 is clean. That is not a runtime test of the merge. There is no new Windows, full-product or console execution claim for this bridge revision; maintainer full Linux/Windows CI should be rerun on the new head. At that earlier point #9525 was still pending; its later merge and the preserving rebase validated above fulfill that landing order.

Historical pre-bridge evidence follows; those earlier direct-link tests did not validate loaded patched Net imports:

Historical tested head: e8a1b7642cf4a4c36704064224f1abe17dab31d5. Linux x86-64, GCC 16.2.1, Release: 32/32 focused runtime tests pass, without skips. Built the complete modified libkernel and libSceNet PRXs plus libSceNetCtl through their runtime CMake, and produced patched PRX artifacts. libc/libSceLibcInternal dependencies were freshly rebuilt at the exact base; the modified helper was compiled into this branch's own kernel binary.

The IPv6 suite covers existing mapped TCP/UDP traffic and option validation, plus both Net and kernel getters into real shared direct-memory mappings. Mapped capacities 0,1,2,3,4,5,8 and UINT32_MAX, alias readback, canaries and read-only pages immediately beyond the exact output ranges check bounded writes and zero-capacity behavior. Existing kernel socket-option and multicast regressions pass.

Windows-only regression code uses tracked direct mappings to verify failed HostWrite::Open() for read-only value/length outputs, guest EFAULT, unchanged outputs on rejection, null kernel output handling and write-watch reporting. These Windows checks were not run by the author on this Linux host; the independent native Windows results are linked below; non-Windows Open() always succeeds, so Linux execution does not establish that rejection path. Author-run Windows/macOS/PS5 execution and a monolithic repository build were not performed; the separate Windows report is attributed below.

Both canonical umbrella headers compile standalone with repeated inclusion; the full public-header audit passes (368 libraries / 12,192 exports). Conventions and whitespace checks pass.

cmake --build build-review-net/runtime --parallel 2
ctest --test-dir build-review-net/runtime --output-on-failure --parallel 2
python3 core/libs/tests/test_public_headers.py --audit-only
python3 tools/check_conventions.py --base origin/main
git diff --check

An independent exact-head Windows report covers e8a1b7642c merged onto main d2b3ee3bcc, Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7, Release. All 18 targeted Net/socket tests passed both repeated runs, including real IPv6 and the Windows-only read-only value/length rejection and write-watch cases. Its reverted-source control failed the IPv6 feature test. This is reviewer-reported native Windows evidence, separate from the author-run Linux suite and from hosted product CI.

Historical private integration with #9525 ea7109554c and this head e8a1b7642c passed 35/35 focused Linux tests without skips, including guest_net_socket_state and net_ipv6only. The exact union is c885fed64f5b84709a416c7b3323ff5d4173ce4f, based on its actual upstream ancestor b4d8e8bb3b. Its libc, libkernel, libSceLibcInternal, Net and NetCtl modules were built from that union, including the modified kernel guards; runtime bindings and hashes were checked. Complete feature/test blocks, upstream protocol/nodelay behavior, canonical headers and debt are preserved. Header, conventions, whitespace and independent peer checks pass. This is a private Linux combination; the earlier Windows report remains scoped to e8a and its reported merge, and the new socket-state direct-output paths are not newly validated on Windows here.

Historical private option-dispatch integration additionally passed 42/42 registered Linux tests, with independent source/runtime peer review, at composition 478e95a54c8c (tree 0261c6ca38f5). It combines published Net e8a1b7642cf4, NetCtl e6ac99c16325, #9525 ea7109554ca5, #9515 00924d8f9f8a and #9578 89da0c7455d4, starting from main 1997e647f93c and preserving #9578's inherited main 2b5225605bd5. All five runtime PRXs and the patcher were freshly built from that view. Four private routing cases cover direct Net, Ex-to-Net, kernel forwarding of Net-owned descriptors, and kernel-owned descriptors, including error conversion, bounded/aliased IPv6 outputs, null/capacity rules and preserved V6 callbacks. Header/conventions checks pass. Tests execute ordinary canonical API calls on the actual unpatched libraries; patched artifacts were separately generated. Windows rejected-write subcases were unavailable on Linux, and this is not a full-product, patched-title or console result. The earlier Windows report still covers its exact published E8 source only. This composition does not add dependencies, change the agreed #9525-before-#10949 order, or waive other input authors' prerequisites; that historical composition left the published E8 source unchanged and did not include this bridge revision.

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: #9525
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5004239476 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10949). Originally posted by [AZLisme](https://github.com/AZLisme) on 2026-10-25T11:20:02Z. --- ### What `sceNetSetsockopt` and `sceNetGetsockopt` support IPv6-level `IPV6_V6ONLY` through the shared option backend, including IPv4-mapped TCP/UDP traffic on dual-stack sockets. The contract follows FreeBSD 11.4 [ip6_ctloutput](https://github.com/freebsd/freebsd-src/blob/releng/11.4/sys/netinet6/ip6_output.c); console verification and the existing null-buffer policy remain debt. Address the guest-output review by staging IPv6 readback and opening `GuestArena::HostWrite` for exactly the bounded option bytes and the full length output before either caller buffer is modified. A rejected guard returns guest `EFAULT` (`0x8041010e`, errno 14). The shared socket-option copy helper applies the same guards to kernel callers and returns errno 14 on rejection. The existing kernel null-value length reset is guarded too. Rebased onto `4b1a9a3b2f51efe6fcde289ba0788f3cfffe2f32`, the actual merge of #9525, preserving upstream `SO_TYPE`/`SO_ACCEPTCONN`, `SO_PROTOCOL`, keepalive and nodelay behavior and their complete tests. Use exported `extern "C"` `GuestSocketSetIpv6LevelOption_nid_no_patch` and `GuestSocketGetIpv6LevelOption_nid_no_patch` bridges for the Net-to-kernel boundary, addressing [the patched-module review](https://github.com/boykopovar/AnyPS5/pull/10949#issuecomment-6413437236). The bridges delegate to the existing option backend and preserve its input, error and output-guard behavior. Their declarations have one canonical header reachable through `libkernel.hpp`. #9525 [merged as `4b1a9a3b2f51`](https://github.com/boykopovar/AnyPS5/commit/4b1a9a3b2f51efe6fcde289ba0788f3cfffe2f32) at 2026-10-26 11:01:28 UTC, with author head `ea7109554ca5c49458c7250bedf486720079b21c`. This rebase fulfills the agreed #9525-first order. Its `GuestNetSocketState.cpp` and complete `guest_net_socket_state` registration are retained byte-for-byte; the full upstream Net CMake remains intact with both IPv6 test blocks added. The IPv6 implementation, guest-output guards, exported C bridges and real patched-module test remain intact too. The checklist retains #9525 to record the fulfilled dependency. ### Tested Maintainer CI update for unchanged head `ada64cab1e4b`: [40390920026/a1](https://github.com/boykopovar/AnyPS5/actions/runs/40390920026) completed **SUCCESS** (six jobs succeeded, two skipped). Base `b9c30ee5054d`; ordered inputs #10949 `ada64cab1e4b`, #11025 `65172ff41479`, #10907 `476b63dd4581`, #10988 `a9051f9aacb2`, #10991 `882a3e39b67d`. Linux: **2,311 passed, 93 validated expected skips, zero failed / 2,404**. Windows: **1,694 passed, 816 validated expected skips, zero failed / 2,510**. All **65 header cases passed** on each platform. [40392894595/a1](https://github.com/boykopovar/AnyPS5/actions/runs/40392894595) completed **FAILURE** (eleven jobs succeeded, Windows failed). Base `43c084150717`; ordered inputs #9867 `b70c7ceb63ca`, #10949 `ada64cab1e4b`, #11025 `65172ff41479`, #10925 `f4296894ac39`, #10988 `a9051f9aacb2`. Linux: **2,312 passed, 93 validated expected skips, zero failed / 2,405**, including all 65 header cases. Windows: **1,630 passed, 816 observed skips, one timeout and 64 Not Run / 2,511**. `public_headers` timed out at **30.01 seconds**, preventing its 64 dependent compilation cases from running; the skip validator did not execute. No compiler/declaration diagnostic established the timeout's cause or attribution to Net. All **nine selected network/option/module cases passed on both platforms in both batches**, including ordinary/patched IPv6 checks and `patched_libraries`. Raw source guards and five successful merges bind each job to its listed inputs. The second batch remains failed despite its Linux success. Source and the #9525 dependency are unchanged; these results cover only the stated composites, and all earlier evidence and failure history below retain their original scopes. Current preserving-rebase head: `ada64cab1e4b7b29594b7f273adb5f0527adca43`, based on actual merged main `4b1a9a3b2f51efe6fcde289ba0788f3cfffe2f32`. Linux x86-64, GCC 16.2.1, Release: **51/51 selected CTests passed, without skips**, with explicit `/dev/null` stdin. These are all current Net and NetCtl CTests plus the kernel socket regressions, `guest_recvmsg_memory` and the actual patched-library loader. The complete new socket-state fixture, protocol/nodelay/keepalive tests, both IPv6 fixtures, mapped-output guards and callback/network regressions all execute. Freshly built libc, libkernel, libkernel_sys, libSceLibcInternal, Net, NetCtl, PosixForWebKit and SpSysCallWrapper from this exact source. Current upstream PosixForWebKit requires libkernel_sys, so the actual bounded closure is **eight patched PRXs**, all loaded successfully. The ignored component driver uses the normal module CMake bodies, exact normal helper functions and real source-built NID patcher with production copy/patch and libc-export exclusion rules. Its local `libs` target covers those eight modules; the checked-in fixture still depends on the repository's full `libs` target. This is not a full 368-library product run. The fresh build compiled 217 objects; all 340 actual project inputs and 47 produced module/patcher/fixture artifacts are bound to this head. Existing source-built ZArchive/zstd archives were reused after rechecking 78 source/header inputs and both archive hashes. No core PRX was imported. The initial broad run retained **50 passes and one `guest_sce_net` failure** with inherited regular-file stdin. That unchanged fixture assumes stdin is not read-ready at its standard-descriptor `select` assertion. A separate fresh exact-parent build and the rebased build both fail with regular heredoc stdin and both pass with `/dev/null` character stdin; actual child descriptor types/paths were captured. A private diagnostic-only copy observes `select` returning 3/read-mask 1/write-mask 6 for regular stdin and 2/read-mask 0/write-mask 6 for `/dev/null`. No production behavior or assertion was changed. The final unchanged 51-case suite uses the explicitly recorded `/dev/null` context and passes completely; the initial failure and all four original-fixture parent/branch controls remain preserved. These controls cover that one parent fixture, not a full 51-case parent baseline. The full public-header audit passed (368 umbrellas / 12,228 guest exports), as did eight standalone repeated-inclusion units and one combined typed composition unit. Normal registration auditing found 312 generated executable targets and no unregistered target; only 30 selected fixture targets were built and 51 cases executed. Conventions and whitespace checks pass. Source and loader evidence retains both C bridges and binds the new fixture to the newly built patched providers. The source-preserving rebase has independent peer review; author-run Windows/macOS, full-product and physical PS5 execution are not claimed. Please rerun maintainer full Linux/Windows CI on this head and re-review before merging. An independent [Windows report by ycbuzi](https://github.com/boykopovar/AnyPS5/pull/10949#issuecomment-6416276484) covers exact `ada64cab1e` merged onto main `2cce8bc51d`: Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release. `patched_libraries`, `net_ipv6only` and `net_ipv6only_patched` each passed 2/2 with `ctest --repeat until-fail:2`; Net and its importers loaded successfully. Keeping the PR tests while substituting main's five production files made both IPv6 fixtures fail. [oneandonlydean acknowledged that this covers the Windows error-127 load failure](https://github.com/boykopovar/AnyPS5/pull/10949#issuecomment-6416796690), while rebase review and full Linux/Windows CI remain pending. This is attributed native Windows component evidence, separate from author-run Linux checks and hosted full-product CI. Historical pre-parent validation follows; it does not qualify the new rebase: Historical pre-parent bridge-fix head: `4bc97938d2edbfbc0b3a860ec55fc1a5ae4eef64`, a child of `e8a1b7642cf4a4c36704064224f1abe17dab31d5`. The branch ancestor remains `4017310678562c63594d99b8f45db2d68b9aaa6c`; this revision has not been rebased onto the later static-check base below. Linux x86-64, GCC 16.2.1, Release: **7/7 selected CTests passed, with no skips**. Freshly built the actual libc, libkernel, libSceLibcInternal, Net, NetCtl, PosixForWebKit and SpSysCallWrapper library CMake bodies and the source-built NID patcher. The private component driver stages these **seven real patched PRXs** with the production copy/patch commands and actual libc export exclusions. It defines its local `libs` target over this bounded closure; the checked-in test depends on the repository's ordinary full `libs` target. This local run is not the full 368-library product build. Normal CTest registration auditing found 304 generated executable targets and no unregistered target; it does not mean all 304 were built or executed. The seven executed cases were `patched_libraries`, `net_ipv6only_patched`, `net_ipv6only`, `guest_net_protocol`, `guest_net_buffer_validation`, `guest_socket_options` and `guest_socket_options_multicast`. The unchanged loader test reported seven patched libraries loaded and zero failures. The new standalone fixture links no guest PRX, resolves guest functions by their production NIDs, and exercises TCP/UDP V6ONLY setters/getters, Boolean normalization, capacities 0–8, canaries, invalid lengths and unchanged option state. Actual loader traces bind its Net, kernel and libc to the staged patched directory. Both raw C bridge exports/imports remain intact after patching. A controlled substitution of the previously qualified E8 patched Net into the same new dependency closure makes this fixture fail on the unresolved C++ getter; this is an old-consumer control, not a complete parent-tree baseline. The fresh build took 209 steps and compiled 187 objects; all 307 actual project source/header inputs match this committed head. Existing source-built ZArchive/zstd archives were reused after rechecking their 78 source/header inputs and archive hashes; no core PRX was imported. The full public-header audit passed (368 umbrellas / 12,192 guest exports), as did three standalone repeated-inclusion/type composition units, registration, conventions and whitespace checks. Socket tests required execution outside the local network-restricted sandbox after ordinary host IPv4/IPv6 sockets also returned `EPERM`; that restricted attempt is retained separately from the successful run. A static merge with main `5b5d24cb223ede690fe5eab1fe2f7a1736b801a5` is clean. That is not a runtime test of the merge. There is no new Windows, full-product or console execution claim for this bridge revision; maintainer full Linux/Windows CI should be rerun on the new head. At that earlier point #9525 was still pending; its later merge and the preserving rebase validated above fulfill that landing order. Historical pre-bridge evidence follows; those earlier direct-link tests did not validate loaded patched Net imports: Historical tested head: `e8a1b7642cf4a4c36704064224f1abe17dab31d5`. Linux x86-64, GCC 16.2.1, Release: **32/32 focused runtime tests pass**, without skips. Built the complete modified `libkernel` and `libSceNet` PRXs plus `libSceNetCtl` through their runtime CMake, and produced patched PRX artifacts. libc/libSceLibcInternal dependencies were freshly rebuilt at the exact base; the modified helper was compiled into this branch's own kernel binary. The IPv6 suite covers existing mapped TCP/UDP traffic and option validation, plus both Net and kernel getters into real shared direct-memory mappings. Mapped capacities 0,1,2,3,4,5,8 and `UINT32_MAX`, alias readback, canaries and read-only pages immediately beyond the exact output ranges check bounded writes and zero-capacity behavior. Existing kernel socket-option and multicast regressions pass. Windows-only regression code uses tracked direct mappings to verify failed `HostWrite::Open()` for read-only value/length outputs, guest `EFAULT`, unchanged outputs on rejection, null kernel output handling and write-watch reporting. These Windows checks were not run by the author on this Linux host; the independent native Windows results are linked below; non-Windows `Open()` always succeeds, so Linux execution does not establish that rejection path. Author-run Windows/macOS/PS5 execution and a monolithic repository build were not performed; the separate Windows report is attributed below. Both canonical umbrella headers compile standalone with repeated inclusion; the full public-header audit passes (368 libraries / 12,192 exports). Conventions and whitespace checks pass. ```sh cmake --build build-review-net/runtime --parallel 2 ctest --test-dir build-review-net/runtime --output-on-failure --parallel 2 python3 core/libs/tests/test_public_headers.py --audit-only python3 tools/check_conventions.py --base origin/main git diff --check ``` An independent [exact-head Windows report](https://github.com/boykopovar/AnyPS5/pull/10949#issuecomment-6399719811) covers `e8a1b7642c` merged onto main `d2b3ee3bcc`, Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7, Release. All 18 targeted Net/socket tests passed both repeated runs, including real IPv6 and the Windows-only read-only value/length rejection and write-watch cases. Its reverted-source control failed the IPv6 feature test. This is reviewer-reported native Windows evidence, separate from the author-run Linux suite and from hosted product CI. Historical private integration with #9525 `ea7109554c` and this head `e8a1b7642c` passed **35/35 focused Linux tests** without skips, including guest_net_socket_state and net_ipv6only. The exact union is `c885fed64f5b84709a416c7b3323ff5d4173ce4f`, based on its actual upstream ancestor `b4d8e8bb3b`. Its libc, libkernel, libSceLibcInternal, Net and NetCtl modules were built from that union, including the modified kernel guards; runtime bindings and hashes were checked. Complete feature/test blocks, upstream protocol/nodelay behavior, canonical headers and debt are preserved. Header, conventions, whitespace and independent peer checks pass. This is a private Linux combination; the earlier Windows report remains scoped to e8a and its reported merge, and the new socket-state direct-output paths are not newly validated on Windows here. Historical private option-dispatch integration additionally passed **42/42 registered Linux tests**, with independent source/runtime peer review, at composition `478e95a54c8c` (tree `0261c6ca38f5`). It combines published Net `e8a1b7642cf4`, NetCtl `e6ac99c16325`, #9525 `ea7109554ca5`, #9515 `00924d8f9f8a` and #9578 `89da0c7455d4`, starting from main `1997e647f93c` and preserving #9578's inherited main `2b5225605bd5`. All five runtime PRXs and the patcher were freshly built from that view. Four private routing cases cover direct Net, Ex-to-Net, kernel forwarding of Net-owned descriptors, and kernel-owned descriptors, including error conversion, bounded/aliased IPv6 outputs, null/capacity rules and preserved V6 callbacks. Header/conventions checks pass. Tests execute ordinary canonical API calls on the actual unpatched libraries; patched artifacts were separately generated. Windows rejected-write subcases were unavailable on Linux, and this is not a full-product, patched-title or console result. The earlier Windows report still covers its exact published E8 source only. This composition does not add dependencies, change the agreed #9525-before-#10949 order, or waive other input authors' prerequisites; that historical composition left the published E8 source unchanged and did not include this bridge revision. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### 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 --> #9525 - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [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
MarcZX10 commented 2026-10-25 11:36:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T11:36:36Z.

Review: CHANGES_REQUESTED


The new sceNetGetsockopt IPv6 path calls GuestSockets::GetIpv6LevelOption, whose Copy() helper writes both optval and *optlen directly. Neither write is covered by GuestArena::HostWrite. The repository's memory-write convention requires a guard over host writes into guest memory; without it, write-watch/shared-backing state is missed and protected guest pages can reject the write. The new test passes ordinary stack buffers, so it does not exercise that contract. Please ensure this entry point (and the shared option helper it invokes) guards the bounded output range and length pointer, returning the expected guest error if a guard cannot be opened, then cover it with a guest-backed output test.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5642992498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10949#pullrequestreview-5642992498). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T11:36:36Z. **Review:** CHANGES_REQUESTED --- The new `sceNetGetsockopt` IPv6 path calls `GuestSockets::GetIpv6LevelOption`, whose `Copy()` helper writes both `optval` and `*optlen` directly. Neither write is covered by `GuestArena::HostWrite`. The repository's [memory-write convention](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) requires a guard over host writes into guest memory; without it, write-watch/shared-backing state is missed and protected guest pages can reject the write. The new test passes ordinary stack buffers, so it does not exercise that contract. Please ensure this entry point (and the shared option helper it invokes) guards the bounded output range and length pointer, returning the expected guest error if a guard cannot be opened, then cover it with a guest-backed output test.
MarcZX10 commented 2026-10-25 13:28:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T13:28:08Z.

Review: APPROVED


Reviewed exact updated head e8a1b7642cf4a4c36704064224f1abe17dab31d5. The Net IPv6 path stages the value and returned length locally, opens both bounded output scopes before either guest store, and maps failed opens to guest EFAULT. The kernel Copy helper now applies the same ordering, and the null-value length reset is guarded. Guest-mapped tests cover aliases, truncation/zero capacity, canaries, read-only adjacent ranges, unchanged outputs on rejection, and Windows write-watch collection.

I ran python3 tools/check_conventions.py --base upstream/main --head HEAD and git diff --check upstream/main...HEAD; both pass. The author reports 32/32 focused Linux tests across the modified Net/kernel runtime builds. Windows-specific rejection/write-watch tests are present but unrun; hosted product jobs are skipped. The requested output-guard gap is fixed, with no remaining blocker found in this scoped change.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5643387259 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10949#pullrequestreview-5643387259). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T13:28:08Z. **Review:** APPROVED --- Reviewed exact updated head `e8a1b7642cf4a4c36704064224f1abe17dab31d5`. The Net IPv6 path stages the value and returned length locally, opens both bounded output scopes before either guest store, and maps failed opens to guest `EFAULT`. The kernel `Copy` helper now applies the same ordering, and the null-value length reset is guarded. Guest-mapped tests cover aliases, truncation/zero capacity, canaries, read-only adjacent ranges, unchanged outputs on rejection, and Windows write-watch collection. I ran `python3 tools/check_conventions.py --base upstream/main --head HEAD` and `git diff --check upstream/main...HEAD`; both pass. The author reports 32/32 focused Linux tests across the modified Net/kernel runtime builds. Windows-specific rejection/write-watch tests are present but unrun; hosted product jobs are skipped. The requested output-guard gap is fixed, with no remaining blocker found in this scoped change.
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!10949
No description provided.