From owner-svn-src-all@FreeBSD.ORG Sat Oct 15 12:39:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4BAD106564A; Sat, 15 Oct 2011 12:39:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 6CF788FC0C; Sat, 15 Oct 2011 12:39:30 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p9FCdOqD065839 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Oct 2011 15:39:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p9FCdNvB046259; Sat, 15 Oct 2011 15:39:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p9FCdNHs046258; Sat, 15 Oct 2011 15:39:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 15 Oct 2011 15:39:23 +0300 From: Kostik Belousov To: Marcel Moolenaar Message-ID: <20111015123923.GY1511@deviant.kiev.zoral.com.ua> References: <201110131620.p9DGKAM2022926@svn.freebsd.org> <20111013190943.GM1511@deviant.kiev.zoral.com.ua> <201110131707.14466.jhb@freebsd.org> <20111013225030.GA75054@zim.MIT.EDU> <20111014182443.GP1511@deviant.kiev.zoral.com.ua> <93156F0C-A80A-4E60-8873-E6269D543973@xcllnt.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9ZjrzBJa11dyYld4" Content-Disposition: inline In-Reply-To: <93156F0C-A80A-4E60-8873-E6269D543973@xcllnt.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r226343 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 15 Oct 2011 12:39:31 -0000 --9ZjrzBJa11dyYld4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 14, 2011 at 02:35:15PM -0700, Marcel Moolenaar wrote: >=20 > On Oct 14, 2011, at 11:24 AM, Kostik Belousov wrote: > >>>=20 > > After more thought about the issue, I do not agree with you. > > Elf specification says about the PF_R flag that only read permission > > for the memory image of the segment is required, but read and execute > > is allowed. >=20 > The ELF specification does not contain CPU specifics. Those are > always covered by processor supplements. Since this is very i386 > specific behaviour we're talking about, it's a non sequitur to > use the generic ELF specification to argue a point in this > respect. This is not quite accurate. The ELF specification does contain the CPU-specific bits for i386. But, the interpretation of the PF_R/PF_X flags in the program header is described under the OS-specific section, and not under the CPU-specific. That is, I am sure that the situation shall be interpreted as the bug in the program. >=20 >=20 > > I want to commit the following refinement: >=20 > The patch is good. Thanks, committed. >=20 > > diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c > > index 669c652..9970386 100644 > > --- a/sys/kern/imgact_elf.c > > +++ b/sys/kern/imgact_elf.c > > @@ -118,11 +118,24 @@ static int elf_legacy_coredump =3D 0; > > SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), CTLFLAG_RW,=20 > > &elf_legacy_coredump, 0, ""); > >=20 > > -static int __elfN(nxstack) =3D 0; > > +static int __elfN(nxstack) =3D > > +#if defined(__amd64__) || defined(__powerpc__) /* both 64 and 32 bit */ > > + 1; > > +#else > > + 0; > > +#endif > > SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, > > nxstack, CTLFLAG_RW, &__elfN(nxstack), 0, > > __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) ": enable non-executable = stack"); >=20 > Please do not commit this change with the rest. It's > not to the point. In fact, if you're changing it to > the above, please add ia64 to the list as well. Yes, sure. The inclusion of the chunk was a mistake. --9ZjrzBJa11dyYld4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6ZfvsACgkQC3+MBN1Mb4jpvgCgr4APjZvroXEDGuQRt6XODUdL YcYAnAg/kUnRybhrmaUdtWqAq/NDa/vH =1Bke -----END PGP SIGNATURE----- --9ZjrzBJa11dyYld4--