From 78f3f3ba95dde0cee68f27cab8417e6d5ce0183f0b6be6961f148e9591aae8b5 Mon Sep 17 00:00:00 2001 From: Luciano Santos Date: Tue, 21 Aug 2018 05:03:16 +0000 Subject: [PATCH] Accepting request 629743 from home:iznogood:branches:Base:System - Add polkit-fix-possible-resource-leak.patch: Fix possible resource leak found by static analyzer. - Add polkit-fix-leaking-zombie-child-processes.patch: polkitd: fix zombie not reaped when js spawned process timed out (fdo#106021). OBS-URL: https://build.opensuse.org/request/show/629743 OBS-URL: https://build.opensuse.org/package/show/Base:System/polkit?expand=0&rev=125 --- ...t-fix-leaking-zombie-child-processes.patch | 33 +++++++++++++++++++ polkit-fix-possible-resource-leak.patch | 24 ++++++++++++++ polkit.changes | 8 +++++ polkit.spec | 6 ++++ 4 files changed, 71 insertions(+) create mode 100644 polkit-fix-leaking-zombie-child-processes.patch create mode 100644 polkit-fix-possible-resource-leak.patch diff --git a/polkit-fix-leaking-zombie-child-processes.patch b/polkit-fix-leaking-zombie-child-processes.patch new file mode 100644 index 0000000..a11120b --- /dev/null +++ b/polkit-fix-leaking-zombie-child-processes.patch @@ -0,0 +1,33 @@ +From 8638ec5cd534dcc616b68e5b0744c493c0c71dc9 Mon Sep 17 00:00:00 2001 +From: Jan Rybar +Date: Wed, 15 Aug 2018 16:11:22 +0200 +Subject: Leaking zombie child processes Resolves: bz#106021 + +Subject: [PATCH] polkitd: fix zombie not reaped when js spawned process timed + out + +The child watch source attached to thread context didn't work due +to the release of it's main loop and context outside. So we attach +the source to the global default main context to make it work and +avoid zombies. +--- + src/polkitbackend/polkitbackendjsauthority.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp +index 517f3c6..7602714 100644 +--- a/src/polkitbackend/polkitbackendjsauthority.cpp ++++ b/src/polkitbackend/polkitbackendjsauthority.cpp +@@ -1595,7 +1595,8 @@ utils_spawn_data_free (UtilsSpawnData *data) + (GSourceFunc) utils_child_watch_from_release_cb, + source, + (GDestroyNotify) g_source_destroy); +- g_source_attach (source, data->main_context); ++ /* attach source to the global default main context */ ++ g_source_attach (source, NULL); + g_source_unref (source); + data->child_pid = 0; + } +-- +cgit v1.1 + diff --git a/polkit-fix-possible-resource-leak.patch b/polkit-fix-possible-resource-leak.patch new file mode 100644 index 0000000..bc2558a --- /dev/null +++ b/polkit-fix-possible-resource-leak.patch @@ -0,0 +1,24 @@ +From 542c6ec832919df6a74e16aba574adaeebe35e08 Mon Sep 17 00:00:00 2001 +From: Jan Rybar +Date: Thu, 9 Aug 2018 16:46:38 +0200 +Subject: Possible resource leak found by static analyzer + +--- + src/polkitagent/polkitagentlistener.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/polkitagent/polkitagentlistener.c b/src/polkitagent/polkitagentlistener.c +index debd1bb..2e0e11e 100644 +--- a/src/polkitagent/polkitagentlistener.c ++++ b/src/polkitagent/polkitagentlistener.c +@@ -439,6 +439,7 @@ polkit_agent_listener_register_with_options (PolkitAgentListener *listener, + server->thread_initialization_error = NULL; + g_thread_join (server->thread); + server_free (server); ++ server = NULL; + goto out; + } + } +-- +cgit v1.1 + diff --git a/polkit.changes b/polkit.changes index 1c9eadc..adb2af2 100644 --- a/polkit.changes +++ b/polkit.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Aug 17 07:56:08 UTC 2018 - bjorn.lie@gmail.com + +- Add polkit-fix-possible-resource-leak.patch: Fix possible + resource leak found by static analyzer. +- Add polkit-fix-leaking-zombie-child-processes.patch: polkitd: fix + zombie not reaped when js spawned process timed out (fdo#106021). + ------------------------------------------------------------------- Wed Jul 11 10:48:37 UTC 2018 - meissner@suse.com diff --git a/polkit.spec b/polkit.spec index 29d6cce..044287e 100644 --- a/polkit.spec +++ b/polkit.spec @@ -34,6 +34,10 @@ Patch0: polkit-no-wheel-group.patch Patch1: polkit-gettext.patch # PATCH-FIX-UPSTREAM pkexec.patch schwab@suse.de -- pkexec: allow --version and --help even if not setuid Patch2: pkexec.patch +# PATCH-FIX-UPSTREAM polkit-fix-possible-resource-leak.patch -- Fix possible resource leak found by static analyzer +Patch3: polkit-fix-possible-resource-leak.patch +# PATCH-FIX-UPSTREAM polkit-fix-leaking-zombie-child-processes.patch fdo#106021 -- polkitd: fix zombie not reaped when js spawned process timed out +Patch4: polkit-fix-leaking-zombie-child-processes.patch BuildRequires: gcc-c++ BuildRequires: gtk-doc @@ -117,6 +121,8 @@ This package provides the GObject Introspection bindings for PolicyKit. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build export V=1