[RFC] Enable nxstack by default

Garrett Cooper yanegomi at gmail.com
Tue Oct 18 15:44:40 UTC 2011


On Tue, 18 Oct 2011, Arnaud Lacombe wrote:

> Hi,
>
> On Tue, Oct 18, 2011 at 5:07 AM, Kostik Belousov <kostikbel at gmail.com> wrote:
>> On Mon, Oct 17, 2011 at 09:30:56PM +0200, Oliver Pinter wrote:
>>> Hi all!
>>>
>>> I think, it's the time to enable the nxstack feature. Any comments,
>>> pros, cons?
>>
>> I dragged the change long enough for it to miss the 9.0.
>> After the 9.0 is released, I will flip the switch with the following
>> change.
>>
>> diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
>> index 8455f48..926fe64 100644
>> --- a/sys/kern/imgact_elf.c
>> +++ b/sys/kern/imgact_elf.c
>> @@ -118,7 +118,12 @@ static int elf_legacy_coredump = 0;
>>  SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), CTLFLAG_RW,
>>     &elf_legacy_coredump, 0, "");
>>
>> -static int __elfN(nxstack) = 0;
>> +int __elfN(nxstack) =
>> +#if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */
>>
> Why leaving 32bits x86 CPU supporting the NX feature behind ?

Most likely because it was assumed that i386 doesn't fully support it. 
According to ye great Wikipedia, NX support didn't roll into i386 until 
Prescott, which was pretty late in the non-64-bit capable family of CPUs, 
as its successor -- Conroe -- was 64-bit. Intel detuned some of the early 
Dual Core Pentiums, e.g. the Yonahs to not talk 64-bit. Not sure about 
AMD.

There are probably more details in binutils, gcc, etc, that I'm missing 
and Kostik can expound on.

-Garrett


More information about the freebsd-current mailing list