2.7.4 — diff review from 2.7.2 only (current)
From google/supply-chain copy of chromium. Audited without comment by Dustin J. Mitchell.
These reviews are from cargo-vet. To add your review, set up cargo-vet
and submit your URL to its registry.
2.7.4 — diff review from 2.7.2 only (current)
From google/supply-chain copy of chromium. Audited without comment by Dustin J. Mitchell.
2.7.4 — diff review from 2.7.2 only (current)
From zcash/rust-ecosystem copy of zcash/librustzcash. Audited without comment by str4d.
The current version of Memchr is 2.7.4.
2.7.2 (older version)
From google/supply-chain copy of chromium. Audited without comment by Ying Hsu.
2.7.2 — diff review from 2.7.1 only (older version)
From zcash/rust-ecosystem copy of zcash/zcash. Audited without comment by Daira Emma Hopwood.
2.7.1 — diff review from 2.6.4 only (older version)
From zcash/rust-ecosystem copy of zcash/zcash. By str4d.
2.7.1 (older version)
From kornelski/crev-proofs copy of git.savannah.gnu.org.
Packaged for Guix (crates-io)
2.6.3 (older version)
From google/supply-chain copy of chromium. Audited without comment by George Burgess IV.
2.6.3 (older version)
From google/supply-chain copy of google/rust-crate-audits. By Manish Goregaokar.
Reviewed in CL 563868651 Second review would be appreciated.
2.4.1 (older version)
From google/supply-chain copy of chromium. Audited without comment by ChromeOS.
2.4.0 (older version)
From google/supply-chain copy of chromium. Audited without comment by Android Legacy.
cargo-vet does not verify reviewers' identity. You have to fully trust the source the audits are from.
This crate can be compiled, run, and tested on a local workstation or in controlled automation without surprising consequences. More…
Inspection reveals that the crate in question does not attempt to implement any cryptographic algorithms on its own.
Note that certification of this does not require an expert on all forms of cryptography: it's expected for crates we import to be "good enough" citizens, so they'll at least be forthcoming if they try to implement something cryptographic. When in doubt, please ask an expert.
All crypto algorithms in this crate have been reviewed by a relevant expert.
Note: If a crate does not implement crypto, use does-not-implement-crypto
,
which implies crypto-safe
, but does not require expert review in order to
audit for.
Negligible unsoundness or average soundness.
Full description of the audit criteria can be found at https://github.com/google/rust-crate-audits/blob/main/auditing_standards.md#ub-risk-2
Mild unsoundness or suboptimal soundness.
Full description of the audit criteria can be found at https://github.com/google/rust-crate-audits/blob/main/auditing_standards.md#ub-risk-3
Extreme unsoundness.
Full description of the audit criteria can be found at https://github.com/google/rust-crate-audits/blob/main/auditing_standards.md#ub-risk-4
This crate will not introduce a serious security vulnerability to production software exposed to untrusted input. More…
May have been packaged automatically without a review
These reviews are from Crev, a distributed system for code reviews. To add your review, set up cargo-crev
.
The current version of Memchr is 2.7.4.
2.7.1 (older version) Thoroughness: Low Understanding: Medium
by weiznich on 2024-02-29
Review update from 2.6.4 to 2.7.1
2.2.1 (older version) Thoroughness: High Understanding: High
by BurntSushi on 2019-08-22
I wrote this crate, so this review is a reflection as a result of writing the code and then reviewing it again for this review.
The entire purpose of the memchr crate is to do this:
haystack.iter().position(|&b| b == needle)
... but really fast. As a result, this crate uses SIMD via CPU specific vendor intrinsics. Consequently, there is a lot of unsafe code in this crate. There is really no way to avoid this, other than perhaps using a higher level platform independent SIMD API. But no such thing of sufficient quality exists for stable Rust at the time of writing.
The testing strategy is the most important bit here. In particular, every public API item is tested using a permutation of tests that exercise all possible alignments found in a haystack. (Because the implementations used aligned loads/stores, which are only correct if the address arithmetic is correct.) Additionally, there are quickcheck tests that act as a sort of fuzzer guaranteeing that the implementation is correct for a range of inputs.
I gave the highest rating possible because of the extensive use this crate has seen, in addition to its level of testing. In particular, memchr underlies a significant chunk of all text search in the Rust ecosystem.
2.1.2 (older version) Thoroughness: Low Understanding: Medium
by HeroicKatora on 2019-08-30
Not sure about the strict correctness of memrchr under stacked borrows but the forward functions definitely seem fine. That said, miscompilation seems unlikely since stacked borrows is more aggressive than llvm's noalias and raw pointers do not receive that tag anyways.
Lib.rs has been able to verify that all files in the crate's tarball are in the crate's repository with a git tag matching the version. Please note that this check is still in beta, and absence of this confirmation does not mean that the files don't match.
Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories, so there is a possibility that published crates have a misleading repository URL, or contain different code from the code in the repository.
To review the actual code of the crate, it's best to use cargo crev open memchr
. Alternatively, you can download the tarball of memchr v2.7.4 or view the source online.
Change to an
unsafe fn
is to rework the short-tail handling of a fixed-length comparison betweenu8
pointers. The new tail code matches the existing head code (but adapted tou16
andu8
reads, instead ofu32
).