Bug 1293703 - python requires /dev/urandom making it harder to rescue broken systems
Summary: python requires /dev/urandom making it harder to rescue broken systems
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 23
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Charalampos Stratakis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1350123
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-22 18:26 UTC by Joseph Shraibman
Modified: 2016-12-20 17:18 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 17:18:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Joseph Shraibman 2015-12-22 18:26:17 UTC
Description of problem:
If I chroot into a Fedora 23 install and try to run dnf update it does not work.

[root@jks-desktop /]{f23}# dnf update
Fatal Python error: Failed to open /dev/urandom
Aborted (core dumped)

This makes it harder to fix broken installs.  This was not a problem for yum on Fedora 20.

Version-Release number of selected component (if applicable):
dnf-1.1.4-2.fc23.noarch


How reproducible:
Always

Steps to Reproduce:
1. chroot to a Fedora 23 install root partition
2. Run: dnf update
3.

Comment 1 Fedora Admin XMLRPC Client 2016-01-29 13:05:58 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 2 Praveen Kumar 2016-09-16 10:10:21 UTC
Steps to Reproduce

1. # supermin -v --prepare dnf bash -o /tmp/supermin.d
2. # sudo supermin --build --format chroot -o /tmp/appliance.d /tmp/supermin.d
3. # chroot /tmp/appliance.d/
4. bash-4.3# dnf clean all
Fatal Python error: Failed to open /dev/urandom
Segmentation fault (core dumped)

Comment 3 Petr Viktorin (pviktori) 2016-09-16 11:30:59 UTC
The failure is due to initializing a random hash seed to prevent a security vulnerability (CVE-2012-1150).

== Workaround ==

Since protection from DoS attacks is not too important when repairing a broken system, you can turn hash randomization off. To do this, set the environment variable PYTHONHASHSEED=0 .

    $ sudo mv /dev/urandom /dev/urandom~
    $ python3
    Fatal Python error: Failed to open /dev/urandom
    Segmentation fault (core dumped)
    $ PYTHONHASHSEED=0 python3
    Python 3.5.1 (default, Aug  9 2016, 15:35:51) 
    [GCC 6.1.1 20160621 (Red Hat 6.1.1-3)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 

This only fixes hash randomization: if DNF itself needs randomness later, it will fail even with the workaround.


== Future Solution ==

This will be fixed in Python 3.6, assuming problems with the getrandom syscall in Fedora/Koji are solved. From the PEP 524:

* Add a new private _PyOS_URandom_Nonblocking() function: try to call getrandom(size, GRND_NONBLOCK) on Linux and Solaris, but falls back on reading /dev/urandom if it fails with EAGAIN . 
* Initialize hash secret from non-blocking system urandom: _PyRandom_Init() is modified to call _PyOS_URandom_Nonblocking() . 

Since there's a workaround, I don't think fixing systems with non-functional /dev/urandom is a good enough reason to backport the change.

Tomáš, please block this by an appropriate getrandom bug.

Comment 4 Fedora End Of Life 2016-11-24 14:27:45 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2016-12-20 17:18:53 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.