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

soundness issue with Lock #64

Closed
dherman opened this issue Apr 21, 2016 · 1 comment
Closed

soundness issue with Lock #64

dherman opened this issue Apr 21, 2016 · 1 comment
Labels

Comments

@dherman
Copy link
Collaborator

dherman commented Apr 21, 2016

The Lock API currently keeps the exposed internals alive longer than the lock is held (in particular, as long as the lifetime of the Scope the handle belongs to). This is unsound.

Since Handle is an auto-deref type, it should be possible to impl Lock for a borrowed reference to the target of the handle, instead of the handle itself, which should correctly bound the lifetime of the exposed internals.

But this also means that to trigger the auto-deref, we'll need to replace vm::lock with a method on Lock, so that it can be performed by a method call on the handle, which implicitly borrows the target.

@dherman dherman added the bug label Apr 21, 2016
@dherman
Copy link
Collaborator Author

dherman commented Apr 21, 2016

Candidates for the method name: tap, uncover, unwrap, unpack, open, operate, pierce, puncture, probe, peel, seize, grab, take, zoom, focus

I like "grab". It's kind of evocative of temporarily taking hold of the value, and also hints at grabbing the lock.

dherman added a commit that referenced this issue Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant