about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <ariel.byd@gmail.com>2018-09-15 23:26:04 +0300
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2018-09-15 23:31:38 +0300
commit0d840e115cd000a53b752024dea85c2d143dbebc (patch)
tree55950013a66411673fc6bb02a161434955424057 /src/rustllvm/RustWrapper.cpp
parentcba0fdf43c22795822e1d7c751a69e6c85007221 (diff)
downloadrust-0d840e115cd000a53b752024dea85c2d143dbebc.tar.gz
rust-0d840e115cd000a53b752024dea85c2d143dbebc.zip
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, #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 #54059
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions