Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miri subtree update #116508

Merged
merged 36 commits into from
Oct 7, 2023
Merged

Miri subtree update #116508

merged 36 commits into from
Oct 7, 2023

Commits on Oct 2, 2023

  1. Configuration menu
    Copy the full SHA
    cfbcc0e View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#3099 - RalfJung:abi-target-feature, r=RalfJung

    add test for a function ABI mismatch due to target features
    
    Cc rust-lang/miri#3095
    bors committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    43d1042 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2023

  1. Fix typos *ucomucom*

    eduardosm committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    91ef03b View commit details
    Browse the repository at this point in the history
  2. wording tweaks

    RalfJung committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    3e21c1f View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#3102 - eduardosm:typos, r=RalfJung

    Fix typos `*ucom` → `ucom*`
    bors committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    4f73d3f View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2023

  1. Configuration menu
    Copy the full SHA
    31a5755 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7d065db View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#3105 - RalfJung:sysroot-target, r=RalfJung

    miri-script: print which sysroot target we are building
    bors committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    40c928e View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2023

  1. Configuration menu
    Copy the full SHA
    6ed502d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5178ae6 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#3106 - RalfJung:tree-borrows-initial, r=RalfJung

    Tree Borrows: do not create new tags as 'Active'
    
    Cc `@Vanille-N`
    bors committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    ff3e990 View commit details
    Browse the repository at this point in the history
  4. Update miri dependencies

    eduardosm committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    95c4590 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f49d325 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bbebfa7 View commit details
    Browse the repository at this point in the history
  7. Update test dependencies

    eduardosm committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    11afb99 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#3107 - eduardosm:update-deps, r=RalfJung

    Update dependencies
    bors committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    1a6ab01 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2023

  1. Configuration menu
    Copy the full SHA
    dff7d5a View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#3098 - BlackHoleFox:apple-entropy, r=RalfJung

    Support getentropy on macOS as a foreign item
    
    Prior this was always assumed to be accessed via `dlsym` shim, but in `std` I'm attempting to start [unconditionally linking](rust-lang#116319) to `getentropy` on macOS now that Rust's platform version support allows it.
    
    This just moves the main logic of the previous `dlsym` handler into an eval context extension so it can be used via both call paths. The `dlsym` handler is still needed as `getrandom` uses it.
    bors committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    f9003c0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bc8d4df View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    099311b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    16cde06 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#3108 - RalfJung:dlsym, r=RalfJung

    refactor dlsym: dispatch symbols via the normal shim mechanism
    
    This avoids having to adjust Miri when switching between invoking the function via a linked symbol vs via dlsym.
    bors committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    4135408 View commit details
    Browse the repository at this point in the history
  7. add a direct dlsym test

    RalfJung committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    03a03e2 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#3109 - RalfJung:dlsym, r=RalfJung

    add a direct dlsym test
    bors committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    4587c7c View commit details
    Browse the repository at this point in the history
  9. Fix problems of Reserved -> Frozen

    Reserved loses permissions too quickly.
    Adding more fine-grained behavior of Reserved lets it lose
    write permissions only temporarily.
    Protected tags receive a read access on initialized locations.
    Vanille-N committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    bf1356e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e1e880e View commit details
    Browse the repository at this point in the history
  11. Auto merge of rust-lang#3067 - Vanille-N:spurious-incremental, r=Ralf…

    …Jung
    
    Continuation of rust-lang#3054: enable spurious reads in TB
    
    The last additions to the test suite of TB left some unresolved `#[should_panic]` that these new modifications solve.
    
    ## Problem
    
    Recall that the issues were arising from the interleavings that follow.
    
    ### A. `Reserved -> Frozen` has visible effects after function exit
    
    The transition `Reserved -> Frozen` irreversibly blocks write accesses to the tag, so in the interleaving below `y` initially `Reserved` becomes `Frozen` only in the target where a spurious read through `x` is inserted. This makes the later write through `y` UB only in the target and not in the source.
    ```
    1: retag x (&, protect)
    2: retag y (&mut, protect)
    1: spurious read x
    1: ret x
    2: ret y
    2: write y
    ```
    
    ### B. Protectors only announce their presence on retag
    
    There is a read-on-reborrow for protected locations, but if the retag of `x` occurs before that of `y` and there is no explicit access through `x`, then `y` is unaware of the existence of `x`. This is problematic because a spurious read inserted through `x` between the retag of `y` and the return of the function protecting `x` is a noalias violation in the target without UB in the source.
    ```
    1: retag x (&, protect)
    2: retag y (&mut, protect)
    1: spurious read x
    1: ret x
    2: write y
    2: ret y
    ```
    
    ## Step 1: Finer behavior for `Reserved`
    
    Since one problem is that `Reserved -> Frozen` has consequences beyond function exit, we decide to remove this transition entirely. To replace it we introduce a new subtype of `Reserved` with the extra boolean `aliased` set.
    `Reserved { aliased: true }` forbids child accesses, but only temporarily: it has no effect on activation once the tag is no longer protected.
    This makes the semantics of Tree Borrows slightly weaker in favor of being more similar to noalias.
    
    This solves interleaving **A.**, but **B.** is still a problem and the exhaustive tests do not pass yet.
    
    ## Step 2: Read on function exit
    
    Protected tags issue a "reminder" that they are protected until this instant inclusive, in the form of an implicit read (symmetrically to the implicit read on retag). This ensures that if the periods on which two tags `x` and `y` are protected overlap then no matter the interleaving of retags and returns, there is either a protector currently active or a read that has been emitted, both of which temporarily block activation.
    
    This makes the exhaustive test designed previously pass, but it has an effect on the ability to return an activated pointer that I had not foreseen before implementing it.
    
    ## Step 2': Do not propagate to children
    
    A naive implementation of **Step 2** makes the following code UB:
    ```rs
    fn reborrow(x: &mut u8) -> &mut u8 {
        let y = &mut *x;
        *y = *y;
        y // callee returns `y: Active`...
    }
    
    let x = &mut 0u8;
    let y = reborrow(x); // ... and caller receives `y: Frozen`
    *y = 1; // UB
    ```
    This is unacceptable, and a simple fix is to make this implicit read visible only to foreign tags.
    
    We still lack hindsight on the ramifications of this decision, and the fact that the problematic pattern was only discovered because it occured in one completely unrelated test (with a cryptic error message) is worrying. We should be vigilant as to how this interacts with the rest of the model.
    
    ## TODO
    
    As of commit #281c30, the data race model has not been fully updated.
    We have removed the reborrow of mutable references counting as a write access, but we still need the implicit read of function exit to count as a read.
    bors committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    3c511bb View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#3110 - eduardosm:rounding-without-host-floats…

    …, r=RalfJung
    
    Do not use host floats in `simd_{ceil,floor,round,trunc}`
    bors committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    375ff3e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    ea56007 View commit details
    Browse the repository at this point in the history
  14. Merge from rustc

    RalfJung committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    100ea2b View commit details
    Browse the repository at this point in the history
  15. Auto merge of rust-lang#3112 - RalfJung:rustup, r=RalfJung

    Rustup
    
    preparing for rustc-push
    bors committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    3b08930 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2023

  1. Preparing for merge from rustc

    The Miri Conjob Bot committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    d322243 View commit details
    Browse the repository at this point in the history
  2. Merge from rustc

    The Miri Conjob Bot committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    722736a View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#3113 - rust-lang:rustup-2023-10-07, r=saethlin

    Automatic sync from rustc
    bors committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    1c42857 View commit details
    Browse the repository at this point in the history
  4. update lockfile

    RalfJung committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    5aecfe4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a04b7a3 View commit details
    Browse the repository at this point in the history