Skip to content

Add advisory for oneringbuf: vmem double-free reachable from safe Rust#2883

Merged
djc merged 3 commits into
rustsec:mainfrom
berkant-koc:berkoc/oneringbuf-vmem-double-free-2026-05-14
May 14, 2026
Merged

Add advisory for oneringbuf: vmem double-free reachable from safe Rust#2883
djc merged 3 commits into
rustsec:mainfrom
berkant-koc:berkoc/oneringbuf-vmem-double-free-2026-05-14

Conversation

@berkant-koc
Copy link
Copy Markdown
Contributor

Resubmission of the oneringbuf half of #2882, split per @djc's review and trimmed to be in line with the typical advisory-db body length.

vmem-feature double-free reachable from safe Rust via VmemStorage::new (and every From<_> / default(cap) constructor that funnels through it). The source Box<[UnsafeSyncCell<T>]> drops at the end of new, and the destructor's drop_in_place later runs UnsafeSyncCell::drop a second time over the mmap'd bit-copy — deterministic double-free of every heap-owning T.

The companion unbounded-spsc advisory is filed separately as a sibling PR.

Closes prior #2882 (superseded by this + the unbounded-spsc PR).

The vmem-feature codepath bit-copies UnsafeSyncCell<T> into mmap and
also lets the source Box drop, producing a double-free of every
heap-owning T on later ring-buffer destruction. Reachable from safe Rust
constructors.
@djc
Copy link
Copy Markdown
Member

djc commented May 14, 2026

Do you have approval from the maintainer to publish this?

@berkant-koc
Copy link
Copy Markdown
Contributor Author

Fair point — I should have given the maintainer time to acknowledge first. A private disclosure email has been sent to skilvingr@gmail.com (the public commit-email on the repo) and an upstream fix is open at skilvingr/rust-oneringbuf#3.

Closing this advisory PR; will reopen once the maintainer has had a chance to respond (or after a 30-day attempt window if no response). Thanks for the disclosure-process correction.

… advisory

- oneringbuf RUSTSEC: set patched = ">= 0.7.1", add fix reference (PR rustsec#3), update Notes section
- mutringbuf RUSTSEC: new parallel advisory for the archived predecessor (same bug, all versions yanked, migrate to oneringbuf >= 0.7.1)

Reopens rustsec#2883 per maintainer acknowledgement on
skilvingr/rust-oneringbuf#3 (2026-05-14).
@berkant-koc berkant-koc reopened this May 14, 2026
@berkant-koc
Copy link
Copy Markdown
Contributor Author

Reopening per maintainer acknowledgement from the upstream author.

Update:

  • Upstream fix PR skilvingr/rust-oneringbuf#3 was merged 2026-05-14.
  • oneringbuf 0.7.1 released on crates.io; all prior versions yanked.
  • mutringbuf (archived predecessor): all versions yanked.
  • Maintainer (Skilfingr) confirmed in PR thread that the RustSec advisory can proceed.

Changes in this PR commit (a4f4c12):

  • crates/oneringbuf/RUSTSEC-0000-0000.md: set patched = [">= 0.7.1"], add references = [PR #3], rewrite the Notes section as a Fix block with the upstream fix link.
  • crates/mutringbuf/RUSTSEC-0000-0000.md: new parallel advisory for the predecessor crate (per the maintainer's explicit ask to either flag-as-unmaintained or open a separate advisory — separate file is cleaner because the bug is identical and a single CVE-ID per crate matches RustSec convention).

The two crates share the same code paths but live in two crate identities on crates.io, so two separate advisories with cross-references is the conventional path. Happy to merge them into a single advisory file with two [[affected]] entries if you prefer that — let me know.

Comment thread crates/oneringbuf/RUSTSEC-0000-0000.md Outdated
Comment on lines +37 to +42
## Affected paths

- `src/ring_buffer/wrappers/unsafe_sync_cell.rs:10-16` — `Drop for UnsafeSyncCell<T>` invokes `assume_init_drop`.
- `src/ring_buffer/storage/heap/mod.rs:43-52` — `vmem`-branch `new` calls `vmem_helper::new(&value)` and lets `value` drop at function return.
- `src/ring_buffer/storage/heap/vmem_helper.rs:62-126` — `ptr::copy_nonoverlapping` produces bitwise duplicates.
- `src/ring_buffer/storage/heap/mod.rs:20-41` — `Drop for HeapStorage<T>` calls `drop_in_place` over the slice before `munmap`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section is too detailed for this advisory.

Comment thread crates/oneringbuf/RUSTSEC-0000-0000.md Outdated
Comment on lines +48 to +49
## Related: `mutringbuf` (predecessor crate)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is useful here.

…cted-paths and predecessor-crate sections

Per code review on rustsec#2883:

- Drop "## Affected paths" section: source-file line ranges (4 bullets)
  are too detailed for an advisory body — the upstream fix PR carries
  this information for anyone digging into the implementation.
- Drop "## Related: `mutringbuf` (predecessor crate)" section: the
  parallel mutringbuf advisory stands on its own and the cross-link
  here is redundant.

Body trimmed from 329 to 247 words. No content change to the technical
description, trigger, or fix block.
@berkant-koc
Copy link
Copy Markdown
Contributor Author

Done — both sections removed per your review (commit 2ffbca0):

  • ## Affected paths dropped (file-line pointers live in the upstream fix PR for anyone digging deeper).
  • ## Related: mutringbuf (predecessor crate) dropped (the parallel mutringbuf advisory file is self-contained).

Trimmed from 329 to 247 words. No edits to the technical description, trigger, or fix block. Ready when you are.

@djc djc merged commit 36078c5 into rustsec:main May 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants