Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Sep 2018 13:41:26 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>, Benjamin Kaduk <bjkfbsd@gmail.com>
Cc:        svn-src-projects@freebsd.org, src-committers <src-committers@freebsd.org>, John Baldwin <jhb@freebsd.org>
Subject:   Re: svn commit: r338816 - in projects/openssl111: secure/lib/libcrypto share/mk
Message-ID:  <08a628fe-e640-7804-7c54-de9fdc407c7d@FreeBSD.org>
In-Reply-To: <20180920131952.GZ3161@kib.kiev.ua>
References:  <201809200020.w8K0K45h000526@repo.freebsd.org> <20180920100939.GU3161@kib.kiev.ua> <CAJ5_RoBnqMwb=9uZrsC%2Bf3p1X5PWrKY8A=RJVNVujmC=VkzWsA@mail.gmail.com> <20180920131952.GZ3161@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--5sKM4ShNQUwFJ6mVqOSkRqBwMFeDEOwdz
Content-Type: multipart/mixed; boundary="SYCygdmBryqEwtMPxZRQ11jqWZ5oAY3CQ";
 protected-headers="v1"
From: Jung-uk Kim <jkim@FreeBSD.org>
To: Konstantin Belousov <kostikbel@gmail.com>,
 Benjamin Kaduk <bjkfbsd@gmail.com>
Cc: svn-src-projects@freebsd.org, src-committers
 <src-committers@freebsd.org>, John Baldwin <jhb@freebsd.org>
Message-ID: <08a628fe-e640-7804-7c54-de9fdc407c7d@FreeBSD.org>
Subject: Re: svn commit: r338816 - in projects/openssl111:
 secure/lib/libcrypto share/mk
References: <201809200020.w8K0K45h000526@repo.freebsd.org>
 <20180920100939.GU3161@kib.kiev.ua>
 <CAJ5_RoBnqMwb=9uZrsC+f3p1X5PWrKY8A=RJVNVujmC=VkzWsA@mail.gmail.com>
 <20180920131952.GZ3161@kib.kiev.ua>
In-Reply-To: <20180920131952.GZ3161@kib.kiev.ua>

--SYCygdmBryqEwtMPxZRQ11jqWZ5oAY3CQ
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

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@gmail.c=
om>
>> 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=
=2E

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


--SYCygdmBryqEwtMPxZRQ11jqWZ5oAY3CQ--

--5sKM4ShNQUwFJ6mVqOSkRqBwMFeDEOwdz
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAluj28wACgkQfJ+WJvzb
8UY2LAf+NKOnKk/IzKJIrxQyLnuidfwOmb8qKobANtit60gCu7uFKFblIY4XUIhX
qVNANmEpWaB4kv86suzOjShYLuPdWdAEUCktSt+89HzeBaE2GehU81OBwx5tV4n8
FvCHUNCSbsRC3BLC0UGSu+CdNkflzF5cPjchvdbMNCsZ7kMi9ounzrlmehyAq5bZ
uU971wkuAnPHnVuH05gxL7yy5dXOYy3F6ei9tmQ5cUJnfv8NvK3PEzbasrEmmXGn
v3pAIcqivrTFynNMgaUd57bnjfhUNe0+xhQ9DMVGdl3v3Jyb612fZSE7SPSmKYdT
niZwc8Wy+cRos+6XI+BkdfxZrZKoDQ==
=3xF+
-----END PGP SIGNATURE-----

--5sKM4ShNQUwFJ6mVqOSkRqBwMFeDEOwdz--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?08a628fe-e640-7804-7c54-de9fdc407c7d>