* [PATCH 3/3-v2] security: allow capable check to permit mmap or low vm space
@ 2007-11-26 23:47 Eric Paris
2007-11-27 0:38 ` James Morris
0 siblings, 1 reply; 2+ messages in thread
From: Eric Paris @ 2007-11-26 23:47 UTC (permalink / raw)
To: linux-kernel; +Cc: jmorris, sds, selinux, alan, chrisw, hpa, akpm
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.
Signed-off-by: Eric Paris <eparis@redhat.com>
---
security/dummy.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/security/dummy.c b/security/dummy.c
index 6d895ad..3ccfbbe 100644
--- a/security/dummy.c
+++ b/security/dummy.c
@@ -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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/3-v2] security: allow capable check to permit mmap or low vm space
2007-11-26 23:47 [PATCH 3/3-v2] security: allow capable check to permit mmap or low vm space Eric Paris
@ 2007-11-27 0:38 ` James Morris
0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2007-11-27 0:38 UTC (permalink / raw)
To: Eric Paris; +Cc: linux-kernel, sds, selinux, alan, chrisw, hpa, akpm
On Mon, 26 Nov 2007, Eric Paris wrote:
> 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.
>
> Signed-off-by: Eric Paris <eparis@redhat.com>
Applied to
git://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
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-27 0:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-26 23:47 [PATCH 3/3-v2] security: allow capable check to permit mmap or low vm space Eric Paris
2007-11-27 0:38 ` James Morris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox