From 82f1853d49359cd6cbbdd728f99470cbca006a98 Mon Sep 17 00:00:00 2001 From: eaglegai Date: Thu, 23 Jan 2025 02:42:56 +0000 Subject: [PATCH] check before use daemon->shm_info --- ...ort-check-before-use-daemon-shm_info.patch | 27 +++++++++++++++++++ unbound.spec | 9 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 backport-check-before-use-daemon-shm_info.patch diff --git a/backport-check-before-use-daemon-shm_info.patch b/backport-check-before-use-daemon-shm_info.patch new file mode 100644 index 0000000..0e61e6c --- /dev/null +++ b/backport-check-before-use-daemon-shm_info.patch @@ -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 +--- + 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]", diff --git a/unbound.spec b/unbound.spec index 66978a4..197dab0 100644 --- a/unbound.spec +++ b/unbound.spec @@ -2,7 +2,7 @@ Name: unbound Version: 1.13.2 -Release: 15 +Release: 16 Summary: Unbound is a validating, recursive, caching DNS resolver License: BSD Url: https://nlnetlabs.nl/projects/unbound/about/ @@ -35,6 +35,7 @@ Patch10: backport-003-CVE-2024-43168.patch Patch11: backport-004-CVE-2024-43168.patch Patch12: backport-CVE-2024-33655.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 @@ -251,6 +252,12 @@ popd %{_mandir}/man* %changelog +* Thu Jan 23 2025 gaihuiying - 1.13.2-16 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:backport upstream to add check to fix coredump + * Wed Oct 16 2024 gaihuiying - 1.13.2-15 - Type:cves - CVE:CVE-2024-8508 -- Gitee