diff options
author | Kees Cook <kees.cook@canonical.com> | 2010-04-22 15:19:17 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-05-14 05:03:15 -0400 |
commit | 4ae69e6b718589abe97c9625ccbb1e0bc95a8c0e (patch) | |
tree | b669aade412fd2a81af6c9a7c0bcee580c7b31cb | |
parent | 6a251b0ab67989f468f4cb65179e0cf40cf8c295 (diff) |
mmap_min_addr check CAP_SYS_RAWIO only for write
Redirecting directly to lsm, here's the patch discussed on lkml:
http://lkml.org/lkml/2010/4/22/219
The mmap_min_addr value is useful information for an admin to see without
being root ("is my system vulnerable to kernel NULL pointer attacks?") and
its setting is trivially easy for an attacker to determine by calling
mmap() in PAGE_SIZE increments starting at 0, so trying to keep it private
has no value.
Only require CAP_SYS_RAWIO if changing the value, not reading it.
Comment from Serge :
Me, I like to write my passwords with light blue pen on dark blue
paper, pasted on my window - if you're going to get my password, you're
gonna get a headache.
Signed-off-by: Kees Cook <kees.cook@canonical.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
(cherry picked from commit 822cceec7248013821d655545ea45d1c6a9d15b3)
-rw-r--r-- | security/min_addr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/min_addr.c b/security/min_addr.c index e86f297522bf..f728728f193b 100644 --- a/security/min_addr.c +++ b/security/min_addr.c | |||
@@ -33,7 +33,7 @@ int mmap_min_addr_handler(struct ctl_table *table, int write, | |||
33 | { | 33 | { |
34 | int ret; | 34 | int ret; |
35 | 35 | ||
36 | if (!capable(CAP_SYS_RAWIO)) | 36 | if (write && !capable(CAP_SYS_RAWIO)) |
37 | return -EPERM; | 37 | return -EPERM; |
38 | 38 | ||
39 | ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos); | 39 | ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos); |