3 ms·
With security mindset, "if at all possible do not allow" is the basically the same as "always allow". As mlock / VirtualProtect are OS dependent I strongly sus
by Grollicus 8y ago
With security mindset, "if at all possible do not allow" is the basically the same as "always allow".
As mlock / VirtualProtect are OS dependent I strongly suspect this is not part of Rust itself.
Additionally, I suspect there would be some design problems for example putting this protected thing on the stack (protect the whole stack? Or just parts? Bookkeeping wether a stack lock can be released after a function exits?). How do you move values into / out of such an object?
So I don't think this exists, but I've been pleasantly surprised by Rust before.
My general solution for this case is to either mlockall the whole process if it is small / short-living or to have no swap in the machine, for example long running crypto servers. Who runs servers with swap anyways?
- deleted 8y ago[deleted]