From b853f6e9d60c0eab2038227718ee1ed1266f94de Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 16 Nov 2010 03:23:52 +0100 Subject: [PATCH] cryptsetup: lock ourselves into memory as long as we deal with passwords --- src/cryptsetup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cryptsetup.c b/src/cryptsetup.c index c007b87c..c103aa9e 100644 --- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -21,6 +21,7 @@ #include #include +#include #include @@ -181,6 +182,9 @@ int main(int argc, char *argv[]) { if (argc >= 6 && argv[5][0] && !streq(argv[5], "-")) parse_options(argv[5]); + /* A delicious drop of snake oil */ + mlockall(MCL_FUTURE); + if ((k = crypt_init(&cd, argv[3]))) { log_error("crypt_init() failed: %s", strerror(-k)); goto finish; -- 2.39.5