Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Do the current nightly std::ptr docs violate provenance monotonicity? #530

Closed
joshlf opened this issue Sep 7, 2024 · 2 comments
Closed

Comments

@joshlf
Copy link

joshlf commented Sep 7, 2024

Per the nightly std::ptr docs:

[Under strict provenance, it is sound to] forge an allocation of size zero at any sufficiently aligned non-null address. i.e. the usual “ZSTs are fake, do what you want” rules apply but this only applies for actual forgery (integers cast to pointers). If you borrow some struct’s field that happens to be zero-sized, the resulting pointer will have provenance tied to that allocation, and it will still get invalidated if the allocation gets deallocated. In the future we may introduce an API to make such a forged allocation explicit.

Along the same lines as #529, IIUC this violates provenance monotonicity.

@joshlf joshlf changed the title Do the current std::ptr docs violate provenance monotonicity? Do the current nightly std::ptr docs violate provenance monotonicity? Sep 7, 2024
@RalfJung
Copy link
Member

Yeah, this is indeed outdated. Will be fixed together with the big strict provenance docs update.

@purplesyringa
Copy link

The docs don't spell this anymore -- perhaps close the issue?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants