Skip to content

Conversation

@cezarbbb
Copy link

@cezarbbb cezarbbb commented Sep 28, 2025

I've added some tests related to the stack protector. These tests were originally in the LLVM stack protector test project.
These tests were written for the "Stabilize stack-protector" proposal, and therefore removed the "stack-protector=basic" test option, as this stack protector was considered ineffective in Rust.
For the proposal, see: #146369
For the discussion, see zulip: https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Proposal.20for.20Adapt.20Stack.20Protector.20for.20Ru.E2.80.A6.20compiler-team.23841

r? @wesleywiser (feel free to reassign)
cc @nikic, @rcvalle, @davidtwco, @arielb1, @Darksonn, @Noratrieb, @SparrowLii

@rustbot rustbot added 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 Sep 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 28, 2025

wesleywiser is currently at their maximum review capacity.
They may take a while to respond.

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

…ics-effect-llvm.rs -> tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-2.rs	new file: tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-32bit-2.rs	new file: tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-64bit-2.rs
…tics-effect-windows-32bit-2.rs	modified: tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-64bit-2.rs
@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 Oct 10, 2025
@rustbot

This comment has been minimized.

@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Oct 10, 2025
@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 Oct 10, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 10, 2025

⚠️ Warning ⚠️

@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 Oct 10, 2025
@rcvalle rcvalle added the PG-exploit-mitigations Project group: Exploit mitigations label Oct 13, 2025
@SparrowLii SparrowLii self-assigned this Oct 25, 2025
@SparrowLii
Copy link
Member

I'm looking this and gonna give some comments, expecting in the next week

Copy link
Member

@SparrowLii SparrowLii left a comment

Choose a reason for hiding this comment

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

Please split the PR into multiple commits according to the logical organization of the test, which makes it easier for others to review.

And if your tests are coming from llvm tests, could you write something like a sheet to explain if these result in rustc are all expected?

View changes since this review

fn dummy(_: ...) -> i32;

static STR: [u8; 1];
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you add some comments about why we need these extern functions?

Comment on lines +46 to +49
// #[repr(C)]
// struct A {
// data: [u8; 2],
// }
Copy link
Member

Choose a reason for hiding this comment

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

Why are these code left here

}

// Note: test2
// struct -> flat aggregate -> array
Copy link
Member

Choose a reason for hiding this comment

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

These codes too, please add some comments to explain why keep these codes


// CHECK-LABEL: test3{{:|\[}}
#[no_mangle]
pub fn test3(a: *const u8) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you make these test function names more meaningful? Or add some comments to explain

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

Labels

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.

6 participants