-
Notifications
You must be signed in to change notification settings - Fork 4
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
Too strict requirments for TaggedPtr::new and ::get/::ptr? #4
Comments
Tagging a one-past-the-end pointer might work, but the issue is that once you add the tag, the pointer now points to memory strictly outside of the allocated object, which may make some assumptions invalid (will the provenance still be valid once the original pointer is recovered, will I would have to have more assurance that end pointer tagging wouldn't cause unsoundness or spurious failures or subtly alter the characteristics of stored pointers before I would feel comfortable relaxing the conditions. |
Am I to read this as you can't also tag |
I was mostly concerned about this part of
But that's admittedly an implementation detail of CHERI, and one that's unlikely to occur in practice (given the “kilobytes” of offset the documentation implies are necessary to trigger the phenomenon). It does look like both the case of tagging one-past-the-end pointers and tagging |
I decided to forgo pointer tagging (for my usecase) cause I had a perfectly good |
The constructor can't be const because |
The documentation requires a dereferenceable pointer provided to ::new.
This seems like a too strict precondition, even the cited core::ptr only restricts read and write operations to dereferenceable pointers.
So, from my understanding, either the documentation is too strict, or the implementation of ::new/::get/::ptr needs to reserve the option to read or write to the pointer passed in order to tag it.
This basically prevents an allocator to have a tagged end-pointer (pointing just beyond the allocated memory) - such an end pointer is not dereferenceable, and thus not useable in a TaggedPtr.
Did I miss something?
The text was updated successfully, but these errors were encountered: