-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Remove owning_ref
to avoid (unused) unsoundness
#482
Comments
Could also consider replacing |
I think we'll need to replace
|
Note that all other RustSec advisory database warnings have been addressed. |
* Introduces a `Framebuffer`-specific reference type that holds a `MutexGuard` for direct, restricted access to a window's `Framebuffer`. * In the future, this could be made more generic, but this kind of access pattern is still rare in Theseus. * Avoids known unsoundness in `owning_ref`; see #482
* Introduces a `Framebuffer`-specific reference type that holds a `MutexGuard` for direct, restricted access to a window's `Framebuffer`. * In the future, this could be made more generic, but this kind of access pattern is still rare in Theseus. * Avoids known unsoundness in `owning_ref`; see #482 243c07a
Avoids unsoundness in `owning_ref`; see #482
* This commit adds 2 new types to replace `owning_ref`, which is unsound (see #482). Both types avoid the heap allocation (`Box` wrapper) needed in `owning_ref`, which is possible because a `MappedPages` object refers to a memory location that can never move or change after the mapping is initially created. * `BorrowedMappedPages`: a persistent unique borrow of a `MappedPages` object obtained by calling to `MappedPages::as_type()` or `as_type_mut()`. * `BorrowedSliceMappedPages`: same as above, but for slices, which are obtained by calling `MappedPages::as_slice()` or `as_slice_mut()`. * Both types accept a type parameter to specify the `Mutability` of the borrow, which is `Immutable` by default (for `&T` and `&[T]`), but can also be specified as `Mutable` (for `&mut T` and `&mut [T]`). * All crates where `owning_ref` was previously used to deref a `MappedPages` into one of the above variants of type `T` have now been replaced with these borrowed types, e.g., framebuffer, ACPI tables, APIC, networking, etc.
* This commit adds 2 new types to replace `owning_ref`, which is unsound (see #482). Both types avoid the heap allocation (`Box` wrapper) needed in `owning_ref`, which is possible because a `MappedPages` object refers to a memory location that can never move or change after the mapping is initially created. * `BorrowedMappedPages`: a persistent unique borrow of a `MappedPages` object obtained by calling to `MappedPages::as_type()` or `as_type_mut()`. * `BorrowedSliceMappedPages`: same as above, but for slices, which are obtained by calling `MappedPages::as_slice()` or `as_slice_mut()`. * Both types accept a type parameter to specify the `Mutability` of the borrow, which is `Immutable` by default (for `&T` and `&[T]`), but can also be specified as `Mutable` (for `&mut T` and `&mut [T]`). * All crates where `owning_ref` was previously used to deref a `MappedPages` into one of the above variants of type `T` have now been replaced with these borrowed types, e.g., framebuffer, ACPI tables, APIC, networking, etc. cd8300d
As an alternative and better solution, we no longer support using |
owning_ref
to avoid (unused) unsoundnessowning_ref
to avoid (unused) unsoundness
* Introduces a `Framebuffer`-specific reference type that holds a `MutexGuard` for direct, restricted access to a window's `Framebuffer`. * In the future, this could be made more generic, but this kind of access pattern is still rare in Theseus. * Avoids known unsoundness in `owning_ref`; see theseus-os#482
) Avoids unsoundness in `owning_ref`; see theseus-os#482
* This commit adds 2 new types to replace `owning_ref`, which is unsound (see theseus-os#482). Both types avoid the heap allocation (`Box` wrapper) needed in `owning_ref`, which is possible because a `MappedPages` object refers to a memory location that can never move or change after the mapping is initially created. * `BorrowedMappedPages`: a persistent unique borrow of a `MappedPages` object obtained by calling to `MappedPages::as_type()` or `as_type_mut()`. * `BorrowedSliceMappedPages`: same as above, but for slices, which are obtained by calling `MappedPages::as_slice()` or `as_slice_mut()`. * Both types accept a type parameter to specify the `Mutability` of the borrow, which is `Immutable` by default (for `&T` and `&[T]`), but can also be specified as `Mutable` (for `&mut T` and `&mut [T]`). * All crates where `owning_ref` was previously used to deref a `MappedPages` into one of the above variants of type `T` have now been replaced with these borrowed types, e.g., framebuffer, ACPI tables, APIC, networking, etc.
* Use new `BorrowedSliceMappedPages` feature that allows it to hold an `Arc<MappedPages>` instead of just a plain `MappedPages`. * Closes theseus-os#482 -- `owning_ref` is unsound. 5440ad1
See: Kimundi/owning-ref-rs#78
We don't currently use the unsound functions, but it's a good idea to patch this nonetheless (in the root
Cargo.toml
's[patch]
section).The text was updated successfully, but these errors were encountered: