Skip to content

MvccRwLock allows data races & aliasing violations

Moderate severity GitHub Reviewed Published Aug 25, 2021 to the GitHub Advisory Database • Updated Jan 9, 2023
Withdrawn This advisory was withdrawn on Aug 24, 2021

Package

cargo noise_search (Rust)

Affected versions

<= 0.7.0

Patched versions

None

Description

Affected versions of the noise_search crate unconditionally implement Send/Sync for MvccRwLock.
This can lead to data races when types that are either !Send or !Sync (e.g. Rc<T>, Arc<Cell<_>>) are contained inside MvccRwLock and sent across thread boundaries. The data races can potentially lead to memory corruption (as demonstrated in the PoC from the original report issue).

Also, safe APIs of MvccRwLock allow aliasing violations by allowing &T and LockResult<MutexGuard<Box<T>>> to co-exist in conflicting lifetime regions. The APIs of MvccRwLock should either be marked as unsafe or MbccRwLock should be changed to private or pub(crate).

References

Reviewed Aug 9, 2021
Withdrawn Aug 24, 2021
Published to the GitHub Advisory Database Aug 25, 2021
Last updated Jan 9, 2023

Severity

Moderate

Weaknesses

CVE ID

No known CVE

GHSA ID

GHSA-mgg8-9pvp-6qcw

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.