svn commit: r343929 - head/sys/vm
Konstantin Belousov
kib at FreeBSD.org
Sat Feb 9 03:56:49 UTC 2019
Author: kib
Date: Sat Feb 9 03:56:48 2019
New Revision: 343929
URL: https://svnweb.freebsd.org/changeset/base/343929
Log:
i386: honor kern.elf32.read_exec for ommap(2) and break(2), as already
done on amd64.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Modified:
head/sys/vm/vm_mmap.c
head/sys/vm/vm_unix.c
Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c Sat Feb 9 03:51:51 2019 (r343928)
+++ head/sys/vm/vm_mmap.c Sat Feb 9 03:56:48 2019 (r343929)
@@ -414,12 +414,10 @@ ommap(struct thread *td, struct ommap_args *uap)
#define OMAP_FIXED 0x0100
prot = cvtbsdprot[uap->prot & 0x7];
-#ifdef COMPAT_FREEBSD32
-#if defined(__amd64__)
+#if (defined(COMPAT_FREEBSD32) && defined(__amd64__)) || defined(__i386__)
if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32) &&
prot != 0)
prot |= PROT_EXEC;
-#endif
#endif
flags = 0;
if (uap->flags & OMAP_ANON)
Modified: head/sys/vm/vm_unix.c
==============================================================================
--- head/sys/vm/vm_unix.c Sat Feb 9 03:51:51 2019 (r343928)
+++ head/sys/vm/vm_unix.c Sat Feb 9 03:56:48 2019 (r343929)
@@ -180,11 +180,9 @@ kern_break(struct thread *td, uintptr_t *addr)
}
#endif
prot = VM_PROT_RW;
-#ifdef COMPAT_FREEBSD32
-#if defined(__amd64__)
+#if (defined(COMPAT_FREEBSD32) && defined(__amd64__)) || defined(__i386__)
if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32))
prot |= VM_PROT_EXECUTE;
-#endif
#endif
rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, 0);
if (rv != KERN_SUCCESS) {
More information about the svn-src-all
mailing list