[PATCH] Align GSS and TLS error handling in PQconnectPoll()
Jacob Champion <jchampion@timescale.com>
From: Jacob Champion <jchampion@timescale.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Date: 2023-02-13T18:49:17Z
Lists: pgsql-hackers
Attachments
- PQconnectPoll-poison-connection-on-gssenc-error.patch (text/x-patch) patch
Hi all, During the gssencmode CVE discussion, we noticed that PQconnectPoll() handles the error cases for TLS and GSS transport encryption slightly differently. After TLS fails, the connection handle is dead and future calls to PQconnectPoll() return immediately. But after GSS encryption fails, the connection handle can still be used to reenter the GSS handling code. This doesn't appear to have any security implications today -- and a client has to actively try to reuse a handle that's already failed -- but it seems undesirable. Michael (cc'd) came up with a patch, which I have attached here and will register in the CF. Thanks, --Jacob
Commits
-
Fix inconsistent error handling for GSS encryption in PQconnectPoll()
- 2bc36a56cbd1 12.15 landed
- 96bef4374e45 13.11 landed
- 7e319231c6bb 14.8 landed
- 4493256c5c0b 15.3 landed
- e0a09d4e354c 16.0 landed