Skip to content

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jun 24, 2025

Fixes #142969

I'm not certain if there are any other paths that should be tainted, but they would operate similarly. Perhaps pointer coercion.

Introduces extern "rust-invalid" for testing purposes.

r? @workingjubilee or @oli-obk (or anyone)

@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 Jun 24, 2025
@workingjubilee
Copy link
Member

I believe we can coerce a function pointer from unsafe extern "abi" fn(A) -> R to extern "abi" fn(A) -> R.

@compiler-errors
Copy link
Member Author

I believe we can coerce a function pointer from unsafe extern "abi" fn(A) -> R to extern "abi" fn(A) -> R.

Yeah, but IDK if it causes an ICE in CTFE and therefore deserves tainting like this.

@compiler-errors compiler-errors force-pushed the taint-invalid-call-abi branch from ddaee78 to 61e8d05 Compare June 24, 2025 22:34
@rustbot
Copy link
Collaborator

rustbot commented Jun 24, 2025

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

@compiler-errors
Copy link
Member Author

Added extern "rust-invalid" in the first commit, and (manually...) checked that it still ICEd in the same way as extern "cmse-*". Then I fixed the ICE in the second commit.

@workingjubilee
Copy link
Member

neat!

@compiler-errors
Copy link
Member Author

compiler-errors commented Jun 24, 2025

For the record, the ExternAbi/CanonAbi split meant it was so easy to add rust-invalid convention b/c I didn't have to add new match arms for a theoretical CanonAbi::RustInvalid (which far outnumber the matches on ExternAbi) b/c the whole point is that it cannot ever be canonized lol.

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

r=me with the apparent duplication sorted or explained

@workingjubilee
Copy link
Member

wonderful! I'm glad that my opinions on the architecture are paying off here.

@compiler-errors compiler-errors force-pushed the taint-invalid-call-abi branch from 61e8d05 to e776065 Compare June 24, 2025 22:43
@workingjubilee
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 25, 2025

📌 Commit e776065 has been approved by workingjubilee

It is now in the queue for this repository.

@bors 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 Jun 25, 2025
bors added a commit that referenced this pull request Jun 25, 2025
Rollup of 15 pull requests

Successful merges:

 - #135731 (Implement parsing of pinned borrows)
 - #138780 (Add `#[loop_match]` for improved DFA codegen)
 - #142453 (Windows: make `read_dir` stop iterating after the first error is encountered)
 - #142633 (Error on invalid signatures for interrupt ABIs)
 - #142768 (Avoid a bitcast FFI call in transmuting)
 - #142825 (Port `#[track_caller]` to the new attribute system)
 - #142844 (Enable short-ice for Windows)
 - #142934 (Tweak `-Zmacro-stats` measurement.)
 - #142955 (Couple of test suite fixes for cg_clif)
 - #142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠)
 - #142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect)
 - #142982 (Corrected spelling mistake in c_str.rs)
 - #142983 (Taint body on invalid call ABI)
 - #142988 (Update wasm-component-ld to 0.5.14)
 - #142993 (Update cargo)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0f77e83 into rust-lang:master Jun 25, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jun 25, 2025
rust-timer added a commit that referenced this pull request Jun 25, 2025
Rollup merge of #142983 - compiler-errors:taint-invalid-call-abi, r=workingjubilee

Taint body on invalid call ABI

Fixes #142969

I'm not certain if there are any other paths that should be tainted, but they would operate similarly. Perhaps pointer coercion.

Introduces `extern "rust-invalid"` for testing purposes.

r? ```@workingjubilee``` or ```@oli-obk``` (or anyone)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Jun 26, 2025
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#135731 (Implement parsing of pinned borrows)
 - rust-lang/rust#138780 (Add `#[loop_match]` for improved DFA codegen)
 - rust-lang/rust#142453 (Windows: make `read_dir` stop iterating after the first error is encountered)
 - rust-lang/rust#142633 (Error on invalid signatures for interrupt ABIs)
 - rust-lang/rust#142768 (Avoid a bitcast FFI call in transmuting)
 - rust-lang/rust#142825 (Port `#[track_caller]` to the new attribute system)
 - rust-lang/rust#142844 (Enable short-ice for Windows)
 - rust-lang/rust#142934 (Tweak `-Zmacro-stats` measurement.)
 - rust-lang/rust#142955 (Couple of test suite fixes for cg_clif)
 - rust-lang/rust#142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠)
 - rust-lang/rust#142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect)
 - rust-lang/rust#142982 (Corrected spelling mistake in c_str.rs)
 - rust-lang/rust#142983 (Taint body on invalid call ABI)
 - rust-lang/rust#142988 (Update wasm-component-ld to 0.5.14)
 - rust-lang/rust#142993 (Update cargo)

r? `@ghost`
`@rustbot` modify labels: rollup
tautschnig pushed a commit to model-checking/verify-rust-std that referenced this pull request Jul 3, 2025
…kingjubilee

Rollup of 15 pull requests

Successful merges:

 - rust-lang#135731 (Implement parsing of pinned borrows)
 - rust-lang#138780 (Add `#[loop_match]` for improved DFA codegen)
 - rust-lang#142453 (Windows: make `read_dir` stop iterating after the first error is encountered)
 - rust-lang#142633 (Error on invalid signatures for interrupt ABIs)
 - rust-lang#142768 (Avoid a bitcast FFI call in transmuting)
 - rust-lang#142825 (Port `#[track_caller]` to the new attribute system)
 - rust-lang#142844 (Enable short-ice for Windows)
 - rust-lang#142934 (Tweak `-Zmacro-stats` measurement.)
 - rust-lang#142955 (Couple of test suite fixes for cg_clif)
 - rust-lang#142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠)
 - rust-lang#142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect)
 - rust-lang#142982 (Corrected spelling mistake in c_str.rs)
 - rust-lang#142983 (Taint body on invalid call ABI)
 - rust-lang#142988 (Update wasm-component-ld to 0.5.14)
 - rust-lang#142993 (Update cargo)

r? `@ghost`
`@rustbot` modify labels: rollup
@workingjubilee workingjubilee added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 12, 2025
@apiraino
Copy link
Contributor

Beta backport accepted as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle. Backport labels handled by them.

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jul 17, 2025
@cuviper cuviper mentioned this pull request Jul 17, 2025
@cuviper cuviper modified the milestones: 1.90.0, 1.89.0 Jul 17, 2025
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 17, 2025
bors added a commit that referenced this pull request Jul 21, 2025
[beta] backports

- Taint body on invalid call ABI #142983
- Fix rustdoc not correctly showing attributes with re-exports #143083
- trait_sel: `MetaSized` always holds temporarily #144016

r? cuviper
bors added a commit that referenced this pull request Jul 21, 2025
[beta] backports

- Taint body on invalid call ABI #142983
- Fix rustdoc not correctly showing attributes with re-exports #143083
- trait_sel: `MetaSized` always holds temporarily #144016

r? cuviper
bors added a commit that referenced this pull request Jul 21, 2025
[beta] backports

- Taint body on invalid call ABI #142983
- Fix rustdoc not correctly showing attributes with re-exports #143083
- trait_sel: `MetaSized` always holds temporarily #144016
- Ensure home directory exists #144003

r? cuviper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. 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.

ICE None abi map
6 participants