check before use daemon->shm_info

(cherry picked from commit 29119948cd4fba5b21581ea422c0f8d4eaa0417f)
This commit is contained in:
eaglegai 2025-01-23 02:10:37 +00:00 committed by openeuler-sync-bot
parent e3081b651b
commit 07f8574fb5
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From 073c7301ebdf7511320ec817ad7ecacf6b45c4be Mon Sep 17 00:00:00 2001
From: eaglegai <31752768+eaglegai@users.noreply.github.com>
Date: Tue, 21 Jan 2025 22:47:51 +0800
Subject: [PATCH] check before use daemon->shm_info (#1229)
fix core after the command `unbound-control stop unbound`
fix:https://github.com/NLnetLabs/unbound/issues/1228
Signed-off-by: eaglegai <eaglegai@163.com>
---
util/shm_side/shm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/shm_side/shm_main.c b/util/shm_side/shm_main.c
index 6fd1f5ea6..751d6d649 100644
--- a/util/shm_side/shm_main.c
+++ b/util/shm_side/shm_main.c
@@ -195,7 +195,7 @@ void shm_main_shutdown(struct daemon* daemon)
{
#ifdef HAVE_SHMGET
/* web are OK, just disabled */
- if(!daemon->cfg->shm_enable)
+ if(!daemon->cfg->shm_enable || !daemon->shm_info)
return;
verbose(VERB_DETAIL, "SHM shutdown - KEY [%d] - ID CTL [%d] ARR [%d] - PTR CTL [%p] ARR [%p]",

View File

@ -2,7 +2,7 @@
Name: unbound
Version: 1.17.1
Release: 10
Release: 11
Summary: Unbound is a validating, recursive, caching DNS resolver
License: BSD-3-Clause
Url: https://nlnetlabs.nl/projects/unbound/about/
@ -34,6 +34,7 @@ Patch10: backport-002-CVE-2024-43168.patch
Patch11: backport-003-CVE-2024-43168.patch
Patch12: backport-004-CVE-2024-43168.patch
Patch13: backport-CVE-2024-8508.patch
Patch14: backport-check-before-use-daemon-shm_info.patch
BuildRequires: make flex swig pkgconfig systemd
BuildRequires: libevent-devel expat-devel openssl-devel python3-devel
@ -271,6 +272,12 @@ popd
%{_sbindir}/unbound-streamtcp
%changelog
* Thu Jan 23 2025 gaihuiying <eaglegai@163.com> - 1.17.1-11
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:backport upstream to add check to fix coredump
* Wed Oct 16 2024 gaihuiying <eaglegai@163.com> - 1.17.1-10
- Type:cves
- CVE:CVE-2024-8508