Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMOcT-0006IS-2w for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Oct 2019 03:44:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iMOcR-0006A8-Pa for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Oct 2019 03:44:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMOcR-0006A1-IU for pgsql-bugs@lists.postgresql.org; Mon, 21 Oct 2019 03:44:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMOcO-0000XV-Ub for pgsql-bugs@lists.postgresql.org; Mon, 21 Oct 2019 03:44:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9L3iPlK015039; Sun, 20 Oct 2019 23:44:25 -0400 From: Tom Lane To: Michael Paquier cc: wurongxin@xmu.edu.cn, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16070: A double-free bug in interfaces/libpq/fe-secure-openssl.c In-reply-to: <20191021032537.GG1542@paquier.xyz> References: <16070-ffac944519a43c3f@postgresql.org> <13213.1571581031@sss.pgh.pa.us> <20191021032537.GG1542@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Mon, 21 Oct 2019 12:25:37 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15037.1571629465.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 20 Oct 2019 23:44:25 -0400 Message-ID: <15038.1571629465@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > The docs of OpenSSL mention the use of both successively, where > ENGINE_free() does the cleanup after ENGINE_by_id(), and > ENGINE_finish() cleans up after ENGINE_init(): > https://www.openssl.org/docs/man1.1.0/man3/ENGINE_finish.html Yeah, that reference page pretty definitely agrees with what we're doing. > And an actual issue is that we have no coverage for it: > https://coverage.postgresql.org/src/interfaces/libpq/fe-secure-openssl.c= .gcov.html Oh, hmm ... I'd supposed that the code in question was exercised in normal SSL connections, but now I see it's not so. It looks like you need a non-default SSL "engine" to be available?? Might be hard to test this as a routine thing if it requires additional software. regards, tom lane