[PATCH] LoongArch: Set defaults to exec stack 0.
WANG Xuerui
i.swmail@xen0n.name
Mon Jul 25 09:17:32 GMT 2022
On 2022/7/25 16:35, Andreas Schwab via Binutils wrote:
> On Jul 25 2022, Xi Ruoyao wrote:
>
>> The doc of elf_backend_default_execstack says:
>>
>> /* True if an object file lacking a .note.GNU-stack section
>> should be assumed to be requesting exec stack. At least one
>> other file in the link needs to have a .note.GNU-stack section
>> for a PT_GNU_STACK segment to be created. */
>>
>> So I think it only controls the default behavior of bfd library and is
>> not related to the kernel?
> The kernel always controls the ultimate decision.
>
> It also means that if no input file has a GNU-stack note, no
> PT_GNU_STACK segment is created for the output, in which case the kernel
> default (which is PF_X for loongarch) applies.
>
> The value of DEFAULT_STACK_PERMS in glibc must also agree with the
> kernel.
>
Well, actually the kernel behavior seems to be overlooked during the
upstreaming process. No sane architecture in 2022 should have executable
stacks in the beginning.
We'll fix this before Linux 5.19 is released, fortunately there's the
rc8 giving us the chance. Compatibility should not be a problem, as no
modern program should rely on the incorrect behavior, and the new-world
is still not widely adopted (read: <50 installations worldwide) so any
breakage can be chased down and fixed.
Thanks very much for spotting this.
More information about the Binutils
mailing list