Skip to content

sanitizers: Implement support for the sanitize ignorelist - #157808

Open
1c3t3a wants to merge 4 commits into
rust-lang:mainfrom
1c3t3a:sanitizer-ignorelist
Open

sanitizers: Implement support for the sanitize ignorelist#157808
1c3t3a wants to merge 4 commits into
rust-lang:mainfrom
1c3t3a:sanitizer-ignorelist

Conversation

@1c3t3a

@1c3t3a 1c3t3a commented Jun 12, 2026

Copy link
Copy Markdown
Member

The sanitize ignorelist gives central controls over which functions, files, etc. should be ignored and not sanitized. It is a common file format for clang and explained here:
https://clang.llvm.org/docs/SanitizerSpecialCaseList.html. This change adds support for this list in Rust as well.

r? @rcvalle

@rustbot

rustbot commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in tests/codegen-llvm/sanitizer

cc @rcvalle

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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 Jun 12, 2026
@rust-log-analyzer

This comment has been minimized.

@1c3t3a
1c3t3a force-pushed the sanitizer-ignorelist branch from 739335b to 624834b Compare June 12, 2026 12:24
The sanitize ignorelist gives central controls over which functions,
files, etc. should be ignored and not sanitized. It is a common file
format for clang and explained here:
https://clang.llvm.org/docs/SanitizerSpecialCaseList.html. This change
adds support for this list in Rust as well.
@1c3t3a
1c3t3a force-pushed the sanitizer-ignorelist branch from 624834b to 693e22f Compare June 12, 2026 12:49
@1c3t3a
1c3t3a requested a review from rcvalle June 12, 2026 14:20
Comment thread compiler/rustc_codegen_llvm/src/builder.rs Outdated
Comment thread compiler/rustc_codegen_llvm/src/builder.rs Outdated
Comment thread compiler/rustc_codegen_llvm/src/builder.rs Outdated
@rustbot 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 Jun 12, 2026
@1c3t3a
1c3t3a requested a review from rcvalle June 15, 2026 08:54
@rustbot 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 Jun 15, 2026
@rust-bors

rust-bors Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #158593) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

}
}

pub(crate) fn type_name_for_ignore_list<'tcx>(

@rcvalle rcvalle Jul 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this be moved to the rustc_sanitizers crate? Maybe an ignorelist module there? Are there any other things that could be moved there?

View changes since the review

@@ -0,0 +1,22 @@
//@ needs-sanitizer-cfi

@rcvalle rcvalle Jul 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we move these tests to sanitizer/ignorelist/?

View changes since the review

RustString::build_byte_buffer(f)
}

pub(crate) struct SanitizerIgnoreList {

@rcvalle rcvalle Jul 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this be moved to the rustc_sanitizers crate? Maybe an ignorelist module there? Are there any other things that could be moved there?

View changes since the review

} else {
// Do not set sanitizer attributes for naked functions.
to_add.extend(sanitize_attrs(cx, tcx, codegen_fn_attrs.sanitizers));
let mut enabled = tcx.sess.sanitizers() - codegen_fn_attrs.sanitizers.disabled;

@rcvalle rcvalle Jul 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this (or parts of this) made into a function and moved to the rustc_sanitizers crate? Maybe an ignorelist module there? Are there any other things that could be moved there?

View changes since the review

@rustbot 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 Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants