From d5422e563facc33881763a587b37dd29012e160b Mon Sep 17 00:00:00 2001 From: Sona Sarmadi Date: Wed, 4 Oct 2017 12:34:26 +0200 Subject: dnsmasq: CVE-2017-14492 Heap based overflow. References: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2017-14492 https://security.googleblog.com/2017/10/behind-masq-yet-more-dns-and-dhcp.html Signed-off-by: Sona Sarmadi Signed-off-by: Adrian Dudau --- .../dnsmasq/dnsmasq/CVE-2017-14492.patch | 57 ++++++++++++++++++++++ recipes-networking/dnsmasq/dnsmasq_%.bbappend | 1 + 2 files changed, 58 insertions(+) create mode 100644 recipes-networking/dnsmasq/dnsmasq/CVE-2017-14492.patch diff --git a/recipes-networking/dnsmasq/dnsmasq/CVE-2017-14492.patch b/recipes-networking/dnsmasq/dnsmasq/CVE-2017-14492.patch new file mode 100644 index 0000000..5b66944 --- /dev/null +++ b/recipes-networking/dnsmasq/dnsmasq/CVE-2017-14492.patch @@ -0,0 +1,57 @@ +From 24036ea507862c7b7898b68289c8130f85599c10 Mon Sep 17 00:00:00 2001 +From: Simon Kelley +Date: Mon, 25 Sep 2017 18:47:15 +0100 +Subject: [PATCH] Security fix, CVE-2017-14492, DHCPv6 RA heap overflow. + +Fix heap overflow in IPv6 router advertisement code. +This is a potentially serious security hole, as a +crafted RA request can overflow a buffer and crash or +control dnsmasq. Attacker must be on the local network. + +CVE: CVE-2017-14492 +Upstream-Status: Backport + +Signed-off-by: Sona Sarmadi +--- + CHANGELOG | 10 +++++++++- + src/radv.c | 3 +++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index a7c2f35..df6c157 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -35,7 +35,15 @@ version 2.78 + and Kevin Hamacher of the Google Security Team for + finding this. + +- ++ Fix heap overflow in IPv6 router advertisement code. ++ This is a potentially serious security hole, as a ++ crafted RA request can overflow a buffer and crash or ++ control dnsmasq. Attacker must be on the local network. ++ CVE-2017-14492 applies. ++ Credit to Felix Wilhelm, Fermin J. Serna, Gabriel Campana ++ and Kevin Hamacher of the Google Security Team for ++ finding this. ++ + + version 2.77 + Generate an error when configured with a CNAME loop, +diff --git a/src/radv.c b/src/radv.c +index 1032189..9b7e52c 100644 +--- a/src/radv.c ++++ b/src/radv.c +@@ -198,6 +198,9 @@ void icmp6_packet(time_t now) + /* look for link-layer address option for logging */ + if (sz >= 16 && packet[8] == ICMP6_OPT_SOURCE_MAC && (packet[9] * 8) + 8 <= sz) + { ++ if ((packet[9] * 8 - 2) * 3 - 1 >= MAXDNAME) { ++ return; ++ } + print_mac(daemon->namebuff, &packet[10], (packet[9] * 8) - 2); + mac = daemon->namebuff; + } +-- +1.7.10.4 + diff --git a/recipes-networking/dnsmasq/dnsmasq_%.bbappend b/recipes-networking/dnsmasq/dnsmasq_%.bbappend index e228035..1fc8819 100644 --- a/recipes-networking/dnsmasq/dnsmasq_%.bbappend +++ b/recipes-networking/dnsmasq/dnsmasq_%.bbappend @@ -3,4 +3,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://0001-CVE-2017-14491.patch \ file://0002-CVE-2017-14491.patch \ + file://CVE-2017-14492.patch \ " -- cgit v1.2.3-54-g00ecf