public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Matthias Clasen <mclasen@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/glib2] cve-2026-58016-f44: fix a deadlock
Date: Tue, 11 Aug 2026 10:34:52 GMT	[thread overview]
Message-ID: <178644449228.1.17160996161154768980.rpms-glib2-d590dacb3d22@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/glib2
Branch : cve-2026-58016-f44
Commit : d590dacb3d22f94e3a0fd1676e006a64ae3a5c61
Author : Matthias Clasen <mclasen@redhat.com>
Date   : 2011-06-06T23:30:20-04:00
Stats  : +117/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/glib2/c/d590dacb3d22f94e3a0fd1676e006a64ae3a5c61?branch=cve-2026-58016-f44

Log:
fix a deadlock

---
diff --git a/0001-GDataList-don-t-hold-the-bitlock-over-callbacks.patch b/0001-GDataList-don-t-hold-the-bitlock-over-callbacks.patch
new file mode 100644
index 0000000..8a52991
--- /dev/null
+++ b/0001-GDataList-don-t-hold-the-bitlock-over-callbacks.patch
@@ -0,0 +1,110 @@
+From c91720255261222d7be685f3a8f039706f04cce5 Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen@redhat.com>
+Date: Mon, 6 Jun 2011 23:23:29 -0400
+Subject: [PATCH 1/2] GDataList: don't hold the bitlock over callbacks
+
+g_datalist_id_clear_i was dropping the dataset lock around
+the destroy notifies, but kept the bitlock. This was causing
+deadlocks when finalizing widgets.
+---
+ glib/gdataset.c |   45 +++++++++++++++++++++++++++++----------------
+ 1 files changed, 29 insertions(+), 16 deletions(-)
+
+diff --git a/glib/gdataset.c b/glib/gdataset.c
+index e1b55c1..0c1f9c1 100644
+--- a/glib/gdataset.c
++++ b/glib/gdataset.c
+@@ -176,8 +176,7 @@ struct _GDataset
+ 
+ /* --- prototypes --- */
+ static inline GDataset*	g_dataset_lookup		(gconstpointer	  dataset_location);
+-static inline void	g_datalist_clear_i		(GData		**datalist, 
+-							 gboolean         unlock_dataset);
++static inline void	g_datalist_clear_i		(GData		**datalist);
+ static void		g_dataset_destroy_internal	(GDataset	 *dataset);
+ static inline gpointer	g_data_set_internal		(GData     	**datalist,
+ 							 GQuark   	  key_id,
+@@ -228,8 +227,8 @@ g_datalist_unlock (GData **datalist)
+ /* Called with the datalist lock held, or the dataset global
+  * lock for dataset lists
+  */
+-void
+-g_datalist_clear_i (GData **datalist, gboolean unlock_dataset)
++static void
++g_datalist_clear_i (GData **datalist)
+ {
+   GData *data;
+   gint i;
+@@ -239,15 +238,13 @@ g_datalist_clear_i (GData **datalist, gboolean unlock_dataset)
+ 
+   if (data)
+     {
+-      if (unlock_dataset)
+-	G_UNLOCK (g_dataset_global);
++      G_UNLOCK (g_dataset_global);
+       for (i = 0; i < data->len; i++)
+-	{
+-	  if (data->data[i].data && data->data[i].destroy)
+-	    data->data[i].destroy (data->data[i].data);
+-	}
+-      if (unlock_dataset)
+-	G_LOCK (g_dataset_global);
++        {
++          if (data->data[i].data && data->data[i].destroy)
++            data->data[i].destroy (data->data[i].data);
++        }
++      G_LOCK (g_dataset_global);
+ 
+       g_free (data);
+     }
+@@ -258,19 +255,35 @@ g_datalist_clear_i (GData **datalist, gboolean unlock_dataset)
+  * g_datalist_clear:
+  * @datalist: a datalist.
+  *
+- * Frees all the data elements of the datalist. The data elements'
+- * destroy functions are called if they have been set.
++ * Frees all the data elements of the datalist.
++ * The data elements' destroy functions are called
++ * if they have been set.
+  **/
+ void
+ g_datalist_clear (GData **datalist)
+ {
++  GData *data;
++  gint i;
++
+   g_return_if_fail (datalist != NULL);
+ 
+   g_datalist_lock (datalist);
+ 
+-  g_datalist_clear_i (datalist, FALSE);
++  data = G_DATALIST_GET_POINTER (datalist);
++  G_DATALIST_SET_POINTER (datalist, NULL);
+ 
+   g_datalist_unlock (datalist);
++
++  if (data)
++    {
++      for (i = 0; i < data->len; i++)
++        {
++          if (data->data[i].data && data->data[i].destroy)
++            data->data[i].destroy (data->data[i].data);
++        }
++
++      g_free (data);
++    }
+ }
+ 
+ /* HOLDS: g_dataset_global_lock */
+@@ -307,7 +320,7 @@ g_dataset_destroy_internal (GDataset *dataset)
+ 	  break;
+ 	}
+       
+-      g_datalist_clear_i (&dataset->datalist, TRUE);
++      g_datalist_clear_i (&dataset->datalist);
+       dataset = g_dataset_lookup (dataset_location);
+     }
+ }
+-- 
+1.7.5.2
+

diff --git a/glib2.spec b/glib2.spec
index 7580f82..9203f3d 100644
--- a/glib2.spec
+++ b/glib2.spec
@@ -10,6 +10,9 @@ URL: http://www.gtk.org
 #VCS: git:git://git.gnome.org/glib
 Source: http://download.gnome.org/sources/glib/2.29/glib-%{version}.tar.xz
 
+# upstream fix
+Patch0: 0001-GDataList-don-t-hold-the-bitlock-over-callbacks.patch
+
 BuildRequires: pkgconfig
 BuildRequires: gamin-devel
 BuildRequires: gettext
@@ -57,6 +60,7 @@ The glib2-static package includes static libraries of the GLib library.
 
 %prep
 %setup -q -n glib-%{version}
+%patch -p1 -b .datalist-deadlock
 
 %build
 # Support builds of both git snapshots and tarballs packed with autogoo
@@ -159,6 +163,9 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
 
 
 %changelog
+* Mon Jun  6 2011 Matthias Clasen <mclasen@redhat.com> - 2.29.6-2
+- Fix a deadlock when finalizing e.g. widgets
+
 * Sun Jun  5 2011 Matthias Clasen <mclasen@redhat.com> - 2.29.6-1
 - Update to 2.29.6
 

                 reply	other threads:[~2026-08-11 10:34 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=178644449228.1.17160996161154768980.rpms-glib2-d590dacb3d22@fedoraproject.org \
    --to=mclasen@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