public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gnome-initial-setup] f44: Add patch to fix crash when selecting wifi network
@ 2026-07-29 10:53 nmontero
0 siblings, 0 replies; only message in thread
From: nmontero @ 2026-07-29 10:53 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/gnome-initial-setup
Branch : f44
Commit : 05c60567b95e7fb3889137f7a046b170800cc9b8
Author : nmontero <nmontero@redhat.com>
Date : 2026-07-29T12:42:27+02:00
Stats : +48/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/gnome-initial-setup/c/05c60567b95e7fb3889137f7a046b170800cc9b8?branch=f44
Log:
Add patch to fix crash when selecting wifi network
https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/work_items/250
---
diff --git a/0001-network-Prevent-crash-when-ssid-gets-freed.patch b/0001-network-Prevent-crash-when-ssid-gets-freed.patch
new file mode 100644
index 0000000..551ff40
--- /dev/null
+++ b/0001-network-Prevent-crash-when-ssid-gets-freed.patch
@@ -0,0 +1,45 @@
+From 2cab99a7328354272e60b978d3af3375e65c3c46 Mon Sep 17 00:00:00 2001
+From: Kean Ren <rh_king@163.com>
+Date: Tue, 28 Jul 2026 15:47:14 +0800
+Subject: [PATCH] network: Prevent crash when ssid gets freed
+
+The previous fix (commit 685ce053) took a copy of object-path so that
+the row widget's reference survives the next Wi-Fi scan, which deletes
+and recreates NMAccessPoint objects. The same hazard applies to the
+ssid GBytes: it is owned by the NMAccessPoint and is freed when the AP
+is replaced on the next scan. Leaving the dangling pointer stored on
+the row causes row_activated() to dereference freed memory and crash.
+
+Take a reference on ssid with g_bytes_ref() and release it via
+g_bytes_unref() when the row is destroyed, mirroring the existing
+object-path handling.
+---
+ gnome-initial-setup/pages/network/gis-network-page.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/gnome-initial-setup/pages/network/gis-network-page.c b/gnome-initial-setup/pages/network/gis-network-page.c
+index ac9696f7..6f87448b 100644
+--- a/gnome-initial-setup/pages/network/gis-network-page.c
++++ b/gnome-initial-setup/pages/network/gis-network-page.c
+@@ -305,10 +305,16 @@ add_access_point (GisNetworkPage *page, NMAccessPoint *ap, NMAccessPoint *active
+ strength = G_MAXUINT;
+
+ /* Copy object_path; it points into the NM AP object which may be
+- * freed on the next Wi-Fi scan, creating a dangling pointer. */
++ * freed on the next Wi-Fi scan, creating a dangling pointer.
++ * Take a reference on ssid for the same reason: the GBytes is owned
++ * by the NM access point and would otherwise be freed when the AP
++ * is replaced on the next scan, leaving the row with a dangling
++ * pointer that crashes row_activated(). */
+ g_object_set_data_full (G_OBJECT (row), "object-path",
+ g_strdup (object_path), g_free);
+- g_object_set_data (G_OBJECT (row), "ssid", (gpointer) ssid);
++ g_object_set_data_full (G_OBJECT (row), "ssid",
++ g_bytes_ref (ssid),
++ (GDestroyNotify) g_bytes_unref);
+ g_object_set_data (G_OBJECT (row), "strength", GUINT_TO_POINTER (strength));
+
+ gtk_list_box_append (GTK_LIST_BOX (priv->network_list), row);
+--
+2.53.0
+
diff --git a/gnome-initial-setup.spec b/gnome-initial-setup.spec
index 6bf9698..358c8a6 100644
--- a/gnome-initial-setup.spec
+++ b/gnome-initial-setup.spec
@@ -30,6 +30,9 @@ Patch: no-run0.patch
# https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/work_items/248
Patch1: network-prevent-crash-for-invalid-ap-object-paths.patch
+# https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/work_items/250
+Patch2: 0001-network-Prevent-crash-when-ssid-gets-freed.patch
+
BuildRequires: desktop-file-utils
BuildRequires: gcc
BuildRequires: meson
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-29 10:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-29 10:53 [rpms/gnome-initial-setup] f44: Add patch to fix crash when selecting wifi network nmontero
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox