fix(libkernel): reject 0.0.0.0/8 multicast interface addresses on every host #26806
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/26806"
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 Romannachwievor on 2026-11-24T22:43:58Z.
What
guest_socket_optionsfails on macOS since #25533:a 0.0.0.0/8 address other than INADDR_ANY must fail IP_MULTICAST_IF with EADDRNOTAVAIL (49) (errno 22). #25533 addedZeroNetworkAddressand its twoEADDRNOTAVAILchecks inSocketOptions.cppinside#ifdef _WIN32, while the new test cases expectEADDRNOTAVAILon every host, as FreeBSD 11.4 answers when no interface has the address. A Linux host returns that error itself, but a macOS host answersEINVALand the emulator passes it through. Main CI has no macOS job that builds the libraries (#24117), so the failure was not caught there.This removes the three
#ifdef _WIN32guards, soIP_MULTICAST_IF,IP_ADD_MEMBERSHIPandIP_DROP_MEMBERSHIPreject an interface address in 0.0.0.0/8 other than0.0.0.0before the host sees it, on every host. The Windows path is unchanged. The debt entry infix-libkernel-ip-multicast-if-mreqn.mdnow says "on every host" instead of "on Windows".pr_overlap.py --names SetIpLevelOption ZeroNetworkAddressfound no open PR.--branchcould not compare four open PRs that also changeSocketOptions.cppand conflict withmain; their hunks are elsewhere in the file: #12688, #12700 and #12965 changeSetSocketLevelOption(around line 239), #18108 the includes andReadValue(lines 15 and 166). None touches the multicast checks at lines 437-500.Tested
Apple M1, macOS 26.5, x86_64 Release under Rosetta 2,
main61cce6e86bplus #17425, #11049 and #26739, which a macOS full build needs.ctest --test-dir build -R '^guest_socket_options$' --output-on-failure, serial:main: 0 of 3 passed, each at theIP_MULTICAST_IFcheck with errno 22.IP_MULTICAST_IFcheck removed: 0 of 3, atmust fail IP_MULTICAST_IF. Mutation, membership check removed: 0 of 3, atmust fail IP_ADD_MEMBERSHIP.ctest -R '^guest_(socket|udp|tcp|net|sce_net|multicast)' -j4with this change: 61 of 64 passed. The three failures,guest_sce_net,guest_udpandguest_socket_port_zero, fail onmaintoo and have owners (#22623, #25134, #17878).These runs used commit
f7178d0241. Head91cbf540f9only merges 23 latermaincommits, none of which touchcore/libs/prx/libkernel/Socket, the test or the debt files.Linux and Windows were not run locally. On Linux the outcome stays
EADDRNOTAVAIL, now from the emulator instead of the host; the Windows code path does not change.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)AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T02:36:59Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed multicast checks match the stated behavior, and the review found no verified blocking defect.
What I ran
Reviewed head
91cbf540f9e02cc932086e6b8e7b6fce80785aa. I read the prepared description, commits, manifest, diff, and both changed files at the pinned head; I usedrepo_read.pyto search callers. I did not run tests or build commands.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
The changed code rejects nonzero IPv4 addresses in
0.0.0.0/8before the hostsetsockoptcall for multicast interface selection and membership changes. The diff removes the platform guards around those checks. The debt note now describes the behavior as applying on every host.Not verified
Builds and tests were not run during this review. The reported macOS test results in the PR description were not independently verified. Both changed files were read; the manifest lists no excluded changed files.
To get this to a good state
Nothing is required. The PR description reports passing macOS tests and mutation checks; those results were not independently run in this review.
Imported from boykopovar/AnyPS5. Originally posted by NobleBrains on 2026-12-01T00:22:01Z.
Review: APPROVED
Confirmed on macOS 15.
Setup: Apple M4, macOS 15.7.9, Apple clang 17.0.0 (clang-1700.6.3.2), x86_64 Release under Rosetta,
BUILD_TESTING=ON. These are the OS and compiler generation of themacos-15runner.Tree:
main93d64f2d1e+ the open macOS build fixes #27201, #27739, #27843, #17425, #27827, #27767 (maindoes not build on macOS without them, see #28168), + #22091, #28369, #28075, #28076, #28284, then #17878, #20161, #25134, #26806, #22932, #28373, #27828, #27950, #27582, #24311 merged one after another. All merged cleanly.guest_socket_options91cbf540f9Full
ctest -j 6after all of them: 7047/7066 pass. Compared with the run before the second group of merges, no test fails that passed before.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T14:03:21Z.
Review: COMMENTED
Compiled this head's socket-options translation unit and ran a focused Linux IPv4 UDP check.
IP_MULTICAST_IFacceptedINADDR_ANYand returned guestEADDRNOTAVAILfor0.0.0.1. Membership add and drop also returned guestEADDRNOTAVAILfor that interface, and the recorded interface and memberships stayed at their defaults. The Linux probe used a local socket.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.