[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090721144204.14159.30971.stgit@paris.rdu.redhat.com>
Date: Tue, 21 Jul 2009 10:42:04 -0400
From: Eric Paris <eparis@...hat.com>
To: linux-kernel@...r.kernel.org, selinux@...ho.nsa.gov,
linux-security-module@...r.kernel.org
Cc: sds@...ho.nsa.gov, jmorris@...ei.org, spender@...ecurity.net,
dwalsh@...hat.com, cl@...ux-foundation.org, arjan@...radead.org,
alan@...rguk.ukuu.org.uk, kyle@...artin.ca, cpardy@...hat.com,
arnd@...db.de
Subject: [PATCH 2/2] SELinux: selinux_file_mmap always enforce mapping the 0
page
Currently SELinux enforcement of controls on the ability to map the 0 page
is determined by the mmap_min_addr tunable. This patch causes SELinux to
ignore the tunable and to always (but ONLY) protect the 0 page.
The tunable will now only control the need for CAP_SYS_RAWIO and SELinux
permissions will always protect the 0 page based on it's mmap_zero
permission.
This allows users who need to disable the mmap_min_addr controls (usual reason
being they run WINE as a non-root user) to do so and still have SELinux
controls preventing confined domains (like a web server) from being able to
map the 0 page.
Note: the additional SELinux restriction will now ONLY protect the 0 page.
CAP_SYS_RAWIO will protect anything between 0 and mmap_min_addr, but SELinux
will only protect between 0 and PAGE_SIZE.
Signed-off-by: Eric Paris <eparis@...hat.com>
---
include/linux/security.h | 1 -
security/selinux/hooks.c | 2 +-
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/include/linux/security.h b/include/linux/security.h
index f7d198a..de774f7 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -91,7 +91,6 @@ struct seq_file;
extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
extern int cap_netlink_recv(struct sk_buff *skb, int cap);
-extern unsigned long mmap_min_addr;
/*
* Values used in the task_security_ops calls
*/
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index e65677d..7bbac1d 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3034,7 +3034,7 @@ static int selinux_file_mmap(struct file *file, unsigned long reqprot,
int rc = 0;
u32 sid = current_sid();
- if (addr < mmap_min_addr)
+ if (addr < PAGE_SIZE)
rc = avc_has_perm(sid, sid, SECCLASS_MEMPROTECT,
MEMPROTECT__MMAP_ZERO, NULL);
if (rc || addr_only)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists