Add advisory for cgmath: Matrix::swap_columns can trigger UB with identical indices#2910
Open
DiuDiu777 wants to merge 1 commit into
Open
Add advisory for cgmath: Matrix::swap_columns can trigger UB with identical indices#2910DiuDiu777 wants to merge 1 commit into
Matrix::swap_columns can trigger UB with identical indices#2910DiuDiu777 wants to merge 1 commit into
Conversation
Member
|
Pinged some of the maintainers in the upstream issue. Feel free to ping me again if there's been no progress in 4 weeks or so. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Affected crate(s)
cgmath(1,618,302 recent downloads per crates.io; 10,211,015 total downloads)Links to upstream issue(s) or PR(s)
The issue was publicly reported upstream on 2026-03-11 and remains open with no maintainer response as of 2026-05-27.
Severity
Informational soundness issue. Safe Rust code can trigger undefined behavior by calling
Matrix2::swap_columns,Matrix3::swap_columns, orMatrix4::swap_columnswith identical column indices.The affected implementations call
ptr::swap(&mut self[a], &mut self[b]); whena == b, this creates overlapping mutable references to the same matrix column and violates Rust aliasing rules. Miri reports a Stacked Borrows violation. Nounsafecode is required from the caller.Checklist
RUSTSEC-0000-0000as the IDdatefield is set to the public disclosure dateThe issue was publicly reported upstream on 2026-03-11 and remains open with no maintainer response as of 2026-05-27. The repository also appears inactive. I am filing this advisory under RustSec's documented allowance for advisories after public disclosure with no upstream response.