Page MenuHomeFreeBSD

Add stack clash protection to the WITH_SSP flag
ClosedPublic

Authored by netchild on Jan 24 2025, 9:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
May 2 2025, 2:34 AM
Unknown Object (File)
Apr 29 2025, 4:38 PM
Unknown Object (File)
Apr 19 2025, 11:24 AM
Unknown Object (File)
Apr 19 2025, 10:19 AM
Unknown Object (File)
Apr 14 2025, 11:43 PM
Unknown Object (File)
Apr 13 2025, 7:18 PM
Unknown Object (File)
Apr 13 2025, 10:34 AM
Unknown Object (File)
Apr 9 2025, 3:06 PM
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.Jan 24 2025, 2:36 PM

Man page changed as suggested.