diff --git a/SOURCES/udisks2-Fix-leak-when-updating-fstab-volumes.patch b/SOURCES/udisks2-Fix-leak-when-updating-fstab-volumes.patch new file mode 100644 index 0000000..3d599d6 --- /dev/null +++ b/SOURCES/udisks2-Fix-leak-when-updating-fstab-volumes.patch @@ -0,0 +1,30 @@ +From 91f34aa87f6089c8d8437310854b83af3b6ba05b Mon Sep 17 00:00:00 2001 +From: Ondrej Holy +Date: Mon, 2 Mar 2020 09:50:38 +0100 +Subject: [PATCH] udisks2: Fix leak when updating fstab volumes + +`g_list_remove_link` is used when filtering out mountpoints, but the +GList element is not consequently freed. Let's use `g_list_delete_link` +to not leak that element. + +https://gitlab.gnome.org/GNOME/gvfs/issues/452 +--- + monitor/udisks2/gvfsudisks2volumemonitor.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/monitor/udisks2/gvfsudisks2volumemonitor.c b/monitor/udisks2/gvfsudisks2volumemonitor.c +index 37c81fcf..b200457d 100644 +--- a/monitor/udisks2/gvfsudisks2volumemonitor.c ++++ b/monitor/udisks2/gvfsudisks2volumemonitor.c +@@ -1623,7 +1623,7 @@ update_fstab_volumes (GVfsUDisks2VolumeMonitor *monitor, + have_udisks_volume_for_mount_point (monitor, mount_point) || + !mount_point_has_device (monitor, mount_point)) + { +- new_mount_points = g_list_remove_link (new_mount_points, l); ++ new_mount_points = g_list_delete_link (new_mount_points, l); + g_unix_mount_point_free (mount_point); + } + } +-- +2.31.1 + diff --git a/SOURCES/udisks2-Fix-leaks-of-drive-icons-description.patch b/SOURCES/udisks2-Fix-leaks-of-drive-icons-description.patch new file mode 100644 index 0000000..3849d55 --- /dev/null +++ b/SOURCES/udisks2-Fix-leaks-of-drive-icons-description.patch @@ -0,0 +1,31 @@ +From 93fcef03e322bee9cfde27494e510755f48d7e5a Mon Sep 17 00:00:00 2001 +From: Ondrej Holy +Date: Mon, 2 Mar 2020 13:18:27 +0100 +Subject: [PATCH] udisks2: Fix leaks of drive icons/description + +Drive icons/description are leaked currently when also media +icon/description is available. Let's add missing `g_clear_object` +resp. `g_free` calls to fix those leaks. + +https://gitlab.gnome.org/GNOME/gvfs/issues/452 +--- + monitor/udisks2/gvfsudisks2volume.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/monitor/udisks2/gvfsudisks2volume.c b/monitor/udisks2/gvfsudisks2volume.c +index 89a9f29d..8c0794d7 100644 +--- a/monitor/udisks2/gvfsudisks2volume.c ++++ b/monitor/udisks2/gvfsudisks2volume.c +@@ -407,6 +407,9 @@ update_volume (GVfsUDisks2Volume *volume) + g_free (media_desc); + g_clear_object (&media_icon); + g_clear_object (&media_symbolic_icon); ++ g_free (drive_desc); ++ g_clear_object (&drive_icon); ++ g_clear_object (&drive_symbolic_icon); + + /* Only automount drives attached to the same seat as we're running on + */ +-- +2.31.1 + diff --git a/SPECS/gvfs.spec b/SPECS/gvfs.spec index bedc867..e146d7e 100644 --- a/SPECS/gvfs.spec +++ b/SPECS/gvfs.spec @@ -24,7 +24,7 @@ Name: gvfs Version: 1.36.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Backends for the gio framework in GLib License: GPLv3 and LGPLv2+ and BSD and MPLv2.0 @@ -46,6 +46,10 @@ Patch3: smbbrowse-Force-NT1-protocol-version-for-workgroup-s.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1758237 Patch4: udisks2-Fix-crashes-caused-by-missing-source-tag.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1944813 +Patch5: udisks2-Fix-leak-when-updating-fstab-volumes.patch +Patch6: udisks2-Fix-leaks-of-drive-icons-description.patch + BuildRequires: pkgconfig BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} BuildRequires: pkgconfig(dbus-glib-1) @@ -233,6 +237,8 @@ the functionality of the installed gvfs package. %patch2 -p1 -b .admin-Prevent-access-if-any-authentication-agent-isn %patch3 -p1 -b .smbbrowse-Force-NT1-protocol-version-for-workgroup-s %patch4 -p1 -b .udisks2-Fix-crashes-caused-by-missing-source-tag +%patch5 -p1 -b .udisks2-Fix-leak-when-updating-fstab-volumes +%patch6 -p1 -b .udisks2-Fix-leaks-of-drive-icons-description # Needed for gvfs-0.2.1-archive-integration.patch autoreconf -fi @@ -449,6 +455,9 @@ killall -USR1 gvfsd >&/dev/null || : %{_datadir}/installed-tests %changelog +* Fri Jul 2 2021 Ondrej Holy - 1.36.2-5 +- Fix udisks2 volume monitor leaks (rhbz#1944813) + * Wed Apr 22 2020 Ondrej Holy - 1.36.2-4 - Fix udisks2 volume monitor crashes when stopping drive (rhbz#1758237)