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 1rvJK8-00B9v5-HD for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Apr 2024 16:00:21 +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 1rvJK7-00Fnyx-MY for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Apr 2024 16:00:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rvJK7-00FnyR-Ct for pgsql-hackers@lists.postgresql.org; Fri, 12 Apr 2024 16:00:19 +0000 Received: from wfhigh1-smtp.messagingengine.com ([64.147.123.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rvJK5-002WuC-2x for pgsql-hackers@postgresql.org; Fri, 12 Apr 2024 16:00:18 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfhigh.west.internal (Postfix) with ESMTP id 166BE180010B; Fri, 12 Apr 2024 12:00:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 12 Apr 2024 12:00:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1712937614; x=1713024014; bh=ptmKvRR+jh oK3C+Y5e35aVoijXc+hwFR6uvRDMKWx/8=; b=JB6WAdTzPMhDVTFZrVudowXTuB 6FmIl+sy4SzzHB9iJ7vhOPgb0LoKD6vG9Ag1s6ln0TCdKlFDU13xvEvKjnn6VIUE 4fLf8q5Hsm+J0ILvV99zuNKHyS6T570eUvV/norJh6RRaXsfTSfb2Nhjq24P0zye Qp6li+7/IcwhUpd5T5rWwRl4gVOrCHvCrsuK1ZUiqTowsST4qCAizPWDzxzhMvN3 AWX8vW12tcbqe/GwJKCicYp9Wlll6klVksIEKGUFQEXCqI73bIWv+VMSaVTONfdz yAzCG9oMfiH8k+rO87wk+rJJJbpdU8CovmCWcnkY3iqIf2Nn6+flPABNbzEg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712937614; x=1713024014; bh=ptmKvRR+jhoK3C+Y5e35aVoijXc+ hwFR6uvRDMKWx/8=; b=KH9KGg1LHNpMTWlQfBa5SY1vI3JI0JtbnDk9AnqIV4hw RpOWT2o95/LZ+7/MW/sR66kyVEo4yQOk9VTjcFpGWdl8Ma0jUQ/7yCnwL0aniEjS QBTRkgBlJHKEPGVcUjVwtPnQMp1zmTBsT4DHkXUeUypM5IgjfhoXR7FM7vZBGmS9 OuDaI7xA9h/Uc/KtoH5RK3dA6s18yJfbe9j8MorhftZdvvMVKSEow0x9Nn2SZTkD m+25yqF8cO8DXtwManJVD2fFelzCrtuIloVXwnjmuFY+wm4NV3U5tVS4QVLQtGCU 0jOBv9pSLYk/5MfhNTUU5OPgfZ7zHtl7MvAnOK+/Cg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeiuddgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 12 Apr 2024 12:00:13 -0400 (EDT) Date: Fri, 12 Apr 2024 09:00:11 -0700 From: Andres Freund To: Peter Eisentraut Cc: Magnus Hagander , Bruce Momjian , PostgreSQL-development Subject: Re: Security lessons from liblzma - libsystemd Message-ID: <20240412160011.stodfnsae6o7oszn@awork3.anarazel.de> References: <20240403175721.l4r55sw4vcsrgpww@awork3.anarazel.de> <7af9c295-1ea8-45ba-ad71-93ac2fae2e89@eisentraut.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7af9c295-1ea8-45ba-ad71-93ac2fae2e89@eisentraut.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2024-04-04 01:10:20 +0200, Peter Eisentraut wrote: > On 03.04.24 23:19, Magnus Hagander wrote: > > When the code is this simple, we should definitely consider carrying it > > ourselves. At least if we don't expect to need *other* functionality > > from the same library in the future, which I doubt we will from > > libsystemd. > > Well, I've long had it on my list to do some integration to log directly to > the journal, so you can preserve metadata better. I'm not sure right now > whether this would use libsystemd, but it's not like there is absolutely no > other systemd-related functionality that could be added. Interesting. I think that'd in all likelihood end up using libsystemd. > Personally, I think this proposed change is trying to close a barndoor after > a horse has bolted. There are many more interesting and scary libraries in > the dependency tree of "postgres", so just picking off one right now doesn't > really accomplish anything. The next release of libsystemd will drop all > the compression libraries as hard dependencies, so the issue in that sense > is gone anyway. Also, fun fact: liblzma is also a dependency via libxml2. I agree that doing this just because of future risk in liblzma is probably not worth it. Despite soon not being an unconditional dependency of libsystemd anymore, I'd guess that in a few months it's going to be one of the better vetted libraries out there. But I don't think that means it's not worth reducing the dependencies that we have unconditionally loaded. Having a dependency to a fairly large library (~900k), which could be avoided with ~30 LOC, is just not worth it. Independent of liblzma. Not from a performance POV, nor from a risk POV. I'm actually fairly bothered by us linking to libxml2. It was effectively unmaintained for most of the last decade, with just very occasional drive-by commits. And it's not that there weren't significant bugs or such. Maintenance has picked up some, but it's still not well maintained, I'd say. If I wanted to attack postgres, it's where I'd start. My worry level, in decreasing order, about postmaster-level dependencies: - libxml2 - effectively unmaintained, just about maintained today - gssapi - heavily undermaintained from what I can see, lots of complicated code - libldap - undermaintained, lots of creaky old code - libpam - undermaintained, lots of creaky old code - the rest Greetings, Andres Freund