Page MenuHomeFreeBSD

Limit the use of stack clash protection and zeroregs based upon compiler features
ClosedPublic

Authored by netchild on Thu, Jan 30, 9:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Feb 11, 4:44 PM
Unknown Object (File)
Mon, Feb 10, 9:06 PM
Unknown Object (File)
Sun, Feb 9, 7:42 PM
Unknown Object (File)
Sat, Feb 8, 4:03 PM
Unknown Object (File)
Thu, Feb 6, 12:54 AM
Unknown Object (File)
Fri, Jan 31, 12:16 PM
Subscribers

Details

Summary
  • switch unconditional use of stack clash protection into a compiler feature
  • limit the use of stack clash protection on unsupported architectures (I did not wade into the source of each compiler to determine when support arrived for each architecture, I used the compiler version when it was introduced with what is supported currently)
  • add a safeguard for stack clash protection in places where we have no SSP provisions (we may not need it, but better safe than sorry when something changes or is overridden by the user)
  • limit the use of zeroregs the same way, so that even specifying it will not lead to build failures (useful for universe builds when WITH_ZEROREGS is specified in src.conf)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

For any future updates can you generate diffs with -U99999 so that context is available in Phabricator.

libc_nossp_pic is (increasingly) misnamed and we should really have a comment explaining what it is; I may take a look at that afterwards.

mk/bsd.compiler.mk
268–271 ↗(On Diff #150176)

No objection to leaving it in, I'm certain we can assume that if Clang's the compiler it will be at least version 7. Unfortunately we don't explicitly document (or consistently test) the minimum support.

268–271 ↗(On Diff #150176)

Sorry, by "it" I mean the ${${X_}COMPILER_VERSION} >= 70000 in the Clang case

This revision is now accepted and ready to land.Thu, Jan 30, 1:33 PM
This revision was automatically updated to reflect the committed changes.