[llvm-branch-commits] [libc] [llvm] [libc] Implement fork with the clone3 syscall (PR #242253)

Pavel Labath via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 16 02:06:18 PST 2026


labath wrote:

Maybe this would be a good time to reopen that discussion. The problem with clone3 is that it is not sandbox-friendly. And it's not that it's just too new to be included in the sandbox filters. The problem is that you cannot actually read the `struct clone_args` from a seccomp filter -- typically you want to permit some clone calls (creating a new thread), but not others (creating a new user namespace). This is particularly annoying nowadays, as agents will typically run the test suite in some sort of a sandbox.

AFAICT, the "standard" solution for this is to return ENOSYS, and have the C library catch it, and issue a SYS_clone instead. We could do that too, but it's not what we've been doing so far, and at least in this case, I don't see the advantage of doing that over just issuing a SYS_clone (or SYS_fork) directly...

https://github.com/llvm/llvm-project/pull/242253


More information about the llvm-branch-commits mailing list