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.
DescriptionPatrick Uiterwijk
2016-05-18 11:47:25 UTC
Description of problem:
When using python-cryptography in mod_wsgi, the call "cls.ffi.callback("void(int, int, const char *, int)", cls._lock_cb)" in cryptography/hazmat/bindings/openssl/binding.py requires an execmem permission, which httpd doesn't have.
Version-Release number of selected component (if applicable):
python-cryptography 0.8.2
How reproducible:
Consistent
Steps to Reproduce:
1 sestatus
2 yum install -y python-cffi mod_wsgi httpd python-cryptography
3 yum update -y
4 vi /etc/httpd/conf.d/test.conf
5 vi /usr/libexec/cryptotest
6 service httpd start
7 tail -f /var/log/httpd/error_log /var/log/audit/audit.log
test.conf:
WSGIScriptAlias / /usr/libexec/cryptotest
<Directory /usr/libexec>
Require all granted
</Directory>
cryptotest:
print 'Import fernet'
from cryptography.fernet import Fernet
key = Fernet.generate_key()
f = Fernet(key)
print 'Done with fernet'
Visit web server.
Actual results:
See 500 server error.
==> /var/log/httpd/error_log <==
[Tue May 17 12:40:23.225569 2016] [:error] [pid 22291] Import fernet
[Tue May 17 12:40:23.250668 2016] [core:notice] [pid 22287] AH00052: child pid 22290 exit signal Segmentation fault (11)
==> /var/log/audit/audit.log <==
type=AVC msg=audit(1463488824.018:187): avc: denied { execmem } for pid=22291 comm="httpd" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=process
Expected results:
404 (because the wsgi doesn't have an "application".
Additional info:
Moving the if not cls._lock_cb_handle: block after the if cls.lib.CRYPTO_get_locking_callback() != cls.ffi.NULL: block fixes the issue, because seemingly CPython ssl has its own locking.
Created attachment 1159018[details]
Delay locking callback patch for python-cryptography 0.8.3
The creation of the locking callback handler is delayed. With CPython the internal _ssl takes care of registering lock handlers.
Description of problem: When using python-cryptography in mod_wsgi, the call "cls.ffi.callback("void(int, int, const char *, int)", cls._lock_cb)" in cryptography/hazmat/bindings/openssl/binding.py requires an execmem permission, which httpd doesn't have. Version-Release number of selected component (if applicable): python-cryptography 0.8.2 How reproducible: Consistent Steps to Reproduce: 1 sestatus 2 yum install -y python-cffi mod_wsgi httpd python-cryptography 3 yum update -y 4 vi /etc/httpd/conf.d/test.conf 5 vi /usr/libexec/cryptotest 6 service httpd start 7 tail -f /var/log/httpd/error_log /var/log/audit/audit.log test.conf: WSGIScriptAlias / /usr/libexec/cryptotest <Directory /usr/libexec> Require all granted </Directory> cryptotest: print 'Import fernet' from cryptography.fernet import Fernet key = Fernet.generate_key() f = Fernet(key) print 'Done with fernet' Visit web server. Actual results: See 500 server error. ==> /var/log/httpd/error_log <== [Tue May 17 12:40:23.225569 2016] [:error] [pid 22291] Import fernet [Tue May 17 12:40:23.250668 2016] [core:notice] [pid 22287] AH00052: child pid 22290 exit signal Segmentation fault (11) ==> /var/log/audit/audit.log <== type=AVC msg=audit(1463488824.018:187): avc: denied { execmem } for pid=22291 comm="httpd" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=process Expected results: 404 (because the wsgi doesn't have an "application". Additional info: Moving the if not cls._lock_cb_handle: block after the if cls.lib.CRYPTO_get_locking_callback() != cls.ffi.NULL: block fixes the issue, because seemingly CPython ssl has its own locking.