@@ -265,12 +265,25 @@ Limitations
265265* Sandbox isolation is achieved via AppArmor confinement. Codejail facilitates
266266 this, but cannot isolate execution without the use of AppArmor.
267267* Resource limits can only be constrained using the mechanisms that Linux's
268- rlimit makes available. While rlimit can limit the size of any one file that
269- a process can create, and can limit the number of files it has open at any
270- one time, it cannot limit the total number of files written, and therefore
271- cannot limit the total number of bytes written across *all * files.
272- A partial mitigation is to constrain the max execution time. (All files
273- written in the sandbox will be deleted at end of execution, in any case.)
268+ rlimit makes available. Some notable deficiencies:
269+
270+ * While rlimit's ``FSIZE `` can limit the size of any one file that
271+ a process can create, and can limit the number of files it has open at any
272+ one time, it cannot limit the total number of files written, and therefore
273+ cannot limit the total number of bytes written across *all * files.
274+ A partial mitigation is to constrain the max execution time. (All files
275+ written in the sandbox will be deleted at end of execution, in any case.)
276+ * The ``NPROC `` limit constrains the ability of the *current * process to
277+ create new threads and processes, but the usage count (how many processes
278+ already exist) is the sum across *all * processes with the same UID, even in
279+ other containers on the same host where the UID may be mapped to a different
280+ username. This constraint also applies to the app user due to how the
281+ rlimits are applied. Even if a UIDs are chosen so they aren't used by other
282+ software on the host, multiple codejail sandbox processes on the same host
283+ will share this usage pool and can reduce each other's ability to create
284+ processes. In this situation, ``NPROC `` will need to be set higher than it
285+ would be for a single codejail instance taking a single request at a time.
286+
274287* Sandboxes do not have strong isolation from each other. Under proper
275288 configuration, untrusted code should not be able to discover other actively
276289 running code executions, but if this assumption is violated then one sandbox
0 commit comments