@@ -81,8 +81,33 @@ twophase_commit = false
8181[sandbox ]
8282# Do not allow contestants' solutions to write files bigger than this
8383# size (expressed in KB; defaults to 1 GB).
84+ # Note that this alone isn't secure; solutions can create multiple files
85+ # in the sandbox.
8486max_file_size = 1_048_576
8587
88+ # If these are set, enforce a filesystem quota on sandboxes. Note that:
89+ # (1) The file system that stores isolate boxes (box_root in isolate's
90+ # config file) must have quota accounting enabled (for a tmpfs,
91+ # mounting with the usrquota mount option is sufficient; for ext4,
92+ # run `tune2fs -O quota /dev/sdXY` while unmounted, then mount with
93+ # the usrquota option).
94+ # (2) If you cannot configure disk quotas for some reason (e.g. when
95+ # running a kernel without quota support), you can instead put
96+ # isolate's box_root on a tmpfs; this way, all written files count
97+ # towards the solution's memory usage. In that case, do not set
98+ # these two options.
99+ # (3) This quota is used for all types of sandboxes (including
100+ # compilation and checker runs) and includes all files in the
101+ # sandbox (including inputs, outputs, and the submission executable,
102+ # and files written to /tmp).
103+ # (4) You must set both the size and inode limit.
104+
105+ # This is the maximum size (in kibibytes) of the sandbox's home
106+ # directory (as reported by e.g. `du`).
107+ # fs_quota.kb = 65536
108+ # Maximum number of inodes (i.e. files) in the sandbox's home directory.
109+ # fs_quota.inodes = 1024
110+
86111# Max processes, CPU time (s), memory (KiB) for compilation runs.
87112compilation_sandbox_max_processes = 1000
88113compilation_sandbox_max_time_s = 10.0
0 commit comments