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
This commit is contained in:
Konstantin Belousov 2019-02-09 03:56:48 +00:00
parent a7f67facdf
commit 5dddee2d65
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343929
2 changed files with 2 additions and 6 deletions

View File

@ -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)

View File

@ -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) {