From: Lennart Poettering Date: Tue, 16 Nov 2010 02:23:52 +0000 (+0100) Subject: cryptsetup: lock ourselves into memory as long as we deal with passwords X-Git-Tag: v12~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b853f6e9d60c0eab2038227718ee1ed1266f94de;p=systemd cryptsetup: lock ourselves into memory as long as we deal with passwords --- 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;