build(deps): update rust crate rand to 0.9.0 [security]#83
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
build(deps): update rust crate rand to 0.9.0 [security]#83renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
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.
This PR contains the following updates:
0.8.5β0.9.0GitHub Vulnerability Alerts
GHSA-cq8v-f236-94qc
It has been reported (by @βlopopolo) that the
randlibrary is unsound (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:logandthread_rngfeatures are enabledrand::rng()(previouslyrand::thread_rng()) and calls anyTryRng(previouslyRngCore) methods onThreadRngThreadRng(attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)getrandomcrate) is unable to provide a new seedTryRng(previouslyRngCore) methods forThreadRnguseunsafecode to cast*mut BlockRng<ReseedingCore>to&mut BlockRng<ReseedingCore>. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of aliased mutable references is Undefined Behaviour, the behaviour of optimized builds is hard to predict.Affected versions of
randare>= 0.7, < 0.9.3and0.10.0.Release Notes
rust-random/rand (rand)
v0.9.3Compare Source
v0.9.2Compare Source
Deprecated
rand::rngs::mockmodule andStepRnggenerator (#β1634)Additions
WeightedIndex<usize>(de)serialization (#β1646)v0.9.1Compare Source
Security and unsafe
zerocopydependency fromrand(#β1579)Fixes
simd_supportfor recent nightly rust (#β1586)Changes
fn rand::seq::index::sample_weightedandfn IndexedRandom::choose_multiple_weightedto return fewer thanamountresults (#β1623), reverting an undocumented change (#β1382) to the previous release.Additions
rand::distr::Alphabeticdistribution. (#β1587)rand_core(#β1604)v0.9.0Compare Source
Security and unsafe
ReseedingRngandThreadRng. Instead, it is recommended to callThreadRng::reseedon fork. (#β1379)zerocopyto replace someunsafecode (#β1349, #β1393, #β1446, #β1502)Dependencies
--ignore-rust-versionrand_corev0.9.0 (#β1558)Features
stdfeature withoutgetrandomorrand_chacha(#β1354)small_rngby default (#β1455)rand_chacha; usestd_rnginstead. (#β1473)serde1toserde(#β1477)getrandomtoos_rng(#β1537)thread_rng(#β1547)API changes: rand_core traits
RngCore::read_adapterimplementingstd::io::Read(#β1267)CryptoBlockRng: BlockRngCore; maketrait CryptoRng: RngCore(#β1273)TryRngCore,TryCryptoRng(#β1424, #β1499)fn SeedableRng::from_rng->try_from_rngand add infallible variantfn from_rng(#β1424)fn SeedableRng::from_entropy->from_os_rngand add fallible variantfn try_from_os_rng(#β1424)CloneandAsRefto associated typeSeedableRng::Seed(#β1491)API changes: Rng trait and top-level fns
rand::thread_rng()torand::rng()and remove from the prelude (#β1506)rand::random()from the prelude (#β1506)random_iter,random_range,random_bool,random_ratio,fill(#β1488)Rng::gen_iterasrandom_iter(#β1305, #β1500)Rng::gentorandomto avoid conflict with the newgenkeyword in Rust 2024 (#β1438)Rng::gen_rangetorandom_range,gen_booltorandom_bool,gen_ratiotorandom_ratio(#β1505)#[track_caller](#β1442, #β1447)API changes: RNGs
<SmallRng as SeedableRng>::Seedsize to 256 bits (#β1455)rng) ofReseedingRng::new(#β1533)API changes: Sequences
SliceRandomintoIndexedRandom,IndexedMutRandom,SliceRandom(#β1382)IndexedRandom::choose_multiple_array,index::sample_array(#β1453, #β1469)API changes: Distributions: renames
rand::distributionstorand::distr(#β1470)StandardtoStandardUniform(#β1526)distr::Slice->distr::slice::Choose,distr::EmptySlice->distr::slice::Empty(#β1548)distr::DistString->distr::SampleString(#β1548)distr::DistIter->distr::Iter,distr::DistMap->distr::Map(#β1548)API changes: Distributions
Sizedbound onDistribution<T> for &D(#β1278)Distribution<Option<T>>forStandardUniform(#β1526)StandardUniformsupport allNonZero*types (#β1332){Uniform, UniformSampler}::{new, new_inclusive}return aResult(instead of potentially panicking) (#β1229)UniformimplementsTryFrominstead ofFromfor ranges (#β1229)UniformUsize(#β1487)isizeandusizevalues withStandardUniform,Uniform(except viaUniformUsize) andFilland usage as aWeightedAliasIndexweight (#β1487)DistStringfor distributionsSlice<char>andUniform<char>(#β1315)Slice::num_choices(#β1402)p()for distributionBernoullito access probability (#β1481)API changes: Weighted distributions
pubmodulerand::distr::weighted, movingWeightedIndexthere (#β1548)weighted::Weight, allowingWeightedIndexto trap overflow (#β1353)weight, weights, total_weightto distributionWeightedIndex(#β1420)WeightedErrortoweighted::Error, revising variants (#β1382) and mark as#[non_exhaustive](#β1480)API changes: SIMD
std::simd, expand SIMD & docs (#β1239)Reproducibility-breaking changes
ReseedingRng::reseeddiscard remaining data from the last block generated (#β1379)SmallRng::seed_from_u64implementation (#β1203)UniformFloat::newsamples andUniformFloat::sample_singleto yieldhigh(#β1462)Slice(#β1469)Uniformforusizeportable viaUniformUsize(#β1487)IndexdRandom::choose_multiple_weightedfor very small seeds and optimize for large input length / low memory (#β1530)Reproducibility-breaking optimisations
sample_floyd, affecting output ofrand::seq::index::sampleandrand::seq::SliceRandom::choose_multiple(#β1277)IteratorRandom::chooseandchoose_stable(#β1268)SliceRandom::shuffleandpartial_shuffle(#β1272)Uniform: use Canon's method (single sampling) / Lemire's method (distribution sampling) for faster sampling (breaks value stability; #β1287)sample_single_inclusivefor floats (+~20% perf) (#β1289)Other optimisations
SmallRnginitialization performance (#β1482)Other
Cargo.lock.msrvfile (#β1275)rustfmtand enforce (#β1448)benchescrate (#β1329, #β1439) and migrate to Criterion (#β1490)Documentation
ThreadRngrelated docs (#β1257)--generate-link-to-definitionfeature (#β1327)doc_auto_cfg(#β1411, #β1450)Configuration
π Schedule: (UTC)
π¦ Automerge: Enabled.
β» Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.