Skip to content

Add rusty stack protector(re-submit)#144879

Closed
cezarbbb wants to merge 3 commits intorust-lang:mainfrom
cezarbbb:rusty-stack-protector
Closed

Add rusty stack protector(re-submit)#144879
cezarbbb wants to merge 3 commits intorust-lang:mainfrom
cezarbbb:rusty-stack-protector

Conversation

@cezarbbb
Copy link
Copy Markdown
Contributor

@cezarbbb cezarbbb commented Aug 4, 2025

MCP: https://github.com/rust-lang/compiler-team/issues/841
This draft PR is a prototype for Rust's stack protection option.

  • Compared with PR Add rusty stack protector #137418, this PR has the following improvements:
    Improved Rusty's stack protector's support for large variables. Now, when implicitly converting large arrays to pointers, the def_id of the function containing the array is added to the stack_protector's hashset.
    r? @ghost

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Aug 4, 2025

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 A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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 4, 2025
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Aug 4, 2025

Some changes occurred in src/tools/cargo

cc @ehuss

These commits modify compiler targets.
(See the Target Tier Policy.)

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 4, 2025
@rust-log-analyzer

This comment has been minimized.

	modified:   compiler/rustc_middle/src/ty/context.rs
	modified:   compiler/rustc_mir_transform/src/lib.rs
	new file:   compiler/rustc_mir_transform/src/stack_protector.rs
	modified:   compiler/rustc_target/src/spec/mod.rs
	modified:   tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-64bit.rs
	modified:   tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect.rs
@rust-log-analyzer

This comment has been minimized.

@cezarbbb cezarbbb force-pushed the rusty-stack-protector branch from 3005675 to d054b94 Compare August 4, 2025 06:55
@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 4, 2025
@SparrowLii SparrowLii assigned SparrowLii and unassigned SparrowLii Aug 4, 2025
@cezarbbb cezarbbb marked this pull request as draft August 4, 2025 07:31
@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 Aug 4, 2025
@rust-log-analyzer

This comment has been minimized.

	modified:   compiler/rustc_mir_transform/src/stack_protector.rs
	modified:   tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect.rs
@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 13, 2025

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

@Dylan-DPC
Copy link
Copy Markdown
Member

@cezarbbb any updates on this? does this still need to be a draft? thanks

@cezarbbb
Copy link
Copy Markdown
Contributor Author

@cezarbbb any updates on this? does this still need to be a draft? thanks

Hi, @Dylan-DPC. Apologize for the late reply.
When I submitted this draft, the community consensus was to prioritize merging the strong and all flags from nightly to stable and removing basic. I'm unsure if the community needs a rusty solution, hence this draft was shelved?
If the community is interested, I would very much like to continue this work.
Look forward to your reply.

@SparrowLii
Copy link
Copy Markdown
Member

SparrowLii commented Apr 23, 2026

I think we can close this since we are stablizing the "strong" mode, which is a more fesiable way

@SparrowLii SparrowLii closed this Apr 23, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 23, 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. 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.

7 participants