Disable retagging for variadic arguments in const-eval#157622
Conversation
|
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri
cc @rust-lang/miri Some changes occurred to the CTFE machinery |
|
r? @davidtwco rustbot has assigned @davidtwco. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? me Though I definitely want Ralf to have a look at this too |
There was a problem hiding this comment.
Why is this just a TB test? It also applies to SB, doesn't it?
There was a problem hiding this comment.
Yup - I adjusted the test and moved it over to both_borrows.
|
Reminder, once the PR becomes ready for a review, use |
885bef0 to
0c6954f
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
|
|
| unsafe { | ||
| write_with_first_arg(&raw mut val, &val); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Please add a trailing newline
|
This looks great, thanks! With the last nit resolved, please squash the commits, then we can land this. Please use the @rustbot author |
Co-authored-by: Ralf Jung <post@ralfj.de>
0c6954f to
cc89e06
Compare
|
@rustbot ready |
|
@bors r=RalfJung,folkertdev rollup |
…adics, r=RalfJung,folkertdev Disable retagging for variadic arguments in const-eval Fixes [rust-lang#5058](rust-lang/miri#5058) in Miri. Retags occur on typed copies, which happen when we pass variadic arguments to a function. At the moment, variadic arguments receive `RetagMode::FnEntry` retags, which protects their permissions for the duration of the call. However, protection needs to be based on callee-side information, and the callee has now way of knowing what's contained within its `VaList`. This PR disables retagging entirely when copying variable arguments. It also adds a new, passing test case that would originally fail before this change. cc: @RalfJung, @folkertdev
…adics, r=RalfJung,folkertdev Disable retagging for variadic arguments in const-eval Fixes [rust-lang#5058](rust-lang/miri#5058) in Miri. Retags occur on typed copies, which happen when we pass variadic arguments to a function. At the moment, variadic arguments receive `RetagMode::FnEntry` retags, which protects their permissions for the duration of the call. However, protection needs to be based on callee-side information, and the callee has now way of knowing what's contained within its `VaList`. This PR disables retagging entirely when copying variable arguments. It also adds a new, passing test case that would originally fail before this change. cc: @RalfJung, @folkertdev
…adics, r=RalfJung,folkertdev Disable retagging for variadic arguments in const-eval Fixes [rust-lang#5058](rust-lang/miri#5058) in Miri. Retags occur on typed copies, which happen when we pass variadic arguments to a function. At the moment, variadic arguments receive `RetagMode::FnEntry` retags, which protects their permissions for the duration of the call. However, protection needs to be based on callee-side information, and the callee has now way of knowing what's contained within its `VaList`. This PR disables retagging entirely when copying variable arguments. It also adds a new, passing test case that would originally fail before this change. cc: @RalfJung, @folkertdev
…uwer Rollup of 17 pull requests Successful merges: - #156950 (Staticlib rename internal symbols) - #157322 (test pre-stabilization items on CI) - #157490 (Add field-wise CoerceShared reborrow tests) - #157655 (Make Share::share final and improve docs) - #157688 (Create experimental test job `aarch64-apple-macos-26` for evaluating `macos-26` runner images) - #157796 (rustdoc: Some more lazy formatting) - #157069 (Test that you can't implement Unpin for a compiler-generated future using TAIT) - #157202 (add #[rustc_no_writable] to slice::get_unchecked_mut) - #157622 (Disable retagging for variadic arguments in const-eval) - #157684 (-Zassumptions-on-binders: insert empty assumptions when entering binders in the solver) - #157695 (Extend capabilities of `TypeFoldable_Generic`) - #157752 (Rename `errors.rs` file to `diagnostics.rs` (6/N)) - #157766 (interpret: avoid computing layout of sized raw pointee) - #157785 (fuchsia: Support AddressSanitizer on riscv64gc-unknown-fuchsia) - #157795 (revert 157013) - #157798 (Prevent approving PRs that wait for Crater or formal decisions) - #157803 (Rename `errors.rs` file to `diagnostics.rs` (7/N))
…uwer Rollup of 17 pull requests Successful merges: - #156950 (Staticlib rename internal symbols) - #157322 (test pre-stabilization items on CI) - #157490 (Add field-wise CoerceShared reborrow tests) - #157655 (Make Share::share final and improve docs) - #157688 (Create experimental test job `aarch64-apple-macos-26` for evaluating `macos-26` runner images) - #157796 (rustdoc: Some more lazy formatting) - #157069 (Test that you can't implement Unpin for a compiler-generated future using TAIT) - #157202 (add #[rustc_no_writable] to slice::get_unchecked_mut) - #157622 (Disable retagging for variadic arguments in const-eval) - #157684 (-Zassumptions-on-binders: insert empty assumptions when entering binders in the solver) - #157695 (Extend capabilities of `TypeFoldable_Generic`) - #157752 (Rename `errors.rs` file to `diagnostics.rs` (6/N)) - #157766 (interpret: avoid computing layout of sized raw pointee) - #157785 (fuchsia: Support AddressSanitizer on riscv64gc-unknown-fuchsia) - #157795 (revert 157013) - #157798 (Prevent approving PRs that wait for Crater or formal decisions) - #157803 (Rename `errors.rs` file to `diagnostics.rs` (7/N))
…adics, r=RalfJung,folkertdev Disable retagging for variadic arguments in const-eval Fixes [rust-lang#5058](rust-lang/miri#5058) in Miri. Retags occur on typed copies, which happen when we pass variadic arguments to a function. At the moment, variadic arguments receive `RetagMode::FnEntry` retags, which protects their permissions for the duration of the call. However, protection needs to be based on callee-side information, and the callee has now way of knowing what's contained within its `VaList`. This PR disables retagging entirely when copying variable arguments. It also adds a new, passing test case that would originally fail before this change. cc: @RalfJung, @folkertdev
…uwer Rollup of 23 pull requests Successful merges: - #144220 (Add powerpc64-unknown-linux-gnuelfv2 target) - #153238 (debuginfo: slices are DW_TAG_array_type's) - #157112 (Update aarch64-unknown-freebsd target description) - #157322 (test pre-stabilization items on CI) - #157348 (Don't track cwd for `-Zremap-cwd-prefix` in incremental compilation) - #157490 (Add field-wise CoerceShared reborrow tests) - #157655 (Make Share::share final and improve docs) - #157672 (Region inference: Simplify initialisation of region values) - #157680 (Require `#[pin_v2]` for explicit pin-projection patterns) - #157688 (Create experimental test job `aarch64-apple-macos-26` for evaluating `macos-26` runner images) - #157796 (rustdoc: Some more lazy formatting) - #157818 (miri subtree update) - #157069 (Test that you can't implement Unpin for a compiler-generated future using TAIT) - #157079 (Don't recover `&raw EXPR` as a missing comma) - #157202 (add #[rustc_no_writable] to slice::get_unchecked_mut) - #157622 (Disable retagging for variadic arguments in const-eval) - #157684 (-Zassumptions-on-binders: insert empty assumptions when entering binders in the solver) - #157695 (Extend capabilities of `TypeFoldable_Generic`) - #157766 (interpret: avoid computing layout of sized raw pointee) - #157785 (fuchsia: Support AddressSanitizer on riscv64gc-unknown-fuchsia) - #157795 (revert 157013) - #157798 (Prevent approving PRs that wait for Crater or formal decisions) - #157803 (Rename `errors.rs` file to `diagnostics.rs` (7/N)) Failed merges: - #157752 (Rename `errors.rs` file to `diagnostics.rs` (6/N))
Rollup merge of #157622 - BorrowSanitizer:ignore-retags-variadics, r=RalfJung,folkertdev Disable retagging for variadic arguments in const-eval Fixes [#5058](rust-lang/miri#5058) in Miri. Retags occur on typed copies, which happen when we pass variadic arguments to a function. At the moment, variadic arguments receive `RetagMode::FnEntry` retags, which protects their permissions for the duration of the call. However, protection needs to be based on callee-side information, and the callee has now way of knowing what's contained within its `VaList`. This PR disables retagging entirely when copying variable arguments. It also adds a new, passing test case that would originally fail before this change. cc: @RalfJung, @folkertdev
…uwer Rollup of 23 pull requests Successful merges: - rust-lang/rust#144220 (Add powerpc64-unknown-linux-gnuelfv2 target) - rust-lang/rust#153238 (debuginfo: slices are DW_TAG_array_type's) - rust-lang/rust#157112 (Update aarch64-unknown-freebsd target description) - rust-lang/rust#157322 (test pre-stabilization items on CI) - rust-lang/rust#157348 (Don't track cwd for `-Zremap-cwd-prefix` in incremental compilation) - rust-lang/rust#157490 (Add field-wise CoerceShared reborrow tests) - rust-lang/rust#157655 (Make Share::share final and improve docs) - rust-lang/rust#157672 (Region inference: Simplify initialisation of region values) - rust-lang/rust#157680 (Require `#[pin_v2]` for explicit pin-projection patterns) - rust-lang/rust#157688 (Create experimental test job `aarch64-apple-macos-26` for evaluating `macos-26` runner images) - rust-lang/rust#157796 (rustdoc: Some more lazy formatting) - rust-lang/rust#157818 (miri subtree update) - rust-lang/rust#157069 (Test that you can't implement Unpin for a compiler-generated future using TAIT) - rust-lang/rust#157079 (Don't recover `&raw EXPR` as a missing comma) - rust-lang/rust#157202 (add #[rustc_no_writable] to slice::get_unchecked_mut) - rust-lang/rust#157622 (Disable retagging for variadic arguments in const-eval) - rust-lang/rust#157684 (-Zassumptions-on-binders: insert empty assumptions when entering binders in the solver) - rust-lang/rust#157695 (Extend capabilities of `TypeFoldable_Generic`) - rust-lang/rust#157766 (interpret: avoid computing layout of sized raw pointee) - rust-lang/rust#157785 (fuchsia: Support AddressSanitizer on riscv64gc-unknown-fuchsia) - rust-lang/rust#157795 (revert 157013) - rust-lang/rust#157798 (Prevent approving PRs that wait for Crater or formal decisions) - rust-lang/rust#157803 (Rename `errors.rs` file to `diagnostics.rs` (7/N)) Failed merges: - rust-lang/rust#157752 (Rename `errors.rs` file to `diagnostics.rs` (6/N))
Fixes #5058 in Miri.
Retags occur on typed copies, which happen when we pass variadic arguments to a function. At the moment, variadic arguments receive
RetagMode::FnEntryretags, which protects their permissions for the duration of the call. However, protection needs to be based on callee-side information, and the callee has now way of knowing what's contained within itsVaList.This PR disables retagging entirely when copying variable arguments. It also adds a new, passing test case that would originally fail before this change.
cc: @RalfJung, @folkertdev