pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Vitek <dvitek@grammatech.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #12799: libpq - SSL pqsecure_read() doesn't clean openssl error queue before reading
Date: Thu, 18 Feb 2016 17:58:32 -0500
Message-ID: <56C64C98.2010502@grammatech.com> (raw)
In-Reply-To: <28955.1455835117@sss.pgh.pa.us>
References: <20150224030956.2529.83279@wrigleys.postgresql.org>
	<54EDD30D.5050107@vmware.com>
	<319431910.43023.1425002429817.JavaMail.zimbra@4linux.com.br>
	<54F37769.3090406@iki.fi>
	<56C64197.6060408@grammatech.com>
	<CAM3SWZQm7Y3NbvyuAOsFvHvGqVGCJk6YmN+gWTuavezp8PPZPg@mail.gmail.com>
	<56C646AF.5010805@grammatech.com>
	<28955.1455835117@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2/18/2016 5:38 PM, Tom Lane wrote:
> Dave Vitek <dvitek@grammatech.com> writes:
>> Maintainers: Peter's patch is better than mine, at least for the front
>> end side.  I also adjusted be-secure-openssl.c, which perhaps is not
>> necessary, but then again it's hard to be sure.  It might be worth doing
>> a patch for be-secure-openssl.c in the spirit of what Peter did for the
>> frontend (sorry, not volunteering :).
> +1 for changing both sides.  I'm fairly sure that you could provoke
> problems of this ilk in the backend too, for example if client connection
> is using SSL and we also establish an outgoing SSL connection using
> postgres_fdw or dblink.
>
> BTW, do we have a reproducible test case?
>
> 			regards, tom lane
I can reproduce it, but I don't have a self contained unit test.

Such a test case might look like: call ERR_put_error with SSL_ERROR_SSL 
and then cause libpq to invoke SSL_read. SSL_get_error after the read 
will probably return SSL_ERROR_SSL even if the read goes fine, causing 
postgres to conclude things have failed.




-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (10+ messages)  latest in thread

Message-ID: <56C64C98.2010502@grammatech.com>
Permalink:  ../56C64C98.2010502@grammatech.com/
Also on:    postgresql.org/message-id/56C64C98.2010502@grammatech.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: dvitek@grammatech.com, tgl@sss.pgh.pa.us, pg@heroku.com
  Subject: Re: BUG #12799: libpq - SSL pqsecure_read() doesn't clean openssl error queue before reading
  In-Reply-To: <56C64C98.2010502@grammatech.com>
  References: <20150224030956.2529.83279@wrigleys.postgresql.org> <54EDD30D.5050107@vmware.com> <319431910.43023.1425002429817.JavaMail.zimbra@4linux.com.br> <54F37769.3090406@iki.fi> <56C64197.6060408@grammatech.com> <CAM3SWZQm7Y3NbvyuAOsFvHvGqVGCJk6YmN+gWTuavezp8PPZPg@mail.gmail.com> <56C646AF.5010805@grammatech.com> <28955.1455835117@sss.pgh.pa.us> <56C64C98.2010502@grammatech.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox