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 1iq1Mg-0005eu-7T for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2020 20:58:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iq1Mf-0006Ef-28 for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2020 20:58:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iq1Me-0006D2-Ga for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2020 20:58:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iq1Mb-0005Ul-Po for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2020 20:58:39 +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 00AKwAU3022250; Fri, 10 Jan 2020 15:58:10 -0500 From: Tom Lane To: Stephen Frost cc: Peter , pgsql-hackers@lists.postgresql.org Subject: Re: 12.1 not useable: clientlib fails after a dozen queries (GSSAPI ?) In-reply-to: <20200110203807.GC3195@tamriel.snowman.net> References: <20200109181822.GA74698@gate.oper.dinoex.org> <7042.1578595681@sss.pgh.pa.us> <20200109205319.GA85142@gate.oper.dinoex.org> <15232.1578605504@sss.pgh.pa.us> <20200110022342.GA92515@gate.oper.dinoex.org> <12348.1578679149@sss.pgh.pa.us> <16362.1578684322@sss.pgh.pa.us> <20200110203807.GC3195@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Fri, 10 Jan 2020 15:38:07 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22248.1578689890.1@sss.pgh.pa.us> Date: Fri, 10 Jan 2020 15:58:10 -0500 Message-ID: <22249.1578689890@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > Ah-hah. Not sure if that was Robbie or myself (probably me, really, > since I rewrote a great deal of that code). I agree that the regression > tests don't test with very much data, but I tested pushing quite a bit > of data through and didn't see any issues with my testing. Apparently I > was getting pretty lucky. :/ You were *very* lucky, because this code is absolutely full of mistakes related to incomplete reads, inadequate or outright wrong error handling, etc. I was nearly done cleaning that up, when it sank into me that fe-secure-gssapi.c uses static buffers for partially-read or partially-encoded data. That means that any client trying to use multiple GSSAPI-encrypted connections is very likely to see breakage due to different connections trying to use the same buffers concurrently. I wonder whether that doesn't explain the complaints mentioned upthread from the Ruby folks. (be-secure-gssapi.c is coded identically, but there it's OK since any backend only has one client connection to deal with.) >> I'll have a patch in a little while. > That's fantastic, thanks! This is gonna take longer than I thought. regards, tom lane