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 1oFpk5-0000CZ-3k for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Jul 2022 04:30:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oFpk3-0001MP-TO for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Jul 2022 04:30:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oFpk3-0001MG-Jz for pgsql-hackers@lists.postgresql.org; Mon, 25 Jul 2022 04:30:51 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oFpk0-0007XP-De for pgsql-hackers@postgresql.org; Mon, 25 Jul 2022 04:30:50 +0000 Received: by mail-pf1-x432.google.com with SMTP id d10so9363547pfd.9 for ; Sun, 24 Jul 2022 21:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=csVfGbCFck9llKGaDviZYi60ZZF0tfXx3HG6O+sPn8g=; b=pbwZBk+ifDdBurLx0Hx+ZCRHzn/TE9cx58gjGgpo2kkxJMJ7CoacUbe9nMaVcusxS+ Z4kP+0hP8Bd6R8DUpCjWcQK+xQ0Fmh+Y7xk6F0pbsuficbqTyuO8Wt5jHV9+KVDRHZUl QwAgMN1Oi9GYvXtLp2prfc3m8GFrCF4jbra4bZEofRwPj/pFfWw9oFm6OvvJVfVP55Nv 4fK2W254WD94jbo43beLIL3/1OHgmag5b84gJQF/QnrRTVpEZlEKhWJXAwm0jas6VjLK ixbxd77jLb61Rykm9Eg7GHu9V65/1SPcpSUk5+8HBXqQ9am8JmGv03YSD9eqFAf6LTNu sS2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=csVfGbCFck9llKGaDviZYi60ZZF0tfXx3HG6O+sPn8g=; b=ALGz/7TmKJOYaw++dC/AzAxyOb1u/eEN4J+5VQjyHXYf5GDhqt2ugrjbNS/WsUmQPW gp2EBnQ6xczpp3V/+lUmgHhF4sgZOr9/4B3pS/8vtXE0nYtvP6+3mtwkXDSgDarMEnFv KeMyEuG0S23ZNZOL5ZFy7KuzwtgGqaHElMOnY3G1THUVBZrUzegWeeDuBKGWtRfQZYp5 Kf6BKk1/jHosi//GjTfKWyTXubSnAqzVP3uxmSzoCEa5Rgx386tPzBc3uIygACWProds wNf1P07NsKDMZwEWz6p1IqVIr1z2VTSwrY7NYzhwLtqhDkpeVdlECbPIIotSJN6b6u/R P+8A== X-Gm-Message-State: AJIora/d7O7GKenBsYywWqPR3lplUM2bl4jUrhev8dvd8gF+hjhfjoKo qO61J78S9BXPQjWW+7LAzQM= X-Google-Smtp-Source: AGRyM1tf3MmG4/uSMftvghqTtqIeiB6AC38J2vsZgcbX50hF6kjxn+WqcZD23vSiEzVl7F/ZVZo+uw== X-Received: by 2002:a63:db0c:0:b0:41a:6c14:a81f with SMTP id e12-20020a63db0c000000b0041a6c14a81fmr9612034pgg.33.1658723447446; Sun, 24 Jul 2022 21:30:47 -0700 (PDT) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id y12-20020aa793cc000000b005251fff13dfsm8244962pff.155.2022.07.24.21.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jul 2022 21:30:46 -0700 (PDT) Date: Sun, 24 Jul 2022 21:30:44 -0700 From: Nathan Bossart To: Tom Lane Cc: Kyotaro Horiguchi , michael@paquier.xyz, gurjeet@singh.im, pgsql-hackers@postgresql.org Subject: Re: Unprivileged user can induce crash by using an SUSET param in PGOPTIONS Message-ID: <20220725043044.GC4085281@nathanxps13> References: <20220722.151600.1094104349120879204.horikyota.ntt@gmail.com> <729330.1658516182@sss.pgh.pa.us> <20220722223359.GB3998906@nathanxps13> <763512.1658529844@sss.pgh.pa.us> <20220722225615.GC3998906@nathanxps13> <954936.1658597004@sss.pgh.pa.us> <20220725034040.GA4085281@nathanxps13> <1834276.1658720963@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1834276.1658720963@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Jul 24, 2022 at 11:49:23PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> I noticed that a couple of places check whether whereToSendOutput is set to >> DestRemote to determine if this is an interactive session. > > IIRC, that would end in not loading the preload libraries in a standalone > backend. Perhaps that's what we want, but I'd supposed not. Discuss. Ah, I see. There was a recent change to make sure shared_preload_libraries are loaded in single-user mode (6c31ac0), but those are for load at "server start" instead of "connection start." However, AFAICT session_preload_libraries is loaded in single-user mode today, and single-user mode is arguably a connection, so my instinct is that we should continue to process it in single-user mode. I suppose we might be able to add more hacks to load it in single-user mode without a new argument, but at that point, we're probably not too far from your original proposal. Given all this, I think I'm inclined for the new argument. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com