diff options
author | kib <kib@FreeBSD.org> | 2011-10-15 12:35:18 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2011-10-15 12:35:18 +0000 |
commit | 8e118d38cf6e48ba3629cca5b7d2412a6a37847a (patch) | |
tree | 10ce3b912b307ff0aab5766c25781e0abda0ab10 /sys/compat/freebsd32/freebsd32_misc.c | |
parent | a4fb38841fe96fae9a2afe75cc7c7c3d67b4488d (diff) | |
download | FreeBSD-src-8e118d38cf6e48ba3629cca5b7d2412a6a37847a.zip FreeBSD-src-8e118d38cf6e48ba3629cca5b7d2412a6a37847a.tar.gz |
Control the execution permission of the readable segments for
i386 binaries on the amd64 and ia64 with the sysctl, instead of
unconditionally enabling it.
Reviewed by: marcel
Diffstat (limited to 'sys/compat/freebsd32/freebsd32_misc.c')
-rw-r--r-- | sys/compat/freebsd32/freebsd32_misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 6638ec8..fc2932b 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -445,7 +445,7 @@ freebsd32_mprotect(struct thread *td, struct freebsd32_mprotect_args *uap) ap.len = uap->len; ap.prot = uap->prot; #if defined(__amd64__) || defined(__ia64__) - if (ap.prot & PROT_READ) + if (i386_read_exec && (ap.prot & PROT_READ) != 0) ap.prot |= PROT_EXEC; #endif return (sys_mprotect(td, &ap)); @@ -536,7 +536,7 @@ freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap) #endif #if defined(__amd64__) || defined(__ia64__) - if (prot & PROT_READ) + if (i386_read_exec && (prot & PROT_READ)) prot |= PROT_EXEC; #endif |