security: allow capable check to permit mmap or low vm space
Subsystems (2)
PATCH 1/1 security: allow capable check to permit mmap or low vm space
On a kernel with CONFIG_SECURITY but without an LSM which implements security_file_mmap it is impossible for an application to mmap addresses lower than mmap_min_addr. Based on a suggestion from a developer in the openwall community this patch adds a check for CAP_SYS_RAWIO. It is assumed that any process with this capability can harm the system a lot more easily than writing some stuff on the zero page and then trying to get the kernel to trip over itself. It also means that programs like X on i686 which use vm86 emulation can work even with mmap_min_addr set.
---
security/dummy.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
security/dummy.c +1 -1
@@ -426,7 +426,7 @@ static int dummy_file_mmap (struct file *file, unsigned long reqprot, unsigned long addr, unsigned long addr_only) { -if (addr < mmap_min_addr) +if ((addr < mmap_min_addr) && !capable (CAP_SYS_RAWIO ))return -EACCES ;return 0 ; }
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
James Morris
maintainerQuoted 10 lines · Eric Paris
On a kernel with
CONFIG_SECURITYbut without an LSM which implementssecurity_file_mmapit is impossible for an application to mmap addresses lower thanmmap_min_addr. Based on a suggestion from a developer in the openwall community this patch adds a check forCAP_SYS_RAWIO. It is assumed that any process with this capability can harm the system a lot more easily than writing some stuff on the zero page and then trying to get the kernel to trip over itself. It also means that programs like X on i686 which use vm86 emulation can work even withmmap_min_addrset.Signed-off-by Eric Paris <[email protected]>
Applied togit://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6.git#for-akpm
If nobody hollers, I'll push it to Linus when the next merge window opens.
- James
Signature · 7 lines
James Morris <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.