sysctl: require CAP_SYS_RAWIO to set mmap_min_addr
commitc907edc64f5ccc35c81b44fd0444646ba97edfc4
authorKees Cook <kees.cook@canonical.com>
Sun, 8 Nov 2009 17:37:00 +0000 (8 09:37 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:58:16 +0000 (1 15:58 -0700)
treedf962f81b6173507572b6ada5f9ffc8aadea3770
parenta6c4c1c5057d956af87679861f5eeb80c72e3a5e
sysctl: require CAP_SYS_RAWIO to set mmap_min_addr

commit 0e1a6ef2dea88101b056b6d9984f3325c5efced3 upstream.

Currently the mmap_min_addr value can only be bypassed during mmap when
the task has CAP_SYS_RAWIO.  However, the mmap_min_addr sysctl value itself
can be adjusted to 0 if euid == 0, allowing a bypass without CAP_SYS_RAWIO.
This patch adds a check for the capability before allowing mmap_min_addr to
be changed.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
security/min_addr.c