Skip to content
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

Report unsoundness in fitsrs #2182

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions crates/fitsrs/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```toml
[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"

[versions]
patched = []
```

# 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.
Loading