<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 7, 2021 at 1:51 PM Jan Just Keijser <<a href="mailto:janjust@nikhef.nl">janjust@nikhef.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<div>Hi,<br>
<br>
On 06/01/21 18:10, Gimhani Uthpala wrote:<br>
</div>
<blockquote type="cite">
<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></div></blockquote><div><br></div><div>Yes, I am using RHEL7 and using its openssl version 1.0.2k-fips.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
<blockquote type="cite">
<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? </div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
<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></div></blockquote><div> </div><div>I do not have access to the certificate that caused segfault. Will try to record all certs to check this, Thanks. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
<br>
<br>
HTH,<br>
<br>
JJK<br>
</div>
</blockquote></div><br clear="all"><div><br></div><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><b></b></div></div><span></span></div></div></div></div></div></div></div></div></div>