Skip to content

Commit c782b71

Browse files
authored
refactor: rework inspector to take shared references and fix unsoundness (#1853)
Previously we were storing pointers to the raw values, which V8 was holding onto. We didn't actually enforce they were pinned. So this was trivially unsound: ``` let channel = v8::inspector::ChannelBase::new::<ChannelThing>(); let mut channel = ChannelThing { channel }; let client_trust_level = v8::inspector::V8InspectorClientTrustLevel::FullyTrusted; let session = inspector.connect( 1, &mut channel, v8::inspector::StringView::empty(), client_trust_level, ); drop(channel); // any usage of the session that accesses the channel after this is a UAF ``` We also forced you to embed the base value into your implementation, and all the methods were taking &mut self. Now, we take shared references (which is ok because we either use an UnsafeCell to get a pointer to hand to V8, or we only use raw pointers)
1 parent b6c9d28 commit c782b71

File tree

3 files changed

+359
-474
lines changed

3 files changed

+359
-474
lines changed

0 commit comments

Comments
 (0)