<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi,<br>
<br>
On 06/01/21 18:10, Gimhani Uthpala wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAJ1bD4_Cx0MBrh9Uz-aQ4maZGfT+7ir0Np+dVeU=RM_W8_0JHQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div dir="ltr">Dear team,
<div>I'm running an application which uses openssl for secure
communication between processes. I am getting seg-faults at
openssl level. This only occurred very randomly and the
following are stacks that seg faults at openssl level in the
given 2 cases. We are using openssl 1.0.2k. </div>
<div><br>
</div>
</div>
</blockquote>
version 1.0.2k suggests you are using RHEL7/CentOS 7, correct? <br>
<blockquote type="cite"
cite="mid:CAJ1bD4_Cx0MBrh9Uz-aQ4maZGfT+7ir0Np+dVeU=RM_W8_0JHQ@mail.gmail.com">
<div dir="ltr">
<div>Went through the security vulnerabilities list for this
version but couldn't find a clue. Running valgrind too didn't
give an exact clue related to the issue. Can you please guide
me how can I find the exact root cause for the seg fault? </div>
<div><br>
</div>
<div>I am calling SSL_do_handshake(ssl_ctx) from my code level
and both the below seg faults are occuring from it's inside. </div>
<div><br>
</div>
<div>#0 0x00007fd64cdabdd3 in ASN1_item_verify () from
/lib64/libcrypto.so.10<br>
#1 0x00007fd64cdcac58 in internal_verify () from
/lib64/libcrypto.so.10<br>
#2 0x00007fd64cdccaef in X509_verify_cert () from
/lib64/libcrypto.so.10<br>
#3 0x00007fd64d111c68 in ssl_verify_cert_chain () from
/lib64/libssl.so.10<br>
#4 0x00007fd64d0e8cc6 in ssl3_get_client_certificate () from
/lib64/libssl.so.10<br>
<b>#5 0x00007fd64d0ea3f8 in ssl3_accept () from
/lib64/libssl.so.10</b><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</blockquote>
so the segfault occurs inside ASN1_item_verify () when verifying the
certificate - it could be a malformed certificate with invalid ASN1
encoding; do you have the certificate that causes the segfault?<br>
<br>
If you do not, then it is worthwhile recording/storing all
certificates until you find the one that causes the segfault and
then examine it.<br>
<br>
<br>
HTH,<br>
<br>
JJK<br>
</body>
</html>