Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uIugF-00DVck-6G for pgsql-bugs@arkaria.postgresql.org; Sat, 24 May 2025 19:37:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uIugD-00DJ5X-Tc for pgsql-bugs@arkaria.postgresql.org; Sat, 24 May 2025 19:37:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uIugD-00DJ5M-Ko for pgsql-bugs@lists.postgresql.org; Sat, 24 May 2025 19:37:13 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uIugA-000n9E-2C for pgsql-bugs@lists.postgresql.org; Sat, 24 May 2025 19:37:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 54OJb5EN3125814; Sat, 24 May 2025 15:37:05 -0400 From: Tom Lane To: Chris Gooch cc: Jacob Champion , "pgsql-bugs@lists.postgresql.org" Subject: Re: [EXT] Re: GSS Auth issue when user member of lots of AD groups In-reply-to: <3060113.1748096813@sss.pgh.pa.us> References: <1529314.1747928806@sss.pgh.pa.us> <1536692.1747933034@sss.pgh.pa.us> <1647590.1747936713@sss.pgh.pa.us> <3060113.1748096813@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 24 May 2025 10:26:53 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3125812.1748115425.1@sss.pgh.pa.us> Date: Sat, 24 May 2025 15:37:05 -0400 Message-ID: <3125813.1748115425@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > I believe we've agreed that it'd be sufficient if we allow the > packets exchanged during the auth phase to be up to 64K or so, > but once we reach the point where we're able to split the > data on arbitrary boundaries, keep the packet size at 16K > for cross-version compatibility. OK, here's a set of draft patches for that. (The HEAD one works on v16 and v17 too, the v15 one works on v14 too. They are all basically the same, but we kept revising libpq's internal convention for error reports ...) I am not in a great position to test these with a setup that actually needs larger auth messages; I wonder if Chris can test? Some notes: * Is 128kB unreasonably large? I think we may want some daylight above 64kB, but I'm not sure how much. * I concluded that the error report that's being given for the case is just flat-out bogus. The GSSAPI library has not given us an error report so asking it for info is useless, which leads to the very unhelpful error message Chris showed. We should just report "client tried to send oversize GSSAPI packet" as we do elsewhere. * It seems pretty silly to have separate symbols for PQ_GSS_SEND_BUFFER_SIZE and PQ_GSS_RECV_BUFFER_SIZE when we're requiring those to be the same, so I merged them into one symbol PQ_GSS_MAX_PACKET_SIZE. * The backend's secure_open_gssapi allowed received initialization packets to be up to buffer-size long, whereas libpq will choke sending them if they're more than buffer-size minus sizeof(uint32). This isn't actually a bug, since the buffer management is handled in such a way that it's safe, but it seems very inconsistent. I changed the limit to subtract off sizeof(uint32) in all cases, which incidentally allowed removing one variant of the translatable message string. regards, tom lane