Skip to content

compiler: Allow safestack to be togglable via #[sanitize(safestack = "...")] - #161888

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
PiJoules:sanitize-safestack-togglable
Aug 29, 2026
Merged

compiler: Allow safestack to be togglable via #[sanitize(safestack = "...")]#161888
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
PiJoules:sanitize-safestack-togglable

Conversation

@PiJoules

@PiJoules PiJoules commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Since safestack is a sanitizer, it should be possible to allow enabling/disabling it on functions like we do with the other sanitizers. It's likely that when adding the #[sanitize(...)] support for the other ones that safestack was just missed, so this makes safestack follow suite. It was also suggested in #159873 that we just disable safestack this way for a specific test where we should check stack protector instrumentation.

@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in tests/codegen-llvm/sanitizer

cc @rcvalle

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 27, 2026
@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

r? @khyperia

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 18 candidates

@rust-log-analyzer

This comment has been minimized.

@khyperia

Copy link
Copy Markdown
Member

Could you maybe add a PR description explaining what's going on here, what this is used for, linking to relevant tracking issues and whatnot? I came in with zero context and had to do some digging to figure out what's going on here ✨

Anyway, while I'm 95% confident this is totally fine to r+, I'm not 100% since this isn't my area of expertise. Considering adwin suggested this in #159873 , gonna pass the review to them:

r? @adwinwhite

@rustbot rustbot assigned adwinwhite and unassigned khyperia Aug 28, 2026
@PiJoules

Copy link
Copy Markdown
Contributor Author

Could you maybe add a PR description explaining what's going on here, what this is used for, linking to relevant tracking issues and whatnot? I came in with zero context and had to do some digging to figure out what's going on here ✨

Anyway, while I'm 95% confident this is totally fine to r+, I'm not 100% since this isn't my area of expertise. Considering adwin suggested this in #159873 , gonna pass the review to them:

r? @adwinwhite

Added description

@adwinwhite

adwinwhite commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

I guess it's fine to merge. The sanitize attribute is a nightly feature so we're not stablizing anything here.

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 0717387 has been approved by adwinwhite

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 29, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 29, 2026
Rollup of 17 pull requests

Successful merges:

 - #161945 (std: optimise IO error formatting)
 - #160594 (attach global target features to module-level assembly)
 - #161577 (implement [u8]::split_ascii_whitespace)
 - #161858 (fix ICE in generic_const_parameter_types with inherents)
 - #161377 ([bootstrap] Don't reverse the order of dylib search path entries)
 - #161804 (Document PartialOrd behavior for Option<T> where T: PartialOrd)
 - #161865 (loongarch: support passing `u128`/`i128` to inline assembly)
 - #161877 (Do not load macro metadata for local definitions in rustdoc)
 - #161880 (fix rustc_lint_defs doctest issues)
 - #161883 (better deal with internal features being injected into doctests)
 - #161887 (std: uefi: fix File::seek returning the EOF sentinel)
 - #161888 (compiler: Allow safestack to be togglable via #[sanitize(safestack = "...")])
 - #161897 (Reject contract attributes without arguments)
 - #161910 (Add rustdoc-html regression test for generated macro)
 - #161914 (Retroactively add relnotes for `bool::{ok_or,ok_or_else}` (1.98.0))
 - #161924 (Windows: document that `normalize_lexically` converts `/` to `\`)
 - #161927 (Change `rustc_middle/src/hooks/mod.rs` to `hooks.rs`)
@rust-bors
rust-bors Bot merged commit 36a684f into rust-lang:main Aug 29, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 29, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 29, 2026
Rollup merge of #161888 - PiJoules:sanitize-safestack-togglable, r=adwinwhite

compiler: Allow safestack to be togglable via #[sanitize(safestack = "...")]

Since safestack is a sanitizer, it should be possible to allow enabling/disabling it on functions like we do with the other sanitizers. It's likely that when adding the `#[sanitize(...)]` support for the other ones that safestack was just missed, so this makes safestack follow suite. It was also suggested in #159873 that we just disable safestack this way for a specific test where we should check stack protector instrumentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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.

5 participants