svn commit: r338816 - in projects/openssl111: secure/lib/libcrypto share/mk

Jung-uk Kim jkim at FreeBSD.org
Thu Sep 20 17:41:33 UTC 2018


On 18. 9. 20., Konstantin Belousov wrote:
> On Thu, Sep 20, 2018 at 08:16:02AM -0500, Benjamin Kaduk wrote:
>> On Thu, Sep 20, 2018 at 5:10 AM Konstantin Belousov <kostikbel at gmail.com>
>> wrote:
>>
>>> On Thu, Sep 20, 2018 at 12:20:04AM +0000, Jung-uk Kim wrote:
>>>> Author: jkim
>>>> Date: Thu Sep 20 00:20:04 2018
>>>> New Revision: 338816
>>>> URL: https://svnweb.freebsd.org/changeset/base/338816
>>>>
>>>> Log:
>>>>   Link libcrypto with pthread.
>>> Why ?
>>>
>>>
>> It uses pthread_once and pthread locks.
> So what ?  libc provides the stubs.

Historically, OpenSSL was okay without pthread because native
implementation wasn't provided and users had to provide native callback
functions instead.

https://www.openssl.org/docs/man1.0.2/crypto/threads.html

In fact, "objdump -T /lib/libcrypto.so.8 | grep pthread_" returns
nothing.  dwmalone discovered it and committed r127643 about 14 years ago.

https://svnweb.freebsd.org/changeset/base/127643

Now OpenSSL 1.1 actually uses POSIX pthread.  Please see the blog post
for the rationale:

https://www.openssl.org/blog/blog/2017/02/21/threads/

Unfortunately, our stubs are not enough or broken somehow, i.e., some
functions malfunction without pthread.

FYI, OpenSSL 1.1.1 requires the following functions now:

pthread_atfork(3)
pthread_equal(3)
pthread_getspecific(3)
pthread_key_create(3)
pthread_key_delete(3)
pthread_once(3)
pthread_rwlock_destroy(3)
pthread_rwlock_init(3)
pthread_rwlock_rdlock(3)
pthread_rwlock_unlock(3)
pthread_rwlock_wrlock(3)
pthread_self(3)
pthread_setspecific(3)

If you have a functional patch for libc stubs, I'll be more than happy
to revert it.

Jung-uk Kim

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-projects/attachments/20180920/7fea0d4c/attachment.sig>


More information about the svn-src-projects mailing list