Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670136 - Consider adding -fstack-clash-check hardening in future profiles
Summary: Consider adding -fstack-clash-check hardening in future profiles
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL: https://gitweb.gentoo.org/proj/gcc-pa...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-02 08:45 UTC by Hanno Böck
Modified: 2018-11-02 11:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Böck gentoo-dev 2018-11-02 08:45:11 UTC
-fstack-clash-check is a gcc flag that adds protection for stack overflow / stack/heap-clash attacks to executables. It's available since gcc 8 (currently not stable).

There was a previous flag -fstack=check with an older implementation of this. We enable -fstack=check in hardened, but from what I read this is no longer recommended. We have an open tracker for -fstack=check related problems (#637152). In response to the Qualys research on stack clash attacks [1] this new flag was developed to avoid problems with the old flag.

Here's some info from Red Hat:
https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/

This reads like on mainstream architectures this should work well ("For the architectures supported by Red Hat Enterprise Linux, improved architecture-specific versions are available"), yet it may be problematic on less common architectures.

I guess moving forward we should consider:

* Moving from -fstack=check to -fstack-clash-check in hardened.

* Later consider moving it to standard profiles.

Open question is if there are transitioning issues, i.e. if moving from a system compiled with -fstack=check to -fstack-clash-check will cause trouble.


[1] https://www.google.de/search?q=stack+clash+qualys&oq=stack+clash+qualys&aqs=chrome..69i57j69i65.2565j0j7&sourceid=chrome&ie=UTF-8
Comment 1 Magnus Granberg gentoo-dev 2018-11-02 11:30:30 UTC
Is allready enable on hardened gcc 8.X