Page MenuHomeFreeBSD

lib{c,sys}: .note.GNU-stack in syscall stubs
AcceptedPublic

Authored by brooks on Fri, Apr 19, 10:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 30, 8:22 AM
Unknown Object (File)
Mon, Apr 29, 5:02 PM
Unknown Object (File)
Mon, Apr 22, 6:54 PM
Subscribers

Details

Summary

Explicitly disable executable stacks in the syscall stubs on all
architectures. Previously, aarch64 and riscv64 didn't include the
.note.GNU-stack note due to an apparent oversight and it being opt-in.

This appears to have been harmless in practice, but better to be clear
in case a different compiler/linker has different defaults.

Reported by: jrtc27

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57241
Build 54129: arc lint + arc unit

Event Timeline

Does it matter/used on arm64 and risc-v? I remember that psABIs require nx stack always for them. It might be that some (old ?) linker complained about the note on these arches.

This revision is now accepted and ready to land.Fri, Apr 19, 10:47 PM
In D44883#1023197, @kib wrote:

Does it matter/used on arm64 and risc-v? I remember that psABIs require nx stack always for them. It might be that some (old ?) linker complained about the note on these arches.

GCC nested functions require an executable stack, but I believe the default is NX?