Page MenuHomeFreeBSD

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

Authored by brooks on Apr 19 2024, 10:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 17, 6:39 PM
Unknown Object (File)
Dec 9 2024, 4:26 AM
Unknown Object (File)
Nov 1 2024, 8:13 PM
Unknown Object (File)
Oct 24 2024, 4:45 AM
Unknown Object (File)
Oct 24 2024, 4:36 AM
Unknown Object (File)
Oct 4 2024, 11:06 PM
Unknown Object (File)
Oct 3 2024, 11:04 PM
Unknown Object (File)
Oct 2 2024, 9:24 AM
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 Not Applicable
Unit
Tests Not Applicable

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.Apr 19 2024, 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?

This revision was automatically updated to reflect the committed changes.