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)
Tue, Oct 28, 5:33 PM
Unknown Object (File)
Tue, Oct 28, 2:55 PM
Unknown Object (File)
Thu, Oct 23, 2:29 AM
Unknown Object (File)
Oct 2 2025, 4:28 AM
Unknown Object (File)
Sep 30 2025, 8:13 AM
Unknown Object (File)
Sep 24 2025, 10:18 PM
Unknown Object (File)
Sep 24 2025, 10:01 AM
Unknown Object (File)
Sep 1 2025, 7:42 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.Jan 24 2025, 2:36 PM

Man page changed as suggested.