!139 [sync] PR-138: monitor: avoid NULL deref in monitor_service_shutdown()

From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
This commit is contained in:
openeuler-ci-bot 2024-06-18 02:46:06 +00:00 committed by Gitee
commit 160df6bde7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From 38905cac4b67f0e4c4b0f59af9ea7474482f088e Mon Sep 17 00:00:00 2001
From: Alexey Tikhonov <atikhono@redhat.com>
Date: Mon, 27 May 2024 15:25:45 +0800
Subject: [PATCH] monitor: avoid NULL deref in monitor_service_shutdown()
Resolves: https://github.com/SSSD/sssd/issues/5598
Reviewed-by: Sumit Bose <sbose@redhat.com>
---
src/monitor/monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index f5f8fe9..b464a12 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -2107,7 +2107,7 @@ static void monitor_service_shutdown(struct mt_svc *svc)
/* We must decrease the number of services when shutting down
* a {socket,dbus}-activated service. */
- ctx->num_services--;
+ if (ctx != NULL) ctx->num_services--;
DEBUG(SSSDBG_TRACE_FUNC,
"Unregistering service %s (%p)\n", svc->identity, svc);
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: sssd
Version: 2.2.2
Release: 16
Release: 17
Summary: System Security Services Daemon
License: GPLv3+ and LGPLv3+
URL: https://pagure.io/SSSD/sssd/
@ -17,6 +17,7 @@ Patch7: backport-be-remove-accidental-sleep.patch
Patch8: backport-sssctl-sssctl_domains.c-null-dereference-fixed.patch
Patch9: backport-MONITOR-fix-socket_activated-flag-initialization.patch
Patch10: backport-CVE-2023-3758.patch
Patch11: backport-avoid-NULL-deref-in-monitor_service_shutdow.patch
Requires: python3-sssd = %{version}-%{release}
Requires: libldb
@ -590,6 +591,9 @@ fi
%{_libdir}/%{name}/modules/libwbclient.so
%changelog
* Mon May 27 2024 cenhuilin <cenhuilin@kylinos.cn> - 2.2.2-17
- monitor: avoid NULL deref in monitor_service_shutdown()
* Mon Apr 22 2024 wangqingsan <wangqingsan@huawei.com> - 2.2.2-16
- fix CVE-2023-3758