d/scripts/suspend/suspend.c: Allocate and lock memory for later usage
We have to allocate and lock memory for later usage by LUKS resume before we LUKS suspend the devices. Otherwise, LUKS resume processes might cause the system to swap out later, especially in case of LUKS2 devices with argon2i as PBKDF. Swapping out at LUKS resume state would result in deadlocks if the storage holding swap is suspended. See the discussion in Gitlab issue #19 for further information: #19 Besides the mlock(2) and malloc(2) manpages, the following documentation was helpful for a better understanding of mlock: * https://eklitzke.org/mlock-and-mlockall * https://www.informit.com/articles/article.aspx?p=23618&seqNum=9
Loading