Skip to content

Commit

Permalink
Report unsoundness in fitsrs
Browse files Browse the repository at this point in the history
  • Loading branch information
RReverser authored Dec 28, 2024
1 parent b02b7ca commit f224c34
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/fitsrs/RUSTSEC-0000-0000.md
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.

0 comments on commit f224c34

Please sign in to comment.