Skip to content

CFI: Add support for the adt_const_params feature - #159632

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
rcvalle:rust-cfi-fix-159299
Jul 29, 2026
Merged

CFI: Add support for the adt_const_params feature#159632
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
rcvalle:rust-cfi-fix-159299

Conversation

@rcvalle

@rcvalle rcvalle commented Jul 21, 2026

Copy link
Copy Markdown
Member

Adds support for encoding constants of types allowed by the adt_const_params and unsized_const_params features (i.e., char, str, tuple, array, slice, struct, enum, and reference values) as literal arguments, and fixes the encoding of bool values to be 0 and 1, and of negative integer values to be their decimal values preceded by n (fixes #159299).

@rustbot rustbot added 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 Jul 21, 2026
@rustbot

rustbot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

r? @nnethercote

rustbot has assigned @nnethercote.
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 74 candidates
  • Random selection from 19 candidates

@rustbot

This comment has been minimized.

Adds support for encoding constants of types allowed by the
adt_const_params and unsized_const_params features (i.e., char, str,
tuple, array, slice, struct, enum, and reference values) as literal
arguments, and fixes the encoding of bool values to be 0 and 1, and of
negative integer values to be their decimal values preceded by n.
@rcvalle
rcvalle force-pushed the rust-cfi-fix-159299 branch from 3257e5e to 679bdc1 Compare July 21, 2026 03:32
@rcvalle rcvalle added the A-control-flow-integrity Area: Control Flow Integrity (CFI) security mitigation label Jul 21, 2026
@rcvalle

rcvalle commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

r? @bjorn3

@rustbot rustbot assigned bjorn3 and unassigned nnethercote Jul 22, 2026
Comment thread compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs
@bjorn3

bjorn3 commented Jul 29, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 679bdc1 has been approved by bjorn3

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 Jul 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 29, 2026
CFI: Add support for the adt_const_params feature

Adds support for encoding constants of types allowed by the adt_const_params and unsized_const_params features (i.e., char, str, tuple, array, slice, struct, enum, and reference values) as literal arguments, and fixes the encoding of bool values to be 0 and 1, and of negative integer values to be their decimal values preceded by n (fixes rust-lang#159299).
rust-bors Bot pushed a commit that referenced this pull request Jul 29, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #158460 (Remove llvm_enzyme feature outside of bootstrap)
 - #159509 (Generate `valid_range`s for enums sign-agnostically)
 - #159632 (CFI: Add support for the adt_const_params feature)
 - #159671 (Add semver check test command for checking API compatibility of stdlib)
 - #157058 (Rustdoc label badge for notable traits)
 - #159717 (Add `-Zimplicit-sysroot-deps`)
 - #159850 (Add regression test for closure in array-length const generic)
 - #159994 (Show jobs where a given test was executed in `test-dashboard`)
 - #160110 (convert rustc_hir::Target inherent methods to From impls)
 - #160123 (add additional license option for third-party dependencies)
 - #160131 (bootstrap: remove temporary bors email lookup)
rust-bors Bot pushed a commit that referenced this pull request Jul 29, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #158460 (Remove llvm_enzyme feature outside of bootstrap)
 - #159509 (Generate `valid_range`s for enums sign-agnostically)
 - #159632 (CFI: Add support for the adt_const_params feature)
 - #159671 (Add semver check test command for checking API compatibility of stdlib)
 - #157058 (Rustdoc label badge for notable traits)
 - #159717 (Add `-Zimplicit-sysroot-deps`)
 - #159850 (Add regression test for closure in array-length const generic)
 - #159994 (Show jobs where a given test was executed in `test-dashboard`)
 - #160110 (convert rustc_hir::Target inherent methods to From impls)
 - #160123 (add additional license option for third-party dependencies)
 - #160131 (bootstrap: remove temporary bors email lookup)
@rust-bors
rust-bors Bot merged commit 1a9b3a7 into rust-lang:main Jul 29, 2026
36 of 39 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 29, 2026
rust-timer added a commit that referenced this pull request Jul 29, 2026
Rollup merge of #159632 - rcvalle:rust-cfi-fix-159299, r=bjorn3

CFI: Add support for the adt_const_params feature

Adds support for encoding constants of types allowed by the adt_const_params and unsized_const_params features (i.e., char, str, tuple, array, slice, struct, enum, and reference values) as literal arguments, and fixes the encoding of bool values to be 0 and 1, and of negative integer values to be their decimal values preceded by n (fixes #159299).
@rcvalle
rcvalle deleted the rust-cfi-fix-159299 branch July 29, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-control-flow-integrity Area: Control Flow Integrity (CFI) security mitigation 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.

[ICE]: (CFI) Encoding char or &str constants causes a panic.

4 participants