[tor-bugs] #26040 [Core Tor/Tor]: Improve getrandom handling
Tor Bug Tracker & Wiki
blackhole at torproject.org
Sun May 20 04:46:22 UTC 2018
#26040: Improve getrandom handling
--------------------------+------------------------------------
Reporter: Hello71 | Owner: Hello71
Type: enhancement | Status: needs_revision
Priority: Medium | Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: catalyst | Sponsor:
--------------------------+------------------------------------
Comment (by cypherpunks):
Replying to [comment:5 Hello71]:
> Hm... I see, you are correct. I really really hope that nowadays
everybody has random seed persistence, but it is of course better to be
conservative here.
Unfortunately, the random seed takes quite some time (on the order of
minutes) to actually take effect. The seed is written to the non-blocking
character device which triggers the `random_write` file operation which
uses `write_pool` to send the data to the input pool. Unfortunately it can
take a while for the secondary pools to receive the seed, since they have
to wait for the `push_to_pool` workqueue function to be triggered. On
newer Linux kernels (using ChaCha20 rather than SHA-1 for the non-blocking
character device), the input pool is queried every 5 minutes, and it only
reseeds the stream cipher if more than 128 bits of entropy have been
collected in the input pool since the last reseed.
If you do not check for `EINTR` (and avoid the blocking behavior
altogether), then even if you are using a persistent random seed, you will
end up obtaining potentially predictable random data.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26040#comment:12>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list