From 0edf65fe6453b8f88f333fdef37a14663422c321 Mon Sep 17 00:00:00 2001 From: shechenglong Date: Wed, 16 Jul 2025 16:22:29 +0800 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. Signed-off-by: shechenglong (cherry picked from commit 0523f405f98b88bfe0059265c65d17d90f2f771e) --- ...ie-not-reaped-when-js-spawned-proces.patch | 32 +++++++++++++++++++ polkit.spec | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 backport-polkitd-fix-zombie-not-reaped-when-js-spawned-proces.patch diff --git a/backport-polkitd-fix-zombie-not-reaped-when-js-spawned-proces.patch b/backport-polkitd-fix-zombie-not-reaped-when-js-spawned-proces.patch new file mode 100644 index 0000000..c8eef1c --- /dev/null +++ b/backport-polkitd-fix-zombie-not-reaped-when-js-spawned-proces.patch @@ -0,0 +1,32 @@ +From f3b8b378d81c7d5c4eb585db8ac25a0c3d2cac07 Mon Sep 17 00:00:00 2001 +From: shechenglong +Date: Tue, 15 Jul 2025 12:15:13 +0800 +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. + +Signed-off-by: shechenglong +--- + src/polkitbackend/polkitbackendcommon.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/polkitbackend/polkitbackendcommon.c b/src/polkitbackend/polkitbackendcommon.c +index 6783dff..1201dd3 100644 +--- a/src/polkitbackend/polkitbackendcommon.c ++++ b/src/polkitbackend/polkitbackendcommon.c +@@ -63,7 +63,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; + } +-- +2.33.0 diff --git a/polkit.spec b/polkit.spec index 12bc67c..8848ae2 100644 --- a/polkit.spec +++ b/polkit.spec @@ -1,6 +1,6 @@ Name: polkit Version: 0.120 -Release: 9 +Release: 10 Summary: Define and Handle authorizations tool License: LGPLv2+ URL: http://www.freedesktop.org/wiki/Software/polkit @@ -13,6 +13,7 @@ Patch2: backport-CVE-2021-4115-GHSL-2021-077-fix.patch Patch3: backport-Added-support-for-duktape-as-JS-engine.patch Patch4: backport-build-Add-fallback-looking-for-duktape-s-library-and.patch Patch5: fix-core-dump-problem.patch +Patch6: backport-polkitd-fix-zombie-not-reaped-when-js-spawned-proces.patch BuildRequires: gcc-c++ glib2-devel >= 2.30.0 expat-devel pam-devel gtk-doc intltool BuildRequires: gobject-introspection-devel systemd systemd-devel @@ -130,6 +131,9 @@ exit 0 %{_datadir}/man/man8/* %changelog +* Wed Jul 16 2025 shechenglong - 0.120-10 +- fix zombie not reaped when js spawned process timed out + * Fri Feb 17 2023 wangyu - 0.120-9 - revert: delete the expired polkit-pkla-compat -- Gitee