Re: Security lessons from liblzma - libsystemd - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Security lessons from liblzma - libsystemd
Date
Msg-id 20240403175721.l4r55sw4vcsrgpww@awork3.anarazel.de
Whole thread Raw
In response to [MASSMAIL]Security lessons from liblzma  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Security lessons from liblzma - libsystemd
List pgsql-hackers
Hi,

As most will know by now, the way xz debacle was able to make sshd vulnerable
was through a dependency from sshd to libsystemd and then from libsystemd to
liblzma. One lesson from this is that unnecessary dependencies can still
increase risk.

It's worth noting that we have an optional dependency on libsystemd as well.

Openssh has now integrated [1] a patch to remove the dependency on libsystemd
for triggering service manager readyness notifications, by inlining the
necessary function. That's not hard, the protocol is pretty simple.

I suspect we should do the same. We're not even close to being a target as
attractive as openssh, but still, it seems unnecessary.

Intro into the protocol is at [2], with real content and outline of the
relevant code at [3].


An argument could be made to instead just remove support, but I think it's
quite valuable to have intra service dependencies that can rely on the server
actually having started up.

Greetings,

Andres Freund

[1] https://bugzilla.mindrot.org/show_bug.cgi?id=2641
[2] https://www.freedesktop.org/software/systemd/man/devel/systemd.html#Readiness%20Protocol
[3] https://www.freedesktop.org/software/systemd/man/devel/sd_notify.html#Notes



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?
Next
From: Alvaro Herrera
Date:
Subject: Re: LogwrtResult contended spinlock