]> Cypherpunks repositories - gostls13.git/commit
crypto/rand: prevent Read argument from escaping to heap
authorFilippo Valsorda <filippo@golang.org>
Thu, 1 Aug 2024 17:59:07 +0000 (19:59 +0200)
committerFilippo Valsorda <filippo@golang.org>
Mon, 7 Oct 2024 15:33:40 +0000 (15:33 +0000)
commit534d6a1a9c81b25bdad1052e736b2f072caa3903
tree0da2b5541cdcc781d39a8aa3d8df996a33fe22a2
parentc050d42e1a7d7b02b2205c116e8c98fc49aab6a9
crypto/rand: prevent Read argument from escaping to heap

Mateusz had this idea before me in CL 578516, but it got much easier
after the recent cleanup.

It's unfortunate we lose the test coverage of batched, but the package
is significantly simpler than when we introduced it, so it should be
easier to review that everything does what it's supposed to do.

Fixes #66779

Co-authored-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
Change-Id: Id35f1172e678fec184efb0efae3631afac8121d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/602498
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/crypto/rand/rand.go
src/crypto/rand/rand_batched_test.go [deleted file]
src/crypto/rand/rand_getentropy.go
src/crypto/rand/rand_js.go
src/crypto/rand/rand_test.go
src/internal/syscall/unix/getentropy_openbsd.go