mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Handle locked pages more robustly (Fixes issue #1462)
Memory locks do not stack, that is, pages which have been locked several times by calls to mlock() will be unlocked by a single call to munlock(). This can result in keying material ending up in swap when those functions are used naively. In this commit a class "LockedPageManager" is added that simulates stacking memory locks by keeping a counter per page.
This commit is contained in:
parent
fedd060d81
commit
e95568b78d
3 changed files with 267 additions and 15 deletions
|
|
@ -86,6 +86,8 @@ void locking_callback(int mode, int i, const char* file, int line)
|
|||
}
|
||||
}
|
||||
|
||||
LockedPageManager LockedPageManager::instance;
|
||||
|
||||
// Init
|
||||
class CInit
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue