-
Notifications
You must be signed in to change notification settings - Fork 384
TB: Track permissions on the byte-level #4314
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
Conversation
So, how does adding a new node work (and why do we need to call
For Stacked Borrows, there are no per-block operations: each stack at each offset its own stack and completely independent from the other ones at different offsets in the same allocation. So there, more (basically everything) can be moved into the per-offset function. So what do we do for Tree Borrows? One answer is to combine parent reading, permission setting and data race notifying together. This would be somewhat ugly, because you're constructing a node, while also accessing the tree, and this would only be fine because you're careful to not actually add the node into the Should we do this? |
Ignoring the SIFA thingy since I already forgot how it works, what I think would make sense is to do a single
Does that makes sense or is it too ugly as well? |
That would work. It has to construct an extra |
I'm not sure, but that's at least plausible. I also prefer it conceptually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is a lot better.
I don't fully understand the logic around the new perms_map
though. It seems like the map is created to cover all the bytes from the beginning of the allocation to the end of the retagged place, which is odd -- it should be either the entire allocation, or just the place. And given that we do not want to actually put anything into the perms
map outside the place, I think it should be just the place.
I have pushed a commit with various minor cleanups -- please take a look, I hope they make sense. :) However, in doing so I stumbled upon a question I could not answer. |
e705a08
to
d518dcf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one more nit about the fact that we use LocationState::new_init
even if no initial access happens. (This is one of those cases where init
means initialized
instead of initial
, one that should be renamed presumably)
965ae31
to
575e901
Compare
Reminder, once the PR becomes ready for a review, use |
432ea98
to
f2d791b
Compare
@rustbot ready |
All right, I think this is ready. :) @rustbot author |
88e78aa
to
876f534
Compare
Looking at the diff of what you pushed, you removed one line from the comment for |
FWIW the comment was outdated, it should say |
Co-authored-by: Ralf Jung <[email protected]> Co-authored-by: Johannes Hostert <[email protected]>
Oops, probably an error I made when trying to fix some merge conflict when splitting the commits |
876f534
to
5b885ad
Compare
Now it looks right. :) Great work, let's land this! |
Looks like a timeout, let's try this again... |
Now that we landed this, I realize... maybe we should put this behind a flag? Or have a flag to turn it off? Some people may wake up soon seeing their CI fail since they were testing with TB and this change affects their code.^^ |
This makes the tracking of permissions on the byte-level, like in Stacked Borrows, which makes the tracking of interior mutable data more fine-grained.
cc @RalfJung @JoJoDeveloping