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
gcc49: backport retpoline support #39914
Conversation
To mitigate Spectre Variant 2, GCC needs to have retpoline support (-mindirect-branch and -mfunction-return arguments on amd64 and i386). Patches were pulled from H.J. Lu's backport branch to 4.9 (hjl/indirect/gcc-4_9-branch), available at https://github.com/hjl-tools/gcc/tree/hjl/indirect/gcc-4_9-branch/master. Upstream GCC does not apply patches to anything older than the gcc-6-branch. H.J. Lu is the author of the upstream retpoline commits as well. Several Linux distributions already backported these patches to GCC 4 branches and some old kernels (3.13 for instance) have been recompiled with these GCC patches. These kernels only allow to load kernel modules that are compiled with the retpoline support. References: - Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1749261 - Ubuntu package: https://launchpad.net/ubuntu/+source/gcc-4.8/4.8.4-2ubuntu1~14.04.4 Fixes NixOS#38394
@GrahamcOfBorg build gcc49 |
Failure on x86_64-darwin (full log) Attempted: gcc49 Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: gcc49 Partial log (click to expand)
|
Failure on x86_64-linux (full log) Attempted: gcc49 Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: gcc49 Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: gcc49 Partial log (click to expand)
|
Please disable darwin support for now or mark it as broken. Since this version is not widely used it should not be a big deal. |
Success on aarch64-linux (full log) Attempted: gcc49 Partial log (click to expand)
|
@Mic92 done. |
Failure on x86_64-linux (full log) Attempted: gcc49 Partial log (click to expand)
|
@GrahamcOfBorg build foundationdb |
If you can build |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: foundationdb Partial log (click to expand)
|
I successfully built
|
Success on x86_64-linux (full log) Attempted: foundationdb Partial log (click to expand)
|
Backport to stable might be helpful as well. |
@Mic92 yes. I'm waiting for the local build of |
Backported to |
To mitigate Spectre Variant 2, GCC needs to have retpoline
support (-mindirect-branch and -mfunction-return arguments on amd64
and i386).
Patches were pulled from H.J. Lu's backport branch to
4.9 (hjl/indirect/gcc-4_9-branch), available at
https://github.com/hjl-tools/gcc/tree/hjl/indirect/gcc-4_9-branch/master. Upstream
GCC does not apply patches to anything older than the
gcc-6-branch. H.J. Lu is the author of the upstream retpoline commits
as well.
Several Linux distributions already backported these patches to GCC 4
branches and some old kernels (3.13 for instance) have been recompiled
with these GCC patches. These kernels only allow to load kernel
modules that are compiled with the retpoline support.
References:
Fixes #38394
Things done
I built a kernel module with this
gcc49
and the vermagic field contains the retpoline string.build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)