Skip to content

Fix unsound rand rustsec 2026 0097#831

Open
waxspin wants to merge 2 commits into
pendulum-project:mainfrom
waxspin:fix-unsound-rand-RUSTSEC-2026-0097
Open

Fix unsound rand rustsec 2026 0097#831
waxspin wants to merge 2 commits into
pendulum-project:mainfrom
waxspin:fix-unsound-rand-RUSTSEC-2026-0097

Conversation

@waxspin
Copy link
Copy Markdown

@waxspin waxspin commented May 22, 2026

Upgrade rand 0.8 → 0.9 (mitigates RUSTSEC-2026-0097)

Bumps rand from 0.8.5 to 0.9.4 to resolve the advisory flagged in the previous commit. Adapts all call sites to the breaking API changes in rand 0.9.

API changes

Old (0.8) New (0.9)
rand::distributions::Open01 rand::distr::Open01
SeedableRng::from_entropy() SeedableRng::from_os_rng()
rand::rngs::mock::StepRng local MockRng (see below)

from_os_rng() requires the os_rng feature in rand_core, exposed as rand's own os_rng feature — added to statime-linux's dependency.

MockRng

rand::rngs::mock::StepRng was deprecated in 0.9 without replacement. Rather than suppress the warning, a minimal MockRng(u64) implementing RngCore is added to the test module. The RNG is only used to produce timing jitter in delay
requests, so the specific values don't affect test correctness.

Test results

74 unit tests + 13 doctests pass with no warnings.

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