public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Kalev Lember <klember@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/glib2] cve-2026-58016-f44: Backport an upstream patch to fix an FD leak (rhbz#2109145)
Date: Tue, 11 Aug 2026 10:37:46 GMT [thread overview]
Message-ID: <178644466645.1.8340184810546801585.rpms-glib2-aba250710a90@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/glib2
Branch : cve-2026-58016-f44
Commit : aba250710a90254819cc8b86d6e5b912570bd9fb
Author : Kalev Lember <klember@redhat.com>
Date : 2022-08-15T14:50:44+02:00
Stats : +44/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/glib2/c/aba250710a90254819cc8b86d6e5b912570bd9fb?branch=cve-2026-58016-f44
Log:
Backport an upstream patch to fix an FD leak (rhbz#2109145)
---
diff --git a/0001-gmain-close-pidfd-when-finalizing-GChildWatchSource.patch b/0001-gmain-close-pidfd-when-finalizing-GChildWatchSource.patch
new file mode 100644
index 0000000..8ca96f2
--- /dev/null
+++ b/0001-gmain-close-pidfd-when-finalizing-GChildWatchSource.patch
@@ -0,0 +1,40 @@
+From b62745fe8e1699473f87caff328ac2c6ce394c55 Mon Sep 17 00:00:00 2001
+From: Christian Hergert <chergert@redhat.com>
+Date: Tue, 2 Aug 2022 12:35:40 -0700
+Subject: [PATCH] gmain: close pidfd when finalizing GChildWatchSource
+
+A file-descriptor was created with the introduction of pidfd_getfd() but
+nothing is closing it when the source finalizes. The GChildWatchSource is
+the creator and consumer of this FD and therefore responsible for closing
+it on finalization.
+
+The pidfd leak was introduced in !2408.
+
+This fixes issues with Builder where anon_inode:[pidfd] exhaust the
+available FD limit for the process.
+
+Fixes #2708
+---
+ glib/gmain.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/glib/gmain.c b/glib/gmain.c
+index a6f9b168e..dba5f40e4 100644
+--- a/glib/gmain.c
++++ b/glib/gmain.c
+@@ -5804,7 +5804,11 @@ g_child_watch_finalize (GSource *source)
+ GChildWatchSource *child_watch_source = (GChildWatchSource *) source;
+
+ if (child_watch_source->using_pidfd)
+- return;
++ {
++ if (child_watch_source->poll.fd >= 0)
++ close (child_watch_source->poll.fd);
++ return;
++ }
+
+ G_LOCK (unix_signal_lock);
+ unix_child_watches = g_slist_remove (unix_child_watches, source);
+--
+2.37.1
+
diff --git a/glib2.spec b/glib2.spec
index 6e11ba6..37c18fd 100644
--- a/glib2.spec
+++ b/glib2.spec
@@ -23,6 +23,10 @@ Patch2: 2840.patch
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2838
Patch3: 2838.patch
+# Backported from upstream
+# https://bugzilla.redhat.com/show_bug.cgi?id=2109145
+Patch4: 0001-gmain-close-pidfd-when-finalizing-GChildWatchSource.patch
+
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gettext
reply other threads:[~2026-08-11 10:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178644466645.1.8340184810546801585.rpms-glib2-aba250710a90@fedoraproject.org \
--to=klember@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox