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

Changing CFLAGS to mitigate Spectre v2 #2499

Open
dongsupark opened this Issue Sep 3, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@dongsupark

dongsupark commented Sep 3, 2018

According to the Google security report, in theory Spectre v2 affects not only Kernel & microcode, but also all userspace applications and libraries.

We should consider adding the following CFLAGS to the default profile in Container Linux, like:

CFLAGS="$CFLAGS -mindirect-branch=thunk -mindirect-branch-register"

To use that, at least Gcc 7.3 or 8.1 is needed, and the default Gcc is already 7.3. So that should be no issue.

I'm still wondering why it's not enabled by default, both from upstream Gentoo and Container Linux. I suppose it's because of one of the following:

  • In general Spectre is harder to be exploited than Meltdown.
  • possible unexpected breakage in particular packages, as discussed here
  • performance degradation, as discussed here

See also https://groups.google.com/forum/#!topic/linux.gentoo.user/6xUuPccmxtU.

Anyway despite all the issues, I think it's worth trying the CFLAGS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment