Bump lru dependency from 0.16.3 to 0.18.2 - #962
Open
ShanireZ wants to merge 1 commit into
Open
Conversation
RUSTSEC-2026-0253 reports a potential use-after-free in LruCache::pop() caused by a lack of panic safety; all versions before 0.18.2 are affected. This moves every crate in the workspace onto the first fixed release. lru 0.17 and later declare rust-version = 1.85.0, which matches this repository's MSRV floor, so no MSRV change is required. No source changes are needed: cargo check --workspace passes unmodified. Signed-off-by: Shanire <shanire86@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the workspace-wide lru crate version to move Pingora’s in-tree crates off the RustSec advisory range for RUSTSEC-2026-0253, without requiring source changes elsewhere in the workspace.
Changes:
- Bump
[workspace.dependencies] lrufrom0.16.3(resolving to0.16.4) to0.18.2.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Refs #961
[workspace.dependencies] lru = "0.16.3"resolves to0.16.4, whichRUSTSEC-2026-0253 flags for a potential
use-after-free caused by a lack of panic safety in
LruCache::pop().0.18.2is the first fixedrelease (lru-rs#238).
This is a one-line change. It moves
pingora-cache,pingora-core,pingora-lru,pingora-poolandTinyUFOonto0.18.2; no source changes are required.MSRV is unaffected, but the headroom is now gone.
lru0.17 and later declarerust-version = 1.85.0, exactly the MSRV floor in thebuild.ymlmatrix; 0.16.x declared 1.70.0. Sothis passes today, and it would have to be revisited if the floor were ever lowered below 1.85.0.
This does not silence
cargo audit. Everylrubelow0.18.2is in the advisory's range, andaws-sdk-s3brings in its own. It is an optional dependency ofpingora-runtime, reachable onlythrough the non-default
dial9-worker-s3feature —cargo tree -i aws-sdk-s3 --workspacefindsnothing on a default build — but it is in the lock file, and the lock file is what
cargo auditscans. Measured with the audit job's own lock (
cargo generate-lockfile --ignore-rust-version):lruin lockcargo auditmaintoday0.16.40.16.4+0.18.2That edge is outside this repository's control. The point of this change is that pingora's own crates
(
pingora-cache,pingora-core,pingora-lru,pingora-pool,TinyUFO) stop using an affectedversion.
Verification
Commands taken from
build.yml; run againstmain(0046038) with this patch applied:cargo fmt --all -- --checkcargo check --workspace(1.97.1)cargo +1.85.0 check --workspace --exclude pingora-foundationscargo clippy --all-targets --all -- --allow=unknown-lints --deny=warningscargo machetecargo auditcargo test --lib --bins --tests --no-fail-fastmain, 117 with this patch, in my environment (the integration tests need openresty, which I did not install; a few network-dependent unit tests fail too). The one extra is not a regression — see below.I could not reproduce a clean test run locally because I did not install openresty, so that row is a
before/after comparison rather than an absolute pass — CI will give the real answer.
About the one extra test failure
My before/after comparison is not a clean "identical failure set": the patched run had one more
failure,
pingora-memory-cache'stests::test_eviction. Two independent reasons it is not caused bythis change:
main. Running that crate's lib test binary 20 times on eachside: 1 failure in 20 on
main, 1 failure in 20 with the patch. Same rate.lru.pingora-memory-cachedoes not depend onlru; it caches throughTinyUFO, whose library code does not uselrueither —lruis a dev-dependency there, used byits benchmarks.
That flakiness is already tracked upstream — #591 reports it, and #740 proposes a fix (using
force_putso the insert is not subject to TinyLFU admission). Unrelated to this PR; noting it hereonly to explain the extra failure in the table above.
One note on running the MSRV leg locally, in case it saves someone time:
cargo checkhas to be runagainst a normally generated lock file. Reusing the
--ignore-rust-versionlock from the audit stepmakes the 1.85.0 leg fail with
s2n-tls requires rustc 1.91, which has nothing to do with thischange — it reproduces identically on unmodified
main.