Skip to content

Restrict MaybeUninit trait impls to fix soundness#309

Merged
joshlf merged 1 commit intov0.6.xfrom
maybe-uninit-soundness-v0.6.x
Sep 2, 2023
Merged

Restrict MaybeUninit trait impls to fix soundness#309
joshlf merged 1 commit intov0.6.xfrom
maybe-uninit-soundness-v0.6.x

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Sep 2, 2023

Previously, we implemented FromZeroes and FromBytes for MaybeUninit<T> with no bound on T. This resulted in a soundness hole in which T - and thus MaybeUninit<T> - could contain an UnsafeCell, which is a violation of the contracts of FromZeroes and FromBytes.

This is a breaking change, but it's very unlikely to be one that code is currently relying on. In this commit, we publish 0.6.4, and we will yank all preceding 0.6.x versions as soon as 0.6.4 is published.

This is a backport of #308

Previously, we implemented `FromZeroes` and `FromBytes` for
`MaybeUninit<T>` with no bound on `T`. This resulted in a soundness hole
in which `T` - and thus `MaybeUninit<T>` - could contain an
`UnsafeCell`, which is a violation of the contracts of `FromZeroes` and
`FromBytes`.

This is a breaking change, but it's very unlikely to be one that code is
currently relying on. In this commit, we publish 0.6.4, and we will yank
all preceding 0.6.x versions as soon as 0.6.4 is published.

This is a backport of #308
@joshlf joshlf merged commit c33bc31 into v0.6.x Sep 2, 2023
@joshlf joshlf deleted the maybe-uninit-soundness-v0.6.x branch September 2, 2023 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant