Skip to contentSkip to conversation

unbound: upgrade 1.22.0 -> 1.24.2

PATCH New Gyorgy Sarvari 1 participant 2 messages Dec 16, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 unbound: upgrade 1.22.0 -> 1.24.2

Contains fixes for CVE-2025-11411 and CVE-2025-5994.

Drop patch that was incorporated in this release.

Changelogs:
https://github.com/NLnetLabs/unbound/releases/tag/release-1.24.2
https://github.com/NLnetLabs/unbound/releases/tag/release-1.24.1
https://github.com/NLnetLabs/unbound/releases/tag/release-1.24.0
https://github.com/NLnetLabs/unbound/releases/tag/release-1.23.1
https://github.com/NLnetLabs/unbound/releases/tag/release-1.23.0

---
 ...cc-15-Wbuiltin-declaration-mismatch-.patch | 44 -------------------
 .../{unbound_1.22.0.bb => unbound_1.24.2.bb}  | 10 +----
 2 files changed, 2 insertions(+), 52 deletions(-)
 delete mode 100644 meta-networking/recipes-support/unbound/unbound/0001-fix-build-with-gcc-15-Wbuiltin-declaration-mismatch-.patch
 rename meta-networking/recipes-support/unbound/{unbound_1.22.0.bb => unbound_1.24.2.bb} (84%)
meta-networking/recipes-support/unbound/unbound/0001-fix-build-with-gcc-15-Wbuiltin-declaration-mismatch-.patch deleted +0 -44
deleted file mode 100644
index 70a41f7e37..0000000000
@@ -1,44 +0,0 @@
-From 1c58ce07919c36e6a11eead67bd6d14cc22acaec Mon Sep 17 00:00:00 2001
-From: "mark.yang" <[email protected]>
-Date: Wed, 2 Apr 2025 15:25:42 +0900
-Subject: [PATCH] fix build with gcc-15 -Wbuiltin-declaration-mismatch error
-
-See more details: http://errors.yoctoproject.org/Errors/Details/850313
-../git/compat/malloc.c:9:7: warning: conflicting types for built-in function 'malloc'; expected 'void *(long unsigned int)' [-Wbuiltin-declaration-mismatch]
-    9 | void *malloc ();
-      |       ^~~~~~
-../git/compat/malloc.c:5:1: note: 'malloc' is declared in header '<stdlib.h>'
-    4 | #include "config.h"
-  +++ |+#include <stdlib.h>
-    5 | #undef malloc
-../git/compat/malloc.c: In function 'rpl_malloc_unbound':
-../git/compat/malloc.c:23:10: error: too many arguments to function 'malloc'; expected 0, have 1
-   23 |   return malloc (n);
-      |          ^~~~~~  ~
-../git/compat/malloc.c:9:7: note: declared here
-    9 | void *malloc ();
-      |       ^~~~~~
-
-* Seeing that there is '#undef malloc', it appears they don't want to
-  use the malloc from stdlib.h.
-  Therefore, we need to correctly define the parameters for malloc.
-
-Upstream-Status: Submitted [https://github.com/NLnetLabs/unbound/pull/1262]
-Signed-off-by: mark.yang <[email protected]>
----
- compat/malloc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/compat/malloc.c b/compat/malloc.c
-index d8097b13e..af9dcf134 100644
---- a/compat/malloc.c
-+++ b/compat/malloc.c
-@@ -6,7 +6,7 @@
- #include <sys/types.h>
- 
- #ifndef USE_WINSOCK
--void *malloc ();
-+void *malloc (size_t n);
- #else
- /* provide a prototype */
- void *malloc (size_t n);
meta-networking/recipes-support/unbound/unbound_1.24.2.bb renamed from meta-networking/recipes-support/unbound/unbound_1.22.0.bb +2 -8
similarity index 84%
rename from meta-networking/recipes-support/unbound/unbound_1.22.0.bb
rename to meta-networking/recipes-support/unbound/unbound_1.24.2.bb
index c35148b77e..4ae8db4d08 100644
@@ -9,17 +9,11 @@ SECTION = "net"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
 
-SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=https;branch=master \
+SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=https;branch=master;tag=release-${PV} \
            file://run-ptest \
-           file://0001-fix-build-with-gcc-15-Wbuiltin-declaration-mismatch-.patch \
            "
 
-# 17 commits after 1.22.0 tag:
-# https://github.com/NLnetLabs/unbound/compare/release-1.22.0...7985d17b57d25be262de56c29a43ae4b61c1b896
-# to include fix for occasional build failure:
-# https://github.com/NLnetLabs/unbound/commit/46cfbf313d812a6e50614a691e162b171dc91d7b
-PV .= "+git"
-SRCREV = "7985d17b57d25be262de56c29a43ae4b61c1b896"
+SRCREV = "f6269baa605d31859f28770e01a24e3677e5f82c"
 
 inherit autotools pkgconfig systemd update-rc.d ptest
 
#1 lore raw

PATCH 2/2 unbound: complete ptest support

The recipe had already an almost working ptest config which wasn't enabled, it just needed some small fixes to make it work:
correct the output of the run-ptest script, and install some extra testdata.

Execution is quick, single digit seconds:

root@qemux86-64:/usr/lib/unbound/ptest/tests# ptest-runner
START: ptest-runner
2025-12-16T11:53
BEGIN: /usr/lib/unbound/ptest
Start of unbound 1.24.2 unit test.
test authzone functions
test negative cache functions
test ub_random functions
[...many lines...]
PASS: ./testdata/val_unsecds_negcache.rpl
PASS: ./testdata/val_unsecds_qtypeds.rpl
PASS: ./testdata/val_wild_pos.rpl
PASS: ./testdata/version_bind.rpl
PASS: ./testdata/version_bind_hide.rpl
PASS: ./testdata/views.rpl
DURATION: 4
END: /usr/lib/unbound/ptest
2025-12-16T11:53
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../ptest-packagelists-meta-networking.inc    |  1 +
 .../recipes-support/unbound/unbound/run-ptest | 20 +++++++++++++++----
 .../recipes-support/unbound/unbound_1.24.2.bb |  8 +++++++-
 3 files changed, 24 insertions(+), 5 deletions(-)
meta-networking/conf/include/ptest-packagelists-meta-networking.inc +1 -0
index 838aee94d3..9bbae5ac91 100644
@@ -23,6 +23,7 @@ PTESTS_FAST_META_NETWORKING = "\
     python3-scapy \
     squid \
     tcpdump \
+    unbound \
     wolfssl \
 "
 PTESTS_FAST_META_NETWORKING:remove:libc-musl = "\
meta-networking/recipes-support/unbound/unbound/run-ptest +16 -4
index 433a687c65..3801233eeb 100644
@@ -2,15 +2,27 @@
 
 cd tests || exit 1
 retVal=0
-./unittest
-./testbound -s
+if ./unittest; then
+    echo PASS: unittest
+else
+    echo FAIL: unittest
+    retVal=1
+fi
+
+if ./testbound -s; then
+    echo PASS: testbound selftest
+else
+    echo FAIL: testbound selftest
+    retVal=1
+fi
+
 for x in ./testdata/*.rpl; do
 	output="$(./testbound -p $x -o -vvvvv 2>&1)"
         if test $? -eq 0; then
-                echo "$x :Pass"
+                echo "PASS: $x"
         else
                 echo "$output"
-                echo "$x :Fail"
+                echo "FAIL: $x"
                 retVal=1
         fi
 done
meta-networking/recipes-support/unbound/unbound_1.24.2.bb +7 -1
index 4ae8db4d08..e41e2dc065 100644
@@ -47,8 +47,11 @@ do_install:append() {
 }
 
 do_install_ptest() {
-        install -d ${D}${PTEST_PATH}/tests
         install -d ${D}${PTEST_PATH}/tests/testdata
+        install -d ${D}${PTEST_PATH}/sources/${BP}
+        # unittests are looking for the data in the source folder, though it's the
+        # same data used by the other tests
+        ln -sr ${D}${PTEST_PATH}/tests ${D}${PTEST_PATH}/sources/${BP}/testdata
 
         install -m 0544 ${B}/unittest ${D}${PTEST_PATH}/tests/
         install -m 0544 ${B}/testbound ${D}${PTEST_PATH}/tests/
@@ -56,7 +59,10 @@ do_install_ptest() {
         install -m 0664 ${S}/testdata/test_sigs* ${D}${PTEST_PATH}/tests/
         install -m 0664 ${S}/testdata/test_ds* ${D}${PTEST_PATH}/tests/
         install -m 0664 ${S}/testdata/test_nsec3_hash* ${D}${PTEST_PATH}/tests/
+        install -m 0664 ${S}/testdata/test_ldnsrr* ${D}${PTEST_PATH}/tests/
+        install -m 0664 ${S}/testdata/zonemd.example* ${D}${PTEST_PATH}/tests/
         install -m 0644 ${S}/testdata/*.rpl ${D}/${PTEST_PATH}/tests/testdata/
+
 }
 
 SYSTEMD_SERVICE:${PN} = "${BPN}.service"