[PATCH 1/1] UBUNTU: SAUCE: mmap_min_addr check CAP_SYS_RAWIO only for write

Andy Whitcroft apw at canonical.com
Tue May 4 16:45:40 UTC 2010

From: Kees Cook <kees.cook at canonical.com>

Redirecting directly to lsm, here's the patch discussed on lkml:

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.

BugLink: http://bugs.launchpad.net/bugs/568844
Signed-off-by: Kees Cook <kees.cook at canonical.com>
Acked-by: Serge Hallyn <serue at us.ibm.com>
Signed-off-by: James Morris <jmorris at namei.org>
Signed-off-by: Andy Whitcroft <apw at canonical.com>
 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 fc43c9d..d9f9425 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,
 	int ret;
-	if (!capable(CAP_SYS_RAWIO))
+	if (write && !capable(CAP_SYS_RAWIO))
 		return -EPERM;
 	ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);

More information about the kernel-team mailing list