5 ms·
On most platforms, mlock(2) and mlockall "lock" data in memory, theoretically preventing it from being paged to disk. OpenSSL provides hooks for adding a custo
by bri3d 15y ago
On most platforms, mlock(2) and mlockall "lock" data in memory, theoretically preventing it from being paged to disk.
OpenSSL provides hooks for adding a custom allocator which uses mlock, and some of its interfaces allow for the app to allocate its own key space and pass pointers (hence theoretically allowing the app itself to use mlock or whatever platform-specific method of allocating "safe" memory is desired).
However, this attack vector is often overlooked and is very commonly exploitable - FileVault and the Login Window on OSX were vulnerable to this brand of attack last I checked. The easiest workaround is to use encrypted swap (and the linked project would be a perfect way to encrypt swap in a way that's not vulnerable to a cold boot attack).