Skip to content

CFI: Erase regions when projecting ADT to its transparent non-1zst field #129179

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Aug 17, 2024

The output from FieldDef::ty (or TyCtxt::type_of) may have free regions (well, 'static) -- erase it.

Fixes #129169
Fixes #123685

@rustbot
Copy link
Collaborator

rustbot commented Aug 17, 2024

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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 17, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 17, 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

@matthiaskrgr
Copy link
Member

does this also fix #123685 ?

@compiler-errors
Copy link
Member Author

r? compiler

@rustbot rustbot assigned davidtwco and unassigned TaKO8Ki Aug 19, 2024
@rcvalle
Copy link
Member

rcvalle commented Aug 19, 2024

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

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 21, 2024

📌 Commit c8ae02f has been approved by davidtwco

It is now in the queue for this repository.

@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 21, 2024
@compiler-errors
Copy link
Member Author

@bors rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 21, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#128627 (Special case DUMMY_SP to emit line 0/column 0 locations on DWARF platforms.)
 - rust-lang#128843 (Minor Refactor: Remove a Redundant Conditional Check)
 - rust-lang#129179 (CFI: Erase regions when projecting ADT to its transparent non-1zst field)
 - rust-lang#129281 (Tweak unreachable lint wording)
 - rust-lang#129312 (Fix stability attribute of `impl !Error for &str`)
 - rust-lang#129332 (Avoid extra `cast()`s after `CStr::as_ptr()`)
 - rust-lang#129339 (Make `ArgAbi::make_indirect_force` more specific)
 - rust-lang#129344 (Use `bool` in favor of `Option<()>` for diagnostics)
 - rust-lang#129345 (Use shorthand field initialization syntax more aggressively in the compiler)
 - rust-lang#129355 (fix comment on PlaceMention semantics)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7da4b2d into rust-lang:master Aug 21, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 21, 2024
Rollup merge of rust-lang#129179 - compiler-errors:cfi-erase-transparent, r=davidtwco

CFI: Erase regions when projecting ADT to its transparent non-1zst field

The output from `FieldDef::ty` (or `TyCtxt::type_of`) may have free regions (well, `'static`) -- erase it.

Fixes rust-lang#129169
Fixes rust-lang#123685
# for free to join this conversation on GitHub. Already have an account? # 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 when compile the anyhow with CFI on nightly ICE: kcfi: encode_region: unexpected ''static'
7 participants