Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionChristian Heimes
2019-11-20 11:15:30 UTC
Description of problem:
Python's internal CSPRNG for hash randomization and os.urandom() use the Kernel DRBG via the getrandom() syscall. The Kernel RNG is not (yet) FIPS compliant.
os.urandom() is the preferred source for cryptographically secure random data. It is used a lot, amongst others by 389-DS/RHDS, IPA/IdM, and Dogtag/RHCS. It would take too much effort the modify all Python libraries and applications to use a FIPS compliant RNG. Instead Python should be modified to handle FIPS compliance internally.
Version-Release number of selected component (if applicable):
python3-3.6.8-22.el8
How reproducible:
always
Steps to Reproduce:
1. strace -egetrandom python3 -c "import os; os.urandom(8)"
Actual results:
getrandom("...", 24, GRND_NONBLOCK) = 24
getrandom("...", 8, 0) = 8
Expected results:
getrandom syscall is not used by Python directly.
Additional info:
There is an ongoing effort to make the Kernel's DRBG FIPS compliant. However it is not clear if the goal can be archived in time for RHEL 8.2. Python can use OpenSSL's DRBG through RAND_bytes() API. The DRBG in OpenSSL 1.1.1 is fork-safe.
Created attachment 1638086[details]
Experimental patch for Python master
The patch adds RAND_bytes() as preferred RNG source for Python.
A patched Python calls getrandom() three times when OpenSSL initializes its DRBG. There may be more calls under FIPS. os.urandom() does not call getrandom() any more.
$ strace -e getrandom ./python -c "import os; os.urandom(8); os.urandom(8); os.urandom(8)"
getrandom("...", 16, 0) = 16
getrandom("...", 16, 0) = 16
getrandom("...", 16, 0) = 16
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2020:1764
Description of problem: Python's internal CSPRNG for hash randomization and os.urandom() use the Kernel DRBG via the getrandom() syscall. The Kernel RNG is not (yet) FIPS compliant. os.urandom() is the preferred source for cryptographically secure random data. It is used a lot, amongst others by 389-DS/RHDS, IPA/IdM, and Dogtag/RHCS. It would take too much effort the modify all Python libraries and applications to use a FIPS compliant RNG. Instead Python should be modified to handle FIPS compliance internally. Version-Release number of selected component (if applicable): python3-3.6.8-22.el8 How reproducible: always Steps to Reproduce: 1. strace -egetrandom python3 -c "import os; os.urandom(8)" Actual results: getrandom("...", 24, GRND_NONBLOCK) = 24 getrandom("...", 8, 0) = 8 Expected results: getrandom syscall is not used by Python directly. Additional info: There is an ongoing effort to make the Kernel's DRBG FIPS compliant. However it is not clear if the goal can be archived in time for RHEL 8.2. Python can use OpenSSL's DRBG through RAND_bytes() API. The DRBG in OpenSSL 1.1.1 is fork-safe.