]> err.no Git - linux-2.6/commit
security: Protection for exploiting null dereference using mmap
authorEric Paris <eparis@redhat.com>
Thu, 28 Jun 2007 19:55:21 +0000 (15:55 -0400)
committerJames Morris <jmorris@namei.org>
Thu, 12 Jul 2007 02:52:29 +0000 (22:52 -0400)
commited0321895182ffb6ecf210e066d87911b270d587
tree832bb54666f73b06e55322df40f915c5e9ef64d7
parent13bddc2e9d591e31bf20020dc19ea6ca85de420e
security: Protection for exploiting null dereference using mmap

Add a new security check on mmap operations to see if the user is attempting
to mmap to low area of the address space.  The amount of space protected is
indicated by the new proc tunable /proc/sys/vm/mmap_min_addr and defaults to
0, preserving existing behavior.

This patch uses a new SELinux security class "memprotect."  Policy already
contains a number of allow rules like a_t self:process * (unconfined_t being
one of them) which mean that putting this check in the process class (its
best current fit) would make it useless as all user processes, which we also
want to protect against, would be allowed. By taking the memprotect name of
the new class it will also make it possible for us to move some of the other
memory protect permissions out of 'process' and into the new class next time
we bump the policy version number (which I also think is a good future idea)

Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
13 files changed:
Documentation/sysctl/vm.txt
include/linux/security.h
kernel/sysctl.c
mm/mmap.c
mm/mremap.c
mm/nommu.c
security/dummy.c
security/security.c
security/selinux/hooks.c
security/selinux/include/av_perm_to_string.h
security/selinux/include/av_permissions.h
security/selinux/include/class_to_string.h
security/selinux/include/flask.h