-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hardening flags #6
Comments
We might consider pulling 1. & 5. into the main GNU Radio flags? |
If one can find out if all flags are available on all supported compilers we can enable them
Is this:
correct in the case of GLIBCXX_ASSERTIONS? |
@noc0lour no, not really. This overrides CMake's own CXX flags. I've searched up and down, and it seems CMake simply doesn't allow to specify additional flags on the command line. We'll need to add a CMake directive that adds these flags. |
Meh, I should use: CMAKE_CXX_FLAGS, that's what one wants. |
Which usually takes |
And currently the flags are not added. |
This allows setting of the _GLIBCXX_ASSERTIONS macro, which enables "cheap" runtime checks for things like vector access bounds. This is related to gnuradio#1774. It allows for implementation of gnuradio/gnuradio-buildbot#6
This allows setting of the _GLIBCXX_ASSERTIONS macro, which enables "cheap" runtime checks for things like vector access bounds. This is related to gnuradio#1774. It allows for implementation of gnuradio/gnuradio-buildbot#6
@marcusmueller |
or even setting the appropriate environment variable works as well. |
Done, so, to recap: cmake might exhibit strange behaviour if you use the flag on subsequent runs. But since the build directory is only used once for each build, we don't run into trouble here |
Fedora 28 introduced
https://fedoraproject.org/wiki/Changes/HardeningFlags28
-fstack-clash-protection
). As a result, attempts to jump the stack guard (a requirement for stack clash attacks) will reliably result in a crash rather than giving the attacker control over stack/heap objects.-D_GLIBCXX_ASSERTIONS
. This turns on cheap range checks for C++ arrays, vectors, and strings.-fcf-protection=full -mcet.
--enable-default-pie
to ensure PIE support is enabled across all architectures.I want that shit, too!
Not all of these flags exist on not-very-extremely-recent GCCs, but especially 2. is available everywhere and will jump into our face a lot.
The text was updated successfully, but these errors were encountered: