2026-09-19 17:48 UTC
Unix challenge (yes, this is based on a real problem I am staring at right now) (1/2):
You're writing a program to be run in a sandbox. Inside the sandbox, you get only one open fd, a local socket. The filesystem appears totally empty and unwritable. No other processes are observable, and fork will fail. You can't access the network. You can create more local sockets, but you can't bind or connect them. You do not have root privilege (and so you can't call mknod(2)). You will be killed in 50ms.
Replies (1)
-
@zwol@masto.hackers.town 2026-09-19 17:51
(2/2) Under these conditions, is it possible to create an open fd that behaves like it's open O_WRONLY on /dev/null, and _keeps_ working that way after you exit? ("After you exit" is what that one open local socket is for: this is a thought experiment, but if it was actually a coding challenge, you'd prove you've completed the challenge successfully by sending the fake /dev/null fd to whatever's at the other end of that socket.)