[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

Donald Stufft report at bugs.python.org
Tue Jun 7 13:52:01 EDT 2016


Donald Stufft added the comment:

> I don't follow whose patch does what.  But here's what I find acceptable, from a high level.
> 
> * The semantics as presented by the documentation must be preserved.  os.urandom() and other operations that declare they're safe for cryptographic use must remain safe for cryptographic use.
> * "import random" must not block.
> * "import hashlib" must not block.
>
> Is there a patch set that accomplishes that?

I *think* nonblocking_urandom_noraise.patch will solve the 90+ second start up without affecting os.urandom which should solve the first one (once the already applied patch gets reverted), but I'm afraid I don't know C well enough to meaningfully review that for accuracy.

None of the current patches solve the second without invalidating the first, but it would be, I believe, an additional patch ontop of nonblocking_urandom_noraise.patch.

The third is already the case.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26839>
_______________________________________


More information about the Python-bugs-list mailing list