linux-sandbox: allow sendto(NULL, 0) for asyncio self-pipe wakeups#10109
linux-sandbox: allow sendto(NULL, 0) for asyncio self-pipe wakeups#10109etraut-openai wants to merge 7 commits intomainfrom
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Code review feedback from Codex (thanks to @viyatb-oai): Inherited connected sockets could exfiltrate via sendto(NULL,0) Other review notes |
|
FWIW, this also breaks python async code. The |
|
Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
|
Requesting reconsideration on this. I can still reproduce the same problem in the Codex sandbox, and it blocks valid standard Python Minimal repro: import asyncio
async def main():
result = await asyncio.to_thread(lambda: 1)
print(result, flush=True)
asyncio.run(main())
print("done", flush=True)Expected:
Observed in the sandbox:
Observed outside the sandbox:
The lower-level wakeup repro is: import socket
r, w = socket.socketpair()
w.send(b"x")
print("ok")Observed in the sandbox:
Observed outside the sandbox:
Important detail: That matches how CPython selector event loops wake themselves:
So this appears to break a normal Python runtime mechanism, not just a specific framework. Given that Environment:
|
Co-authored-by: Codex noreply@openai.com
544af30 to
d6696b1
Compare
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Fixes a hang in async SQLite / asyncio under no-network sandboxing by allowing sendto only when dest_addr == NULL and addrlen == 0. This permits send()/self-pipe wakeups (e.g., call_soon_threadsafe) while keeping connect/bind/listen/etc. blocked.
Risk assessment:
Addresses #9906