diff options
author | Kurt Garloff <garloff@suse.de> | 2008-10-29 17:00:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-30 14:38:45 -0400 |
commit | 0833422274ff00729a603b020fac297e69a03e40 (patch) | |
tree | 5b2f28bc0854a9e3a43eef424a761a2235f756bb /include/linux/resource.h | |
parent | e946217e4fdaa67681bbabfa8e6b18641921f750 (diff) |
mm: increase the default mlock limit from 32k to 64k
By default, non-privileged tasks can only mlock() a small amount of
memory to avoid a DoS attack by ordinary users. The Linux kernel
defaulted to 32k (on a 4k page size system) to accommodate the needs of
gpg.
However, newer gpg2 needs 64k in various circumstances and otherwise
fails miserably, see bnc#329675.
Change the default to 64k, and make it more agnostic to PAGE_SIZE.
Signed-off-by: Kurt Garloff <garloff@suse.de>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/resource.h')
-rw-r--r-- | include/linux/resource.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/resource.h b/include/linux/resource.h index aaa423a6f3d9..40fc7e626082 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
@@ -59,10 +59,10 @@ struct rlimit { | |||
59 | #define _STK_LIM (8*1024*1024) | 59 | #define _STK_LIM (8*1024*1024) |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * GPG wants 32kB of mlocked memory, to make sure pass phrases | 62 | * GPG2 wants 64kB of mlocked memory, to make sure pass phrases |
63 | * and other sensitive information are never written to disk. | 63 | * and other sensitive information are never written to disk. |
64 | */ | 64 | */ |
65 | #define MLOCK_LIMIT (8 * PAGE_SIZE) | 65 | #define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024) |
66 | 66 | ||
67 | /* | 67 | /* |
68 | * Due to binary compatibility, the actual resource numbers | 68 | * Due to binary compatibility, the actual resource numbers |