From owner-svn-src-all@freebsd.org Sat Feb 9 03:56:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AD6014D55A4; Sat, 9 Feb 2019 03:56:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAE0582F97; Sat, 9 Feb 2019 03:56:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEAE92326E; Sat, 9 Feb 2019 03:56:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x193umoF048000; Sat, 9 Feb 2019 03:56:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x193umxU047998; Sat, 9 Feb 2019 03:56:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902090356.x193umxU047998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 Feb 2019 03:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343929 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAE0582F97 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2019 03:56:49 -0000 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) {