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 cortex-m #2178

Closed
wants to merge 1 commit into from
Closed
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
21 changes: 21 additions & 0 deletions crates/cortex-m/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "cortex-m"
date = "2024-12-23"
url = "https://github.com/rust-embedded/cortex-m/issues/485"
references = ["https://github.com/rust-embedded/cortex-m/pull/493"]
categories = []
keywords = ["uninitialized"]
informational = "unsound"
[versions]
patched = []
[affected]
functions = {"cortex_m::peripheral::SCB::vect_active" = ["<= 0.7.7"]}
```

# Unsound layout assumption of `volatile_register::RW`

The wrapper struct `volatile_register::RW` didn't have stable layout, and rustc would preserve the right to insert padding or reorder the structure. It should be declared as transparent; otherwise, casting it to u32 could lead to UB such as uninitialized memory exposure and break the safety guarantees of `ptr::read_volatile`.

This was patched by changing dependency version of `volatile_register::RW`, which was defined as `#[repr(transparent)]` in version of `0.2.2`.
Loading