Skip to content

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, especially given that the 0.7.x release train was published very recently. Thus, in this commit, we publish 0.7.3, and we will yank 0.7.{0,1,2} as soon as 0.7.3 is published.

Fixes #299

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, especially given that the 0.7.x release train was
published very recently. Thus, in this commit, we publish 0.7.3, and we
will yank 0.7.{0,1,2} as soon as 0.7.3 is published.

Fixes #299
joshlf added a commit that referenced this pull request 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
@joshlf joshlf merged commit 62f76d2 into main Sep 2, 2023
@joshlf joshlf deleted the maybe-uninit-soundness branch September 2, 2023 04:30
joshlf added a commit that referenced this pull request 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
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.

MaybeUninit impls are unsound

1 participant