feat(net): store DNS servers set through sceNetSetDnsInfo and sceNetSetDns6Info #9506
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9506"
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 Noxy-HNR on 2026-10-21T23:46:25Z.
What
Converts
sceNetSetDnsInfo,sceNetSetDns6InfoandsceNetGetDns6InfofromNotImplemented_nid_no_patch:sceNetSetDnsInfoandsceNetSetDns6Infocopy the info through the checked guest read (GuestSockets::ReadGuest) and store the given DNS servers; an unreadable info answersEFAULT, a null info clears them, and a zero primary server or nonzero flags answerEINVAL.sceNetGetDnsInforeports the stored IPv4 servers once some are set and the host's servers otherwise.sceNetGetDns6Inforeports the stored IPv6 servers, or none, and returns the server count; a null info or nonzero flags answerEINVALon both getters, as measured on firmware 13.42 (BunnyFl's check in this thread). Every DNS call answersENOTINITbeforesceNetInit.The resolver keeps using the host's servers: the stored servers are only reported back by the two getters, and
docs/dev/debt/libSceNet.mdrecords that gap. The argument checks and counts follow shadPS4's net.cpp; they are not measured on a console and are recorded indocs/dev/debt/libSceNet.md. libSceNet goes from 64/223 to 67/223 intools/progress.py.Tested
Windows 11 26H2 (build 10.0.26300, WinLibs GCC 15.2.0 r7, full Release build), head e2dd1a1 rebased onto main
9b1ed88:guest_net_dns_info(IPv4 and IPv6 set, get, clear and argument checks,EFAULTwith the stored servers kept for an unreadable non-null info, andsceNetGetDns6Infothrowing for nonzero flags and a null info) andguest_sce_net(including its IPv6 socket checks) pass, 2/2.tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.tools/pr_overlap.pyreports no shared lines or exports with other open pull requests; it lists only shared files it could not compare because those pull requests conflict withmain. An earlier Linux run (Ubuntu 24.04, GCC 13.3, Release) of 13d0c80 on mainab347d1passedguest_net_dns_infoandguest_sce_net'ssceNetGetDnsInfochecks. No title tested.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T00:50:22Z.
Review: CHANGES_REQUESTED
The repo's overlap rule says that when the overlap report identifies open PRs changing the same lines or exports, authors must agree which lands first and the PR must declare that order with
Depends on.I checked the current open libSceNet PRs against this branch. Pairwise merge attempts report content conflicts in
Export.cppand/ordocs/dev/debt/libSceNet.mdwith #5836, #8204, #8225, #8232, #8234, #8235, #8254 and #8362. The DNS test registration also shares the libSceNet CMake insertion area changed by #5836/#8254 and the test reorganization in #6044. Several of the function changes are conceptually separate, but the overlap rule still requires coordinating their landing order and recording any prerequisite in the checklist.Please contact the affected authors to agree on the order, update
Depends onto list the agreed prerequisites (ornoneif they confirm this PR can land first), and rerun the overlap/conventions checks after updating. I’m requesting changes only for this missing coordination record; the current eligibility, conventions, intake, labels and report checks pass. Linux, Windows, relinker and sanitizer product jobs are skipped for this PR, so they provide no hosted build result here. The PR reports the Ubuntu DNS test and conventions/test-registration checks; I have not rerun a local build.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:06:57Z.
Review: CHANGES_REQUESTED
The DNS state behavior is localized and the author accurately records that console semantics are unverified, but there is a guest-pointer safety gap in the new setters.
sceNetSetDnsInfodereferencesinfo->primaryAddressand later copies*info;sceNetSetDns6Inforeadsinfo->primaryAddressand copies*infodirectly. These are guest pointers, so an invalid non-null address can fault the host process instead of returning a guest error. The new tests cover null and value checks, but not unreadable non-null inputs. Please copy/probe these structures through the project’s guest-memory-safe mechanism before reading them, preserve the existing error behavior on invalid pointers, and add a regression for an unreadable non-null pointer. I did not run local tests. Separately, the required coordination/order for overlapping libSceNet export/debt/CMake/test edits is still unresolved; please record agreed predecessors or author-confirmednonebefore merge.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:07:11Z.
I reviewed the three new DNS functions and found a guest-pointer safety concern: both setters read fields through
infoand copy*infodirectly after only checking null. Please validate/copy from guest memory safely and cover an unreadable non-null input in the regression test. I also checked the current overlap report: #5836, #6044, #6879, #7201, #8204, #8225, #8232, #8234, #8235, #8254, and #8362 touch shared files (some are broad/base-conflicted warnings). I asked the relevant authors to identify exact overlaps and confirm ordering; please updateDepends on/the overlap note based on those replies rather than leave the blanketnoneuntil that check is resolved.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:22:24Z.
Review: DISMISSED
Correction to my earlier pointer-safety finding: the current head copies both non-null input structures through
GuestSockets::ReadGuestbefore inspecting them, andGuestNetDnsInfo.cppnow includes unreadable-page regression cases. That resolves the host-fault concern; I withdraw it.Two items remain before merge:
Depends on: none, and there is no author coordination recorded. Please compare the exact hunks, agree landing order with affected authors wherever ordering is required, declare prerequisites, and refresh the overlap check.6ef5a1c4, while current upstream main isc61d20f54801efc3798555829f6fedcff71ad7ff. Please update the branch and rerun the focused DNS/pointer test, conventions and overlap checks on current main.The current hosted eligibility, conventions, labels and report checks pass; product/relinker jobs are skipped. I did not rerun local tests. No remaining pointer-safety defect is claimed.
Imported from boykopovar/AnyPS5. Originally posted by Noxy-HNR on 2026-10-22T04:52:34Z.
Overlap check for reviewers, on head 13d0c80 and current
main(17f5335):I merge-tested this branch against the 53 open PRs that touch the libSceNet
Export.cpp,CMakeLists.txtor debt file,SocketRuntime.hpporUdp.cppin libkernel, or the new test. 41 of them merge cleanly with bothmainand this branch, including #9523, #9525, #9542, #9543 and #9544. The other 12 already conflict withmain. For 9 of those the conflicts are identical with and without this branch. #8234, #8235 and #8362 are on older bases, and their existing conflicts gain a few adjacent lines (thesceNetGetDnsInfodebt entry, and for #8362 thesceNetSetDns6Infobody next to its old stub). None of the three changes DNS code, and each needs a rebase ontomainregardless.No other open PR implements or changes
sceNetSetDnsInfo,sceNetSetDns6Info,sceNetGetDns6InfoorsceNetGetDnsInfo. #8463 also edits the staticReadGuestinUdp.cppthatGuestSockets::ReadGuestforwards to. Merged with this branch, the file has one definition and a matching declaration, so neither PR breaks the other.tools/pr_overlap.pylists only shared files it could not compare because those PRs conflict withmain. Depends on stays none.Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T13:24:55Z.
Review: COMMENTED
Checked against main
830ccd121fand shadPS4 net.cpp at 0918faa0255e9816b795b62c9b09eaea51a1bc5e (L1343-1400):NetDnsInfo/NetDns6Info(Export.cpp:199-213). The set/get round trip, clear-on-null and counts match the pinned shadPS4 code, and the singleg_dnsLockcovers every access. Thanks for the careful port.g_dnsOverride/g_dns6Overrideat Export.cpp:2393 and :2621). Every lookup still goes through host::getaddrinfo/::getnameinfo(main Export.cpp:2051-2058, :2162). SosceNetSetDnsInfo({8.8.8.8, 0}, 0)returns success, butsceNetResolverStartNtoakeeps querying the host's servers. CONTRIBUTING.md only allows a success that doesn't do the work as a silent stub that unblocks a title and only affects the UI, listed under "Silent stubs". HereUnblocksis none and the debt entry sits under "Functional". Would you consider keeping the two setters onNotImplemented_nid_no_patchuntil a title needs them (or until the resolver uses the stored servers), or else moving the entry to Silent stubs with the title it unblocks?sceNetGetDnsInfothrows for nonzero flags and for a null info because the console results are unknown (Export.cpp:2370-2371). The newsceNetGetDns6InforeturnsNET_EINVALfor the same unmeasured inputs, taken from shadPS4. It might be worth handling both getters the same way, either both throwing or both following shadPS4 with the source cited in the debt entry.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.