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 | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
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.