Repository navigation
Fix accepting Linux AF_ALG sockets - #9637
Conversation
Assisted-by: OpenAI Codex:model version not exposed
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
The five LinuxKernelCryptoAPI tests passed twice in the hosted Ubuntu job for the AF_ALG accept fix. Remove their obsolete markers through update_lib, preserving all test bodies and platform guards. Assisted-by: OpenAI Codex:model version not exposed
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5acdf3886
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # bpo-31705: On kernel older than 4.5, sendto() failed with ENOKEY, | ||
| # at least on ppc64le architecture | ||
| @unittest.expectedFailure # TODO: RUSTPYTHON; - AF_ALG not fully implemented | ||
| @support.requires_linux_version(4, 5) |
There was a problem hiding this comment.
Retain expected failures on the unfixed Android target
On Android builds where AF_ALG socket creation is permitted, _have_socket_alg() enables this class, but AF_ALG address parsing remains gated to target_os = "linux" in crates/stdlib/src/socket.rs:1765–1766. Consequently, create_alg() still fails at bind() with OSError: bind(): bad family, and removing these decorators converts expected failures into test errors without fixing Android's implementation. Preserve conditional expected failures for that target; AGENTS.md permits removing these annotations only when the tests actually pass.
AGENTS.md reference: AGENTS.md:L280-L281
Useful? React with 👍 / 👎.
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/socket.py dependencies:
dependent tests: (116 tests)
Legend:
|
Summary
Linux AF_ALG rejects
acceptwhen a peer-address buffer is supplied. Useaccept4without an address for this family, returnNoneas the peer address, and atomically set close-on-exec on the accepted descriptor, following CPython 3.15's AF_ALG path. Other families keep the existingaccept_rawpath. The normal socket operation wrapper still handles timeout, signal, and interrupted-call behavior.This is scoped to accepting AF_ALG sockets. It does not change
sendmsg_afalg, complete AF_ALG address parsing, or repair existing concurrent close/reinitialization races. Unlike CPython, this Linux-only path does not fall back toacceptifaccept4returns ENOSYS.Validation
rustfmt,git diff --check, and repository hooks passed.test_socket.LinuxKernelCryptoAPI.test_sha256andtest_hmac_sha1reach this path where AF_ALG and the algorithms are available, but neither directly asserts theNoneaddress, CLOEXEC, or signal/concurrency behavior. Their existing expected-failure markers are intentionally unchanged until exact hosted results establish whether they pass. This can produce an unexpected pass in CI. AES tests also exercisesendmsg_afalg, whose behavior is outside this change.