-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[advisory] | ||
id = "RUSTSEC-0000-0000" | ||
package = "fitsrs" | ||
date = "2024-12-28" | ||
url = "https://github.com/cds-astro/fitsrs/issues/5" | ||
references = ["https://github.com/betrusted-io/xous-core/pull/411"] | ||
categories = [] | ||
keywords = [] | ||
informational = "unsound" | ||
``` | ||
# Unsound mutable aliasing to immutable data | ||
There are muliple cases in the codebase, like the [snippet referenced in the issue](https://github.com/cds-astro/fitsrs/blob/5609d8fbb2add2cea207f20ee89117d1f7100b87/src/hdu/data/image.rs#L43-L46), where `unsafe` is used to circumvent aliasing rules. | ||
Immutable inputs are being cast to mutable inputs by using a combination of raw pointers and `UnsafeCell` as intermediate types. | ||
This is undefined behaviour by itself, but in some cases also results in multiple references - some immutable and some mutable - referring to the same input. |