Changes between Initial Version and Version 1 of Ticket #26040, comment 12


Ignore:
Timestamp:
May 20, 2018, 4:49:02 AM (7 months ago)
Author:
cypherpunks
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26040, comment 12

    initial v1  
    55
    66If 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.
     7
     8Replying to [comment:11 catalyst]:
     9> When thinking about how to describe the user-visible parts of this change, I realized that the previous code would loop on `EINTR`, while the patch causes a failure and disables `getrandom()` thereafter.  This is unlikely to be a problem in practice, because libevent seems to always set `SA_RESTART`, which should prevent us from getting `EINTR`.
     10
     11It would be foolish to rely on a library's current behavior if it's not explicitly standardized.
     12
     13> Maybe we should mention this in the changes file.  On the other hand, maybe the conservative and likely harmless thing to do is to leave the existing loop as it is, even if it doesn't ever end up looping.  If we restore the loop, I think the remaining parts of the patch are some comment improvements and handling of a (also unlikely) short-read condition.
     14
     15It would be completely harmless. You can even use LTO to allow the compiler to optimize the loop out.