-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Extends AArch64 branch protection support to include GCS #146338
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
base: master
Are you sure you want to change the base?
Extends AArch64 branch protection support to include GCS #146338
Conversation
r? @davidtwco rustbot has assigned @davidtwco. Use |
Some changes occurred in src/doc/unstable-book/src/compiler-flags/branch-protection.md cc @rust-lang/project-exploit-mitigations, @rcvalle |
I've reviewed this internally so will reroll. GCS is exposed in Clang through their r? compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems pretty straightforward, and looks consistent with clang.
tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGS.stderr
Outdated
Show resolved
Hide resolved
r=me with the updated test output and CI green r? Urgau |
✌️ @CrooseGit, you can now approve this pull request! If @Urgau told you to " |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Urgau!
b50c4db
to
d949360
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
Does your local |
Checked locally and it's the LLVM version that is causing this, just add a |
d949360
to
7ade636
Compare
This comment has been minimized.
This comment has been minimized.
…<try> Extends AArch64 branch protection support to include GCS try-job: *aarch64*
This comment has been minimized.
This comment has been minimized.
💔 Test for 6f90524 failed: CI. Failed jobs:
|
This comment was marked as outdated.
This comment was marked as outdated.
- Adds option to rustc config to enable GCS - Passes `guarded-control-stack` flag to llvm if enabled
3c9eda0
to
b984bb5
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
@CrooseGit: 🔑 Insufficient privileges: not in try users |
This comment has been minimized.
This comment has been minimized.
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
bzip2 \ | ||
g++ \ | ||
g++-15 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like installing a specific version of g++
doesn't provide the cc
binary by default.
I tested adding the update-alternatives
to provide gcc
, cc
, g++
and cxx
and that fixes the issue about cc
not being provided.
# Link standard gcc binary to the g++-15 ones
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 10 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-15 10 \
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-15 30 \
&& update-alternatives --install /usr/bin/cxx cxx /usr/bin/g++-15 30
(to be added after the install in this Dockerfile)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just seen this, thank you very much for looking into this issue.
I believe I found an alternative fix for the problem, changing the Ubuntu version to 25.10 for the builds where the above is a problem gives you gcc15 as the default. It is passing when I run the CI locally. Of course if it fails now I shall try your solution.
b984bb5
to
d67bd73
Compare
This comment has been minimized.
This comment has been minimized.
d67bd73
to
f043fb8
Compare
cc @rust-lang/infra for the CI image changes |
@bors try jobs=aarch64 |
This comment has been minimized.
This comment has been minimized.
…<try> Extends AArch64 branch protection support to include GCS try-job: *aarch64*
This comment has been minimized.
This comment has been minimized.
💔 Test for d260a23 failed: CI. Failed jobs:
|
f043fb8
to
e02bd51
Compare
@bors try jobs=aarch64 |
This comment has been minimized.
This comment has been minimized.
…<try> Extends AArch64 branch protection support to include GCS try-job: *aarch64*
This comment has been minimized.
This comment has been minimized.
💔 Test for c3587c9 failed: CI. Failed jobs:
|
@@ -1,8 +1,8 @@ | |||
FROM ubuntu:22.04 | |||
FROM ubuntu:25.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: doesn't this mean that we no longer test if we can build against Ubuntu 22?
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
g++ \ | ||
g++-15 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: ... and for that matter, is this a higher g++ baseline? (I'm not super sure.)
GCS support was added to GCC in version 15, thus the rmake test for this patch requires GCC15 Similarly, the ubuntu version is updated so the newer clang version is available, and/or GCC15 is the default.
e02bd51
to
bb893df
Compare
Extends existing support for AArch64 branch protection to include support for Guarded Control Stacks.