Skip to content
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

Use ParamEnv::reveal_all in CFI #128580

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Conversation

compiler-errors
Copy link
Member

I left a huge comment for why this ICEs in the test I committed.

typeid_for_instance should only be called on monomorphic instances during codegen, and we should just be using ParamEnv::reveal_all() rather than the param-env of the instance itself. I added an assertion to ensure that we only do this for fully substituted instances (this may break with polymorphization, but I kinda don't care lol).

Fixes #114160
cc @rcvalle

@rustbot
Copy link
Collaborator

rustbot commented Aug 3, 2024

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 3, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 3, 2024

Some changes occurred in compiler/rustc_sanitizers

cc @rust-lang/project-exploit-mitigations, @rcvalle

Some changes occurred in tests/ui/sanitizer

cc @rust-lang/project-exploit-mitigations, @rcvalle

@rcvalle
Copy link
Member

rcvalle commented Aug 3, 2024

LGTM (@davidtwco FYI). Thank you for your time and for working on this, @compiler-errors! Much appreciated.

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

h'lo the grammar checker in my brain found a red squiggle.

tests/ui/sanitizer/cfi-can-reveal-opaques.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor

lcnr commented Aug 5, 2024

r? @lcnr

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 5, 2024

📌 Commit b0beb64 has been approved by lcnr

It is now in the queue for this repository.

@rustbot rustbot assigned lcnr and unassigned davidtwco Aug 5, 2024
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 5, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 5, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#122049 (Promote riscv64gc-unknown-linux-musl to tier 2)
 - rust-lang#128580 (Use `ParamEnv::reveal_all` in CFI)
 - rust-lang#128688 (custom MIR: add support for tail calls)
 - rust-lang#128694 (Normalize when equating `dyn` tails in MIR borrowck)
 - rust-lang#128697 (interpret: move nullary-op evaluation into operator.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9cb3688 into rust-lang:master Aug 6, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 6, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 6, 2024
Rollup merge of rust-lang#128580 - compiler-errors:cfi-param-env, r=lcnr

Use `ParamEnv::reveal_all` in CFI

I left a huge comment for why this ICEs in the test I committed.

`typeid_for_instance` should only be called on monomorphic instances during codegen, and we should just be using `ParamEnv::reveal_all()` rather than the param-env of the instance itself. I added an assertion to ensure that we only do this for fully substituted instances (this may break with polymorphization, but I kinda don't care lol).

Fixes rust-lang#114160
cc `@rcvalle`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: CFI: failed to normalize
7 participants