From: "Hugo SIMELIERE (Schneider Electric)" <[email protected]>

Pick patch from [1] dnsmasq 2.90 debian bookworm pacthes.

[1] 
https://sources.debian.org/src/dnsmasq/2.90-4~deb12u2/debian/patches/CVE-2026-5172.patch

Signed-off-by: Hugo SIMELIERE (Schneider Electric) 
<[email protected]>
Reviewed-by: Bruno VERNAY <[email protected]>
---
 .../recipes-support/dnsmasq/dnsmasq_2.90.bb   |  1 +
 .../dnsmasq/files/CVE-2026-5172.patch         | 39 +++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 
meta-networking/recipes-support/dnsmasq/files/CVE-2026-5172.patch

diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.90.bb 
b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.90.bb
index 3f06bbb6cf..3e8a808065 100644
--- a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.90.bb
+++ b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.90.bb
@@ -21,6 +21,7 @@ SRC_URI = 
"http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getV
            file://CVE-2026-4891.patch \
            file://CVE-2026-4892.patch \
            file://CVE-2026-4893.patch \
+           file://CVE-2026-5172.patch \
 "
 SRC_URI[sha256sum] = 
"8f6666b542403b5ee7ccce66ea73a4a51cf19dd49392aaccd37231a2c51b303b"
 
diff --git a/meta-networking/recipes-support/dnsmasq/files/CVE-2026-5172.patch 
b/meta-networking/recipes-support/dnsmasq/files/CVE-2026-5172.patch
new file mode 100644
index 0000000000..58aac87e4e
--- /dev/null
+++ b/meta-networking/recipes-support/dnsmasq/files/CVE-2026-5172.patch
@@ -0,0 +1,39 @@
+From f158664062e049ec4604f6e772551a00575011f4 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <[email protected]>
+Date: Mon, 30 Mar 2026 16:24:33 +0100
+Subject: [PATCH] Fix buffer overflow vulnerability in extract_addresses()
+ CVE-2026-5172
+
+Thanks to Hugo Martinez Ray for spotting this.
+
+The value of rdlen for an RR can be a lie, allowing the
+call to extract_name() at rfc1025.c:952 to advance the value of p1
+past the calculated end of the record. The makes the calculation
+of bytes remaining in the RR underflow to a huge number and results
+in a massive heap OOB read and certain crash.
+
+CVE: CVE-2026-5172
+Upstream-Status: Backport 
[https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=073082ddc0aba7b8efa15a688d6183463b65effa]
+
+Signed-off-by: Hugo SIMELIERE (Schneider Electric) 
<[email protected]>
+---
+ src/rfc1035.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/rfc1035.c b/src/rfc1035.c
+index 387d894a..32dc5711 100644
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -932,7 +932,8 @@ int extract_addresses(struct dns_header *header, size_t 
qlen, char *name, time_t
+                             /* Name, extract it then re-encode. */
+                             int len;
+                             
+-                            if (!extract_name(header, qlen, &p1, name, 1, 0))
++                            /* rdlen may lie, and extract_name() advances p1 
past where it says the record ends. */
++                            if (!extract_name(header, qlen, &p1, name, 1, 0) 
|| (p1 > endrr))
+                               {
+                                 blockdata_free(addr.rrblock.rrdata);
+                                 return 2;
+-- 
+2.43.0
+
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#127115): 
https://lists.openembedded.org/g/openembedded-devel/message/127115
Mute This Topic: https://lists.openembedded.org/mt/119406796/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to