Page MenuHomeFreeBSD

Add stack clash protection to the WITH_SSP flag
ClosedPublic

Authored by netchild on Fri, Jan 24, 9:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 28, 10:48 AM
Unknown Object (File)
Tue, Jan 28, 10:48 AM
Unknown Object (File)
Sat, Jan 25, 8:46 PM
Unknown Object (File)
Sat, Jan 25, 7:10 PM
Unknown Object (File)
Sat, Jan 25, 1:08 PM
Unknown Object (File)
Fri, Jan 24, 9:44 AM
Unknown Object (File)
Fri, Jan 24, 9:29 AM
Subscribers

Details

Summary

See

https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html
https://developers.redhat.com/blog/2020/05/22/stack-clash-mitigation-in-gcc-part-3
https://blog.llvm.org/posts/2021-01-05-stack-clash-protection/

Short: this adds a guard page every PAGE_SIZE chunk to detect stack clash attacks. This needs stack guard pages support in the kernel, but it seems it doesn't need architecture / OS specific support in userland.

Diff Detail

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

Event Timeline

LGTM with a suggested update for the mitigations text

man/man7/mitigations.7
251 ↗(On Diff #149866)

Maybe "and stack probing in PAGE_SIZE chunks"? The guard page(s) already existed, stack clash protection adds the probing so that we can't skip over the guard page.

This revision is now accepted and ready to land.Fri, Jan 24, 2:36 PM

Man page changed as suggested.