|
|
|
|
|
by etna_ramequin
980 days ago
|
|
You don’t even need unsafe to reproduce unsafe behaviour on Linux.
You can just read and write to `/proc/self` and modify memory arbitrarily.
If you have `std::fs`, then you have `unsafe`, then you’ve got everything. In general, sandboxes don’t work well at the language level. You really need to go at the system level. |
|
Even at the language VM level, it doesn't seem to be tenable.
Microsoft tried to go all out on this back in the day with Code Access Security. I remember three things about it:
1. Engineers/sysadmins would easily get frustrated, and just let the app run under full trust
2. Perf issues, since security demands would result in checking the call stack up
3. When they changed things in .NET 4 a lot of web code would break unless you added a magical attribute.
Needless to say, microsoft more or less gave up on it in .NET core