Security fix, CVE-2017-14494, Infoleak handling DHCPv6 forwarded requests. 11/170411/1
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 16 Oct 2017 07:00:26 +0000 (16:00 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Tue, 20 Feb 2018 01:46:14 +0000 (10:46 +0900)
Fix information leak in DHCPv6. A crafted DHCPv6 packet can
cause dnsmasq to forward memory from outside the packet
buffer to a DHCPv6 server when acting as a relay.

http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=33e3f1029c9ec6c63e430ff51063a6301d4b2262

Change-Id: Ia97bfc821fdb07ed599e4b4fa177280e0e52c8fa
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
src/rfc3315.c

index 816dbc8..17612b0 100644 (file)
@@ -216,6 +216,9 @@ static int dhcp6_maybe_relay(struct state *state, void *inbuff, size_t sz,
 
   for (opt = opts; opt; opt = opt6_next(opt, end))
     {
+      if (opt6_ptr(opt, 0) + opt6_len(opt) >= end) {
+        return 0;
+      }
       int o = new_opt6(opt6_type(opt));
       if (opt6_type(opt) == OPTION6_RELAY_MSG)
        {