From 9aba2c1e6c6e35bc2d46cbd51e7b3fe65375400f Mon Sep 17 00:00:00 2001 From: Scott Balneaves Date: Wed, 17 Feb 2016 19:13:32 -0600 Subject: [PATCH] *SECURITY* Make sure we don't swap out (cherry picked from commit e4b226b) --- src/lightdm-webkit2-greeter.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lightdm-webkit2-greeter.c b/src/lightdm-webkit2-greeter.c index 436b8fa..cbc4f24 100644 --- a/src/lightdm-webkit2-greeter.c +++ b/src/lightdm-webkit2-greeter.c @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -201,6 +202,13 @@ main(int argc, char **argv) { WebKitWebContext *context; GtkCssProvider *css_provider; + /* + * Prevent memory from being swapped out, since we see unencrypted + * passwords. + */ + mlockall (MCL_CURRENT | MCL_FUTURE); + + /* Initialize i18n */ setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");