Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEfch-0008J7-7w for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jul 2022 23:30:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEfcg-0007D8-2k for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jul 2022 23:30:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEfcf-0007Cz-QM for pgsql-hackers@lists.postgresql.org; Thu, 21 Jul 2022 23:30:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEfcd-0000yD-Hb for pgsql-hackers@postgresql.org; Thu, 21 Jul 2022 23:30:25 +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 26LNUKFA348147; Thu, 21 Jul 2022 19:30:20 -0400 From: Tom Lane To: Nathan Bossart cc: Gurjeet Singh , Postgres Hackers Subject: Re: Fwd: Unprivileged user can induce crash by using an SUSET param in PGOPTIONS In-reply-to: <20220721222900.GA3813377@nathanxps13> References: <20220705174938.GB2566600@rfd.leadboat.com> <335170.1658439851@sss.pgh.pa.us> <20220721222900.GA3813377@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Thu, 21 Jul 2022 15:29:00 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <348145.1658446220.1@sss.pgh.pa.us> Date: Thu, 21 Jul 2022 19:30:20 -0400 Message-ID: <348146.1658446220@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > + StartTransactionCommand(); > process_session_preload_libraries(); > + CommitTransactionCommand(); Yeah, that way would avoid any questions about changing the order of operations, but it seems like a mighty expensive solution: it's adding a transaction to each backend start on the off chance that (a) session_preload_libraries/local_preload_libraries is nonempty and (b) the loaded libraries are going to do anything where it'd matter. So that's why I thought of moving the call inside a pre-existing transaction. If we had to back-patch this into any released versions, I'd agree with taking the performance hit in order to reduce the chance of side-effects. But I think as long as we only have to do it in v15, it's not too late to possibly cause some compatibility issues for extensions. regards, tom lane