From c5149ba88ae462a85ed5cc3134c1e15485d4e017 Mon Sep 17 00:00:00 2001 From: huangzq6 Date: Sat, 24 Dec 2022 17:17:45 +0800 Subject: [PATCH 1/2] fix coredump during ifp reconnect --- fix-coredump-during-ifp-reconnect.patch | 27 +++++++++++++++++++++++++ sssd.spec | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 fix-coredump-during-ifp-reconnect.patch diff --git a/fix-coredump-during-ifp-reconnect.patch b/fix-coredump-during-ifp-reconnect.patch new file mode 100644 index 0000000..573a388 --- /dev/null +++ b/fix-coredump-during-ifp-reconnect.patch @@ -0,0 +1,27 @@ +From 0a863c853bed35ac99aa905f4e6ded6c0ab1bd3c Mon Sep 17 00:00:00 2001 +From: huangzq6 +Date: Sat, 24 Dec 2022 16:28:57 +0800 +Subject: [PATCH] fix coredump during ifp reconnect + +--- + src/monitor/monitor.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c +index 55cb083..af2b278 100644 +--- a/src/monitor/monitor.c ++++ b/src/monitor/monitor.c +@@ -337,6 +337,10 @@ monitor_sbus_RegisterService(TALLOC_CTX *mem_ctx, + return ret; + } + ++ if (strcasecmp(name, "ifp") == 0) { ++ svc->socket_activated = true; ++ } ++ + *_monitor_version = MONITOR_VERSION; + + return EOK; +-- +2.27.0 + diff --git a/sssd.spec b/sssd.spec index 0a1a735..fa51b37 100644 --- a/sssd.spec +++ b/sssd.spec @@ -1,6 +1,6 @@ Name: sssd Version: 2.6.1 -Release: 7 +Release: 8 Summary: System Security Services Daemon License: GPLv3+ and LGPLv3+ URL: https://pagure.io/SSSD/sssd/ @@ -12,6 +12,7 @@ Patch6002: SDAP-sdap_get_generic_send-fix-mem-leak.patch Patch6003: sssctl-free-one-malloc-allocated-variable.patch Patch6004: PAM-P11-fixed-minor-mem-leak.patch Patch6005: SSS_CLIENT-mem-cache-fixed-missing-error-code.patch +Patch6006: fix-coredump-during-ifp-reconnect.patch Requires: python3-sssd = %{version}-%{release} Requires: libldb @@ -549,6 +550,9 @@ fi %{_libdir}/%{name}/modules/libwbclient.so %changelog +* Sat Dec 24 2022 huangzq6 -2.6.1-8 +- fix coredump during ifp reconnect + * Wed Dec 21 2022 zhouchenchen - 2.6.1-7 - backport some patch -- Gitee From 58477b775558692dd1bcab1c01753ba9665ef48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AF=92=E6=B1=9F=E8=88=9F?= Date: Sat, 24 Dec 2022 09:24:10 +0000 Subject: [PATCH 2/2] update fix-coredump-during-ifp-reconnect.patch. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 寒江舟 --- fix-coredump-during-ifp-reconnect.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fix-coredump-during-ifp-reconnect.patch b/fix-coredump-during-ifp-reconnect.patch index 573a388..7b83d78 100644 --- a/fix-coredump-during-ifp-reconnect.patch +++ b/fix-coredump-during-ifp-reconnect.patch @@ -3,6 +3,18 @@ From: huangzq6 Date: Sat, 24 Dec 2022 16:28:57 +0800 Subject: [PATCH] fix coredump during ifp reconnect +When the responder reconnects and gets old information in the service list (get_service_in_the_list), +the corresponding socket_activated flag will be set to false (svc->socket_activated = false). +The above behavior caused the main process to exit (monitor_quit), +did not set the corresponding destructor to NULL (talloc_set_destructor(svc->conn, NULL)), +and finally caused double-free during destructor, resulting in coredump. +Therefore, it is necessary to set the corresponding socket_activated flag to true at the end of the responder service reconnection. + +In fact, all services should have the above settings, but I have only reproduced the coredump scenario after ifp reconnection, +and other responders have not been tested for reproduction. +In order to keep the minimum modification, an if judgment is added here, and only the scene of ifp is processed. +The complete solution to this problem requires further optimization of the socket_activated setting mechanism. + --- src/monitor/monitor.c | 4 ++++ 1 file changed, 4 insertions(+) -- Gitee