From 9ab3949bca4a2aeddbf2539fdf5d28cc2d9c9c40 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 2 Feb 2014 11:28:03 +0100 Subject: [PATCH] Fix crash in libnm-glib getting secrets --- ...secrets-to-prevent-crash-getting-sec.patch | 31 +++++++++++++++++++ NetworkManager.spec | 7 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0002-libnm-glib-zero-secrets-to-prevent-crash-getting-sec.patch diff --git a/0002-libnm-glib-zero-secrets-to-prevent-crash-getting-sec.patch b/0002-libnm-glib-zero-secrets-to-prevent-crash-getting-sec.patch new file mode 100644 index 0000000..c427d9f --- /dev/null +++ b/0002-libnm-glib-zero-secrets-to-prevent-crash-getting-sec.patch @@ -0,0 +1,31 @@ +From fa557a976fd8c6528e133b56be478cd50f4a915a Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Fri, 31 Jan 2014 15:22:16 -0600 +Subject: [PATCH 1/1] libnm-glib: zero 'secrets' to prevent crash getting + secrets + +If the GetSecrets call returned an error (eg, no secrets) then +'secrets' isn't set by dbus_g_proxy_end_call() and is garbage, +then gets freed. + +(cherry picked from commit e922c120a3cf1bb3bd8def11bd0f23f1e18a0751) +--- + libnm-glib/nm-remote-connection.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c +index 35c5be8..f4640c3 100644 +--- a/libnm-glib/nm-remote-connection.c ++++ b/libnm-glib/nm-remote-connection.c +@@ -313,7 +313,7 @@ get_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *proxy_call, gpointer user_dat + { + RemoteCall *call = user_data; + NMRemoteConnectionGetSecretsFunc func = (NMRemoteConnectionGetSecretsFunc) call->callback; +- GHashTable *secrets; ++ GHashTable *secrets = NULL; + GError *error = NULL; + + dbus_g_proxy_end_call (proxy, proxy_call, &error, +-- +1.8.5.3 + diff --git a/NetworkManager.spec b/NetworkManager.spec index d49cebf..61fd043 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -20,7 +20,7 @@ Name: NetworkManager Summary: Network connection manager and user applications Epoch: 1 Version: 0.9.9.0 -Release: 26%{snapshot}%{?dist} +Release: 27%{snapshot}%{?dist} Group: System Environment/Base License: GPLv2+ URL: http://www.gnome.org/projects/NetworkManager/ @@ -29,6 +29,7 @@ Source: %{name}-%{realversion}%{snapshot}%{git_sha}.tar.bz2 Source1: NetworkManager.conf Source2: 00-server.conf Patch1: 0001-explain-dns1-dns2.patch +Patch2: 0002-libnm-glib-zero-secrets-to-prevent-crash-getting-sec.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -153,6 +154,7 @@ deployments. %setup -q -n NetworkManager-%{realversion} %patch1 -p1 -b .0001.explain-dns1-dns2.orig +%patch2 -p1 -b .0002.libnm-glib-secrets.orig %build @@ -351,6 +353,9 @@ fi %config %{_sysconfdir}/%{name}/conf.d/00-server.conf %changelog +* Sun Feb 2 2014 Thomas Haller - 0.9.9.0-27.git20140131 +- core: fix crash getting secrets in libnm-glib + * Fri Jan 31 2014 Jiří Klimeš - 0.9.9.0-26.git20140131 - Update to a git snapshot (git20140131)