Implement accept4 #2779
All Vouch review confidence checks passed
Residual risk 0.10 = Change Risk (0.32) × (1 − Review Confidence (0.70)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.32 · 23 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.58 · 4 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.190
Real PR Conversation Timeline
6 items
This is a real problem that deserves attention. Among other things, it breaks the network operations for golang binaries via ish.
By the way, a similar PR already exists.
Approved
Approved these changes.
This is a real problem that deserves attention. Among other things, it breaks the network operations for golang binaries via ish.
By the way, a similar PR already exists.
Thanks for pointing that out! I appreciate it.
Thanks. #2752 is earlier and fixes the socketcall path the same way. This one also maps the direct syscall (364), which #2752 leaves as a stub. Either is fine by me; if #2752 goes in, I'll close this one.
Thanks for the clarification! Since your PR also handles the direct syscall (364), it seems to cover a bit more than mine. I’m fine with either approach, so if yours is preferred, feel free to go ahead with it. I’ll close #2752 if yours gets merged.
tjkilgore93-stack
emkey1
accept4is wired tosyscall_stub, so it returns ENOSYS.Go's net package uses it for every accepted connection, which is what #1889 and #2553 both report:
Go has no fallback to plain
accept, so a Go server fails on its first connection.What it does
acceptplus two flags that apply to the accepted fd:SOCK_CLOEXECsetsFD_CLOEXECon it andSOCK_NONBLOCKsetsO_NONBLOCKon it, neither touching the listener. Any other flag is EINVAL. The socketcall entry is filled in to match.Verification
Same static i386 binary run on real Linux and on iSH, over a loopback TCP connection:
| | before | after / real Linux |
|---|---|---|
|
accept4(flags=0)| ENOSYS | connected fd ||
SOCK_CLOEXECsetsFD_CLOEXEC| ENOSYS | set || listener
FD_CLOEXECuntouched | ok | ok ||
SOCK_NONBLOCKsetsO_NONBLOCK| ENOSYS | set || nonblocking accepted fd reads | ENOSYS | EAGAIN |
| peer address filled in | ENOSYS | AF_INET |
| bogus flags | ENOSYS | EINVAL |
Reproduced on the Alpine 3.19.0 rootfs the App Store build downloads (
ROOTFS_URLinapp/iSH.xcconfig), against master 7864dd60.python3from the mirrored 3.19 repo also reaches this path: CPython callsaccept4(SOCK_CLOEXEC)on Linux, and the log showsstub syscall 364on each accept. CPython does fall back to plainaccept()on ENOSYS, so it keeps working; the difference from Go is the fallback, not the call.