From 7fa01992fc1d851742aedc5041cdfd1b91cc41b5 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Nov 07 2017 16:14:25 +0000 Subject: Backport a patch to fix a gnome-software crash when installing flatpaks https://bugzilla.redhat.com/show_bug.cgi?id=1497642 --- diff --git a/0001-fetcher-curl-Fix-invalid-memory-access-in-finalize.patch b/0001-fetcher-curl-Fix-invalid-memory-access-in-finalize.patch new file mode 100644 index 0000000..746c8d1 --- /dev/null +++ b/0001-fetcher-curl-Fix-invalid-memory-access-in-finalize.patch @@ -0,0 +1,41 @@ +From 176a7b4778fbacbbb0824cf8c612656cd0985499 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Tue, 7 Nov 2017 16:10:45 +0100 +Subject: [PATCH] fetcher/curl: Fix invalid memory access in finalize() + +Reorder cleanup functions so that curl_multi_cleanup() runs before +self->sockets is destroyed. This avoids an assert and invalid memory +access in sock_cb where self->sockets is dereferenced during +curl_multi_cleanup(). + +Closes: https://github.com/ostreedev/ostree/issues/1331 + +Closes: #1332 +Approved by: cgwalters +--- + src/libostree/ostree-fetcher-curl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c +index 1f64188258ed..8a23b16361ef 100644 +--- a/src/libostree/ostree-fetcher-curl.c ++++ b/src/libostree/ostree-fetcher-curl.c +@@ -167,6 +167,7 @@ _ostree_fetcher_finalize (GObject *object) + { + OstreeFetcher *self = OSTREE_FETCHER (object); + ++ curl_multi_cleanup (self->multi); + g_free (self->remote_name); + g_free (self->cookie_jar_path); + g_free (self->proxy); +@@ -177,7 +178,6 @@ _ostree_fetcher_finalize (GObject *object) + g_clear_pointer (&self->timer_event, (GDestroyNotify)destroy_and_unref_source); + if (self->mainctx) + g_main_context_unref (self->mainctx); +- curl_multi_cleanup (self->multi); + + G_OBJECT_CLASS (_ostree_fetcher_parent_class)->finalize (object); + } +-- +2.14.2 + diff --git a/ostree.spec b/ostree.spec index 20131e2..ebaf5bc 100644 --- a/ostree.spec +++ b/ostree.spec @@ -1,10 +1,12 @@ Summary: Tool for managing bootable, immutable filesystem trees Name: ostree Version: 2017.13 -Release: 2%{?dist} +Release: 3%{?dist} Source0: https://github.com/ostreedev/%{name}/releases/download/v%{version}/libostree-%{version}.tar.xz # https://bugzilla.redhat.com/show_bug.cgi?id=1451458 Source1: 91-ostree.preset +# Backported from upstream +Patch0: 0001-fetcher-curl-Fix-invalid-memory-access-in-finalize.patch License: LGPLv2+ URL: https://ostree.readthedocs.io/en/latest/ @@ -160,6 +162,10 @@ install -D -m 0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/systemd/system-preset/9 %{_libexecdir}/libostree/ostree-trivial-httpd %changelog +* Tue Nov 07 2017 Kalev Lember - 2017.13-3 +- Backport a patch to fix a gnome-software crash when installing flatpaks + (#1497642) + * Thu Nov 02 2017 Colin Walters - 2017.13-2 - https://github.com/ostreedev/ostree/releases/tag/v2017.13