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.
Bug 1697915 - Race/segmentation fault on process shutdown in OpenSSL
Summary: Race/segmentation fault on process shutdown in OpenSSL
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: openssl
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: rc
: 8.0
Assignee: Tomas Mraz
QA Contact: Daiki Ueno
URL:
Whiteboard:
Depends On: 1643026
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-09 10:01 UTC by Hubert Kario
Modified: 2020-11-14 13:01 UTC (History)
1 user (show)

Fixed In Version: openssl-1.1.1b-3.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-05 22:40:19 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:3700 0 None None None 2019-11-05 22:40:43 UTC

Description Hubert Kario 2019-04-09 10:01:24 UTC
Description of problem:
When process is shutting down, openssl sometimes crashes with segmentation fault.

Version-Release number of selected component (if applicable):
openssl-1.1.1-8.el8.x86_64

How reproducible:
common

Steps to Reproduce:
1. Run an application that reads a lot of data from openssl random
2. kill it with sigterm
3.

Actual results:
==29110== Memcheck, a memory error detector
==29110== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==29110== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==29110== Command: ./reproducer 40 32 0
==29110==
==29110==
==29110== Process terminating with default action of signal 15 (SIGTERM)
==29110==    at 0x4F9C115: aesni_init_key (e_aes.c:273)
==29110==    by 0x4FAC123: EVP_CipherInit_ex (evp_enc.c:233)
==29110==    by 0x4FE73AE: ctr_update (drbg_ctr.c:274)
==29110==    by 0x4FE75A4: drbg_ctr_generate (drbg_ctr.c:316)
==29110==    by 0x4FE8418: RAND_DRBG_generate (drbg_lib.c:626)
==29110==    by 0x4FE86AD: RAND_DRBG_bytes (drbg_lib.c:658)
==29110==    by 0x4009AD: runner (in /tmp/tmp.xCWicnu6ig/reproducer)
==29110==    by 0x531D2DD: start_thread (pthread_create.c:486)
==29110==    by 0x5631A62: clone (clone.S:95)
==29110== Thread 3:
==29110== Invalid read of size 8
==29110==    at 0x5B11539: check_free (dlerror.c:188)
==29110==    by 0x5B11A65: free_key_mem (dlerror.c:221)
==29110==    by 0x5B11A65: __dlerror_main_freeres (dlerror.c:239)
==29110==    by 0x56A2829: __libc_freeres (in /usr/lib64/libc-2.28.so)
==29110==    by 0x4A2B71E: _vgnU_freeres (vg_preloaded.c:77)
==29110==    by 0x730E62F: ???
==29110==  Address 0x72adfc8 is 12 bytes after a block of size 12 alloc'd
==29110==    at 0x4C30E8B: malloc (vg_replace_malloc.c:309)
==29110==    by 0x4FC2C3C: CRYPTO_zalloc (mem.c:232)
==29110==    by 0x4FBE9F5: ossl_init_get_thread_local (init.c:66)
==29110==    by 0x4FBE9F5: ossl_init_thread_start (init.c:426)
==29110==    by 0x4FE8EE9: RAND_DRBG_get0_public (drbg_lib.c:1029)
==29110==    by 0x4FE8F23: drbg_bytes (drbg_lib.c:941)
==29110==    by 0x4009AD: runner (in /tmp/tmp.xCWicnu6ig/reproducer)
==29110==    by 0x531D2DD: start_thread (pthread_create.c:486)
==29110==    by 0x5631A62: clone (clone.S:95)
==29110==
==29110== Invalid read of size 1
==29110==    at 0x5B11561: check_free (dlerror.c:189)
==29110==    by 0x5B11A65: free_key_mem (dlerror.c:221)
==29110==    by 0x5B11A65: __dlerror_main_freeres (dlerror.c:239)
==29110==    by 0x56A2829: __libc_freeres (in /usr/lib64/libc-2.28.so)
==29110==    by 0x4A2B71E: _vgnU_freeres (vg_preloaded.c:77)
==29110==    by 0x730E62F: ???
==29110==  Address 0x1000 is not stack'd, malloc'd or (recently) free'd
==29110==
==29110==
==29110== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==29110==  Access not within mapped region at address 0x1000
==29110==    at 0x5B11561: check_free (dlerror.c:189)
==29110==    by 0x5B11A65: free_key_mem (dlerror.c:221)
==29110==    by 0x5B11A65: __dlerror_main_freeres (dlerror.c:239)
==29110==    by 0x56A2829: __libc_freeres (in /usr/lib64/libc-2.28.so)
==29110==    by 0x4A2B71E: _vgnU_freeres (vg_preloaded.c:77)
==29110==    by 0x730E62F: ???
==29110==  If you believe this happened as a result of a stack
==29110==  overflow in your program's main thread (unlikely but
==29110==  possible), you can try to increase the size of the
==29110==  main thread stack using the --main-stacksize= flag.
==29110==
==29110== HEAP SUMMARY:
==29110==     in use at exit: 12,528 bytes in 28 blocks
==29110==   total heap usage: 3,550,390 allocs, 3,550,362 frees, 3,504,944,528 bytes allocated
==29110==
==29110== LEAK SUMMARY:
==29110==    definitely lost: 0 bytes in 0 blocks
==29110==    indirectly lost: 0 bytes in 0 blocks
==29110==      possibly lost: 544 bytes in 2 blocks
==29110==    still reachable: 11,984 bytes in 26 blocks
==29110==         suppressed: 0 bytes in 0 blocks
==29110== Rerun with --leak-check=full to see details of leaked memory
==29110==
==29110== For counts of detected and suppressed errors, rerun with: -v
==29110== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

Expected results:
Orderly shutdown

Additional info:
The issue should be fixed in upstream openssl-1.1.1b release

Comment 1 Tomas Mraz 2019-04-09 11:10:12 UTC
My testing of openssl-1.1.1b does not produce any SIGSEGVs with this test.

Comment 9 errata-xmlrpc 2019-11-05 22:40:19 UTC
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-2019:3700


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