How does codeforces run codes safely?
I mean like:
- Preventing system calls
- Allocating resources and time
- Preventing connections
- Isolating the process from the server
And what is the best way to do this?
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
How does codeforces run codes safely?
I mean like:
And what is the best way to do this?
Name |
---|
I think they use any sort of sandbox.
Yes they do. There was one issue with the sandbox permissions some months ago but as far as I know it is now fixed. If you find anything just send a message to Mike, he's so cooperative and will work with you on fixing whatever you find (it's his platform after all) ^^
Depending on the platform you will have to customize a lot of stuff if you intend to run untrusted code of that many languages. The most basic way on windows is using the system user permissions as a layer for isolating processes. It's easier/harder depending on the language and the compiler dependencies and it's always a possibility that you can break out if you're creative enough. So one thing ppl do is making sure that breaking out is still controllable and not going to induce severe damage to the systems.