summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvkumbhar <vkumbhar@mvista.com>2023-03-27 09:24:19 +0530
committerArmin Kuster <akuster808@gmail.com>2023-04-06 07:32:11 -0400
commit98e6e3168818fb37a06d21df11b38729c18b3c3d (patch)
tree6a659386c210face9120e61c08bd67eebca58d4a
parent4f78732be2e6950e8b252fc066058966baf9a3de (diff)
downloadmeta-openembedded-98e6e3168818fb37a06d21df11b38729c18b3c3d.tar.gz
dnsmasq: fix CVE-2023-28450 default maximum EDNS.0 UDP packet size was set to 4096 but should be 1232
Set the default maximum DNS UDP packet size to 1232. http://www.dnsflagday.net/2020/ refers. Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-networking/recipes-support/dnsmasq/dnsmasq/CVE-2023-28450.patch63
-rw-r--r--meta-networking/recipes-support/dnsmasq/dnsmasq_2.81.bb1
2 files changed, 64 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq/CVE-2023-28450.patch b/meta-networking/recipes-support/dnsmasq/dnsmasq/CVE-2023-28450.patch
new file mode 100644
index 0000000000..dd3bd27408
--- /dev/null
+++ b/meta-networking/recipes-support/dnsmasq/dnsmasq/CVE-2023-28450.patch
@@ -0,0 +1,63 @@
1From eb92fb32b746f2104b0f370b5b295bb8dd4bd5e5 Mon Sep 17 00:00:00 2001
2From: Simon Kelley <simon@thekelleys.org.uk>
3Date: Tue, 7 Mar 2023 22:07:46 +0000
4Subject: [PATCH] Set the default maximum DNS UDP packet size to 1232.
5
6Upstream-Status: Backport [https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=eb92fb32b746f2104b0f370b5b295bb8dd4bd5e5]
7CVE: CVE-2023-28450
8Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
9---
10 CHANGELOG | 8 ++++++++
11 man/dnsmasq.8 | 3 ++-
12 src/config.h | 2 +-
13 3 files changed, 11 insertions(+), 2 deletions(-)
14
15diff --git a/CHANGELOG b/CHANGELOG
16index d1d7e41..7a560d3 100644
17--- a/CHANGELOG
18+++ b/CHANGELOG
19@@ -91,6 +91,14 @@ version 2.81
20 Fix write-after-free error in DHCPv6 server code.
21 CVE-2022-0934 refers.
22
23+ Set the default maximum DNS UDP packet sice to 1232. This
24+ has been the recommended value since 2020 because it's the
25+ largest value that avoid fragmentation, and fragmentation
26+ is just not reliable on the modern internet, especially
27+ for IPv6. It's still possible to override this with
28+ --edns-packet-max for special circumstances.
29+
30+
31 version 2.80
32 Add support for RFC 4039 DHCP rapid commit. Thanks to Ashram Method
33 for the initial patch and motivation.
34diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
35index f2803f9..3cca4bc 100644
36--- a/man/dnsmasq.8
37+++ b/man/dnsmasq.8
38@@ -168,7 +168,8 @@ to zero completely disables DNS function, leaving only DHCP and/or TFTP.
39 .TP
40 .B \-P, --edns-packet-max=<size>
41 Specify the largest EDNS.0 UDP packet which is supported by the DNS
42-forwarder. Defaults to 4096, which is the RFC5625-recommended size.
43+forwarder. Defaults to 1232, which is the recommended size following the
44+DNS flag day in 2020. Only increase if you know what you are doing.
45 .TP
46 .B \-Q, --query-port=<query_port>
47 Send outbound DNS queries from, and listen for their replies on, the
48diff --git a/src/config.h b/src/config.h
49index 54f6f48..29ac3e7 100644
50--- a/src/config.h
51+++ b/src/config.h
52@@ -19,7 +19,7 @@
53 #define CHILD_LIFETIME 150 /* secs 'till terminated (RFC1035 suggests > 120s) */
54 #define TCP_MAX_QUERIES 100 /* Maximum number of queries per incoming TCP connection */
55 #define TCP_BACKLOG 32 /* kernel backlog limit for TCP connections */
56-#define EDNS_PKTSZ 4096 /* default max EDNS.0 UDP packet from RFC5625 */
57+#define EDNS_PKTSZ 1232 /* default max EDNS.0 UDP packet from from /dnsflagday.net/2020 */
58 #define SAFE_PKTSZ 1280 /* "go anywhere" UDP packet size */
59 #define KEYBLOCK_LEN 40 /* choose to minimise fragmentation when storing DNSSEC keys */
60 #define DNSSEC_WORK 50 /* Max number of queries to validate one question */
61--
622.18.2
63
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.81.bb b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.81.bb
index 8db57edb79..f2b8feac56 100644
--- a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.81.bb
+++ b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.81.bb
@@ -12,4 +12,5 @@ SRC_URI += "\
12 file://CVE-2020-25686-2.patch \ 12 file://CVE-2020-25686-2.patch \
13 file://CVE-2021-3448.patch \ 13 file://CVE-2021-3448.patch \
14 file://CVE-2022-0934.patch \ 14 file://CVE-2022-0934.patch \
15 file://CVE-2023-28450.patch \
15" 16"