diff --git a/src/cryptenroll/cryptenroll.c b/src/cryptenroll/cryptenroll.c index b2c291a2bd..ed66b6258f 100644 --- a/src/cryptenroll/cryptenroll.c +++ b/src/cryptenroll/cryptenroll.c @@ -850,7 +850,7 @@ static int run(int argc, char *argv[]) { return r; /* A delicious drop of snake oil */ - (void) mlockall(MCL_FUTURE); + (void) mlockall(MCL_CURRENT|MCL_FUTURE|MCL_ONFAULT); cryptsetup_enable_logging(NULL); diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index e61f4b4606..d18e9fe7d2 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -2582,7 +2582,7 @@ static int verb_attach(int argc, char *argv[], void *userdata) { volume, source, strempty(arg_type), strempty(arg_cipher)); /* A delicious drop of snake oil */ - (void) mlockall(MCL_FUTURE); + (void) mlockall(MCL_CURRENT|MCL_FUTURE|MCL_ONFAULT); if (key_file && arg_keyfile_erase) destroy_key_file = key_file; /* let's get this baby erased when we leave */ diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c index 75872f2eda..e282aa9116 100644 --- a/src/shutdown/shutdown.c +++ b/src/shutdown/shutdown.c @@ -402,7 +402,8 @@ int main(int argc, char *argv[]) { init_watchdog(); /* Lock us into memory */ - (void) mlockall(MCL_CURRENT|MCL_FUTURE); + (void) mlockall(MCL_FUTURE|MCL_ONFAULT); + (void) mlockall(MCL_CURRENT); /* We need to make mounts private so that we can MS_MOVE in unmount_all(). Kernel does not allow * MS_MOVE when parent mountpoints have shared propagation. */