Blame SOURCES/dnsmasq-2.76-CVE-2017-14492.patch

a03026
From c14b8b511ac55f6933aebefbd6cc27c1ec74ad58 Mon Sep 17 00:00:00 2001
a03026
From: Simon Kelley <simon@thekelleys.org.uk>
a03026
Date: Mon, 25 Sep 2017 18:47:15 +0100
a03026
Subject: [PATCH 2/9]     Security fix, CVE-2017-14492, DHCPv6 RA heap
a03026
 overflow.
a03026
a03026
    Fix heap overflow in IPv6 router advertisement code.
a03026
    This is a potentially serious security hole, as a
a03026
    crafted RA request can overflow a buffer and crash or
a03026
    control dnsmasq. Attacker must be on the local network.
a03026
---
a03026
 src/radv.c | 3 +++
a03026
 1 file changed, 3 insertions(+)
a03026
a03026
diff --git a/src/radv.c b/src/radv.c
a03026
index 749b666..d09fe0e 100644
a03026
--- a/src/radv.c
a03026
+++ b/src/radv.c
a03026
@@ -198,6 +198,9 @@ void icmp6_packet(time_t now)
a03026
       /* look for link-layer address option for logging */
a03026
       if (sz >= 16 && packet[8] == ICMP6_OPT_SOURCE_MAC && (packet[9] * 8) + 8 <= sz)
a03026
 	{
a03026
+	  if ((packet[9] * 8 - 2) * 3 - 1 >= MAXDNAME) {
a03026
+	    return;
a03026
+	  }
a03026
 	  print_mac(daemon->namebuff, &packet[10], (packet[9] * 8) - 2);
a03026
 	  mac = daemon->namebuff;
a03026
 	}
a03026
-- 
a03026
2.9.5
a03026