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 1oT5fN-0002HB-RZ for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 18:08:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oT5eO-0002C7-9a for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 18:07:48 +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 1oT5eO-0002By-0p for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 18:07:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT5eL-0004Sb-Cq for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 18:07:46 +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 27UI7fTO3713732; Tue, 30 Aug 2022 14:07:41 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org Subject: Re: Postmaster self-deadlock due to PLT linkage resolution In-reply-to: <20220830174116.mmhyi3rfysudybsx@awork3.anarazel.de> References: <3384826.1661802235@sss.pgh.pa.us> <20220830171720.iai6jwwo756z7ivw@awork3.anarazel.de> <3705480.1661880279@sss.pgh.pa.us> <20220830174116.mmhyi3rfysudybsx@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 30 Aug 2022 10:41:16 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3713730.1661882861.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 30 Aug 2022 14:07:41 -0400 Message-ID: <3713731.1661882861@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-08-30 13:24:39 -0400, Tom Lane wrote: >> Andres Freund writes: >>> Perhaps it'd be saner to default to building with -Wl,-z,now? That sho= uld fix >>> the problem too, right (and if we combine it with relro, it'd be a sec= urity >>> improvement to boot). >> Hm. Not sure if that works on NetBSD, but I'll check it out. > FWIW, it's a decently (well over 10 years) old thing I think. And it's d= ocumented in > the netbsd ld manpage and their packaging guide (albeit indirectly, with= their > tooling doing the work of specifying the flags): > https://www.netbsd.org/docs/pkgsrc/hardening.html#hardening.audit.relrof= ull It does appear that they use GNU ld, and I've just finished confirming that each of those switches has the expected effects on my PPC box. So yeah, this looks like a better answer. Do we want to install this just for NetBSD, or more widely? I think we'd better back-patch it for NetBSD, so I'm inclined to be conservative about the change. regards, tom lane