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

avoid leaking host details in proc macro metadata decoding #54265

Merged
merged 2 commits into from
Sep 22, 2018

Commits on Sep 15, 2018

  1. avoid leaking host details in proc macro metadata decoding

    proc macro crates are essentially implemented as dynamic libraries using
    a dlopen-based ABI. They are also Rust crates, so they have 2 worlds -
    the "host" world in which they are defined, and the "target" world in
    which they are used.
    
    For all the "target" world knows, the proc macro crate might not even
    be implemented in Rust, so leaks of details from the host to the target
    must be avoided for correctness.
    
    Because the "host" DefId space is different from the "target" DefId
    space, any leak involving a DefId will have a nonsensical or
    out-of-bounds DefKey, and will cause all sorts of crashes.
    
    This PR fixes all leaks I have found in `decoder`. In particular, rust-lang#54059
    was caused by host native libraries leaking into the target, which feels
    like it might even be a correctness issue if it doesn't cause an ICE.
    
    Fixes rust-lang#54059
    arielb1 committed Sep 15, 2018
    Configuration menu
    Copy the full SHA
    0d840e1 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2018

  1. Configuration menu
    Copy the full SHA
    1b93806 View commit details
    Browse the repository at this point in the history