3

sanitizers: Create the rustc_sanitizers crate by rcvalle · Pull Request #123620...

 1 month ago
source link: https://github.com/rust-lang/rust/pull/123620
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Member

Create the rustc_sanitizers crate and move the source code for the CFI and KCFI sanitizers to it. The tracking issue for reviewing and moving sanitizers into a compiler crate is #123619. This is part of our work to organize and stabilize support for the sanitizers. (See our roadmap at https://hackmd.io/@rcvalle/S1Ou9K6H6.)

tgross35 reacted with thumbs up emoji

Collaborator

r? @fmease

rustbot has assigned @fmease.
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

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

Apr 8, 2024

Collaborator

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Member

Author

Member

@davidtwco davidtwco

left a comment

LGTM, lots of small comments, but this is otherwise a clear improvement

compiler/rustc_sanitizers/src/lib.rs

Outdated Show resolved

/// This crate contains the source code for providing support for the sanitizers to the Rust

/// compiler.

pub mod cfi;

pub mod kcfi;

nit: we could probably simplify the file structure a little bit here, it's mostly an aesthetic concern so only if you agree:

rustc_sanitizers
|- lib.rs
|- cfi.rs (containing what is in cfi/typeid/mod.rs)
|- kcfi.rs (containing what is in kcfi/typeid/mod.rs)
 \- typeid/* (private mod, containing what is in cfi/typeid/itanium_cxx_abi now)

It's also possible that this doesn't make sense anticipating some of the other things you want to move to this crate that exists elsewhere at the moment, but if we're only anticipating things that we might do by having this structure (e.g. manglings other than itanium), then we can change to this structure when we're adding that.

Member

Author

Yes, I thought about it too. The reason I ended up doing it this way was because I'm anticipating two things:

  1. Move as much as possible of CFI and KCFI related source code to cfi/mod.rs and kcfi/mod.rs (e.g., source code at declare.rs and builder.rs as cfi::emit_type_test and kcfi::emit_kcfi_bundle).
  2. Add possibly at least an additional encoding for Microsoft XFG and cross-language Microsoft XFG (but we might want to discuss if the rustc_sanitizers crate is the right place for it), or a more coarse-grained encoding for cross-language CFI compatibility with other languages.

What do you think?

davidtwco reacted with thumbs up emoji

rustbot

added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

Apr 8, 2024

Member

Author

@rustbot ready

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Apr 8, 2024

Member

@bors r+

Contributor

📌 Commit 1f0f2c4 has been approved by davidtwco

It is now in the queue for this repository.

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

Apr 8, 2024

bors

merged commit b809c42 into

rust-lang:master

Apr 9, 2024

11 checks passed

rustbot

added this to the 1.79.0 milestone

Apr 9, 2024

rust-timer

added a commit to rust-lang-ci/rust that referenced this pull request

Apr 9, 2024

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

Reviewers

davidtwco

davidtwco approved these changes
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

Milestone

1.79.0

Development

Successfully merging this pull request may close these issues.

None yet

5 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK