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 | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | 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.