git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] reftable/stack: stop dying on exhausted entropy pool

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jan 8, 2025, 22:44 UTC
Message-ID
<Z37_4hoUgeVd3p9x@tapette.crustytoothpaste.net>
In-Reply-To
<Z34m1HRLAeEszXDG@pks.im>
On 2025-01-08 at 07:18:52, Patrick Steinhardt wrote:
Show 16 quoted lines
> You reported in [1] that a couple more tests are indeed failing, not
> only t0610. That changes things in my opinion as it shows that this is
> not a localized issue in the reftable library, but likely in multiple
> callsites where we use randomness. So my current patch series is not
> sufficient as it only fixes up the reftable codebase. But in the case
> where it's a general issue I tend to agree with brian, because I don't
> want to play whack-a-mole with all the callsites of `git_rand()` where
> we can indeed use insecure bytes.
> 
> Honestly, this rather makes me want to remove the OpenSSL backend for
> our CSRNG completely. NonStop is the only platform that uses it right
> now, and it seems to be easy to misconfigure. All the other backends we
> have don't have the same issue as explained further up in my message. So
> does NonStop support any of the alternative backends that Git has, like
> `arc4random_buf()`, `getrandom()`, `getentropy()` or reading from
> "/dev/urandom"?

OpenSSL's backend is only as good as the system entropy source, which, apparently in the case of PRNGD, is not very good. The last release of PRNGD was in 2007 apparently, so I don't think we should hold our breath for a fix.

Or, of course, it could be simply that prngd works just fine and there aren't enough sources for it. If the machine has an analog microphone input that isn't plugged in, streaming some data from that might be a good source, since that will be noisy. A second of recording signed 16-bit PCM data as 48 kHz might provide at least 64 bits of entropy[0].

I will say that libbsd provides a fallback implementation for its getentropy code, which would allow the use of arc4random as a backend. I know there were some portability problems with getting that to run on NonStop, and of course I provide no guarantees about its suitability or security, but it does appear that there is some alternative if the porting problems can be overcome. We explicitly have support for libbsd in the Makefile already.

That doesn't avoid the problem of TLS and SSH not working, but it may get the tests passing.

[0] That's 750 samples per bit of entropy, which I think should be reasonably conservative.

-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
Previous: rsbecker@nexbridge.com
Message 19 of 19 in “reftable/stack: stop dying on exhausted entropy pool”
  1. 0/2 reftable/stack: stop dying on exhausted entropy poolPatrick Steinhardt, Jan 7, 2025
  2. 1/2 wrapper: allow generating insecure random bytesPatrick Steinhardt, Jan 7, 2025
  3. 2/2 reftable/stack: accept insecure random bytesPatrick Steinhardt, Jan 7, 2025
  4. rsbecker@nexbridge.comJan 7, 2025
  5. Junio C HamanoJan 7, 2025
  6. rsbecker@nexbridge.comJan 7, 2025
  7. Junio C HamanoJan 7, 2025
  8. Junio C HamanoJan 7, 2025
  9. Patrick SteinhardtJan 8, 2025
  10. Junio C HamanoJan 8, 2025
  11. Patrick SteinhardtJan 8, 2025
  12. Junio C HamanoJan 8, 2025
  13. Patrick SteinhardtJan 8, 2025
  14. rsbecker@nexbridge.comJan 7, 2025
  15. brian m. carlsonJan 7, 2025
  16. rsbecker@nexbridge.comJan 7, 2025
  17. Patrick SteinhardtJan 8, 2025
  18. rsbecker@nexbridge.comJan 8, 2025
  19. brian m. carlsonJan 8, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.