From owner-svn-src-all@FreeBSD.ORG Fri Oct 14 21:35: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 2F605106566B; Fri, 14 Oct 2011 21:35:30 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id E8C938FC13; Fri, 14 Oct 2011 21:35:29 +0000 (UTC) Received: from [172.23.7.198] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id p9ELZKsi035875 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 14 Oct 2011 14:35:28 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20111014182443.GP1511@deviant.kiev.zoral.com.ua> Date: Fri, 14 Oct 2011 14:35:15 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <93156F0C-A80A-4E60-8873-E6269D543973@xcllnt.net> 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> To: Kostik Belousov X-Mailer: Apple Mail (2.1244.3) 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: Fri, 14 Oct 2011 21:35:30 -0000 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. 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. > I want to commit the following refinement: The patch is good. > 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"); 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. --=20 Marcel Moolenaar marcel@xcllnt.net