svn commit: r239577 - stable/9/sys/vm
Konstantin Belousov
kib at FreeBSD.org
Wed Aug 22 19:34:03 UTC 2012
Author: kib
Date: Wed Aug 22 19:34:02 2012
New Revision: 239577
URL: http://svn.freebsd.org/changeset/base/239577
Log:
MFC r239250:
For old mmap syscall, when executing on amd64 or ia64, enforce the
PROT_EXEC if prot is non-zero, process is 32bit and
kern.elf32.i386_read_exec syscal is enabled.
Modified:
stable/9/sys/vm/vm_mmap.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/vm/vm_mmap.c
==============================================================================
--- stable/9/sys/vm/vm_mmap.c Wed Aug 22 19:31:28 2012 (r239576)
+++ stable/9/sys/vm/vm_mmap.c Wed Aug 22 19:34:02 2012 (r239577)
@@ -454,6 +454,13 @@ ommap(td, uap)
nargs.addr = uap->addr;
nargs.len = uap->len;
nargs.prot = cvtbsdprot[uap->prot & 0x7];
+#ifdef COMPAT_FREEBSD32
+#if defined(__amd64__) || defined(__ia64__)
+ if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32) &&
+ nargs.prot != 0)
+ nargs.prot |= PROT_EXEC;
+#endif
+#endif
nargs.flags = 0;
if (uap->flags & OMAP_ANON)
nargs.flags |= MAP_ANON;
More information about the svn-src-stable
mailing list