Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-integ / recipes-support / dnsmasq / dnsmasq / stx / dnsmasq-2.76-CVE-2017-14494.patch
1 From 8c8fe650dc17aad0fbafc920fde719218dc4568d Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Mon, 25 Sep 2017 20:05:11 +0100
4 Subject: [PATCH 4/9]     Security fix, CVE-2017-14494, Infoleak handling
5  DHCPv6 forwarded requests.
6
7     Fix information leak in DHCPv6. A crafted DHCPv6 packet can
8     cause dnsmasq to forward memory from outside the packet
9     buffer to a DHCPv6 server when acting as a relay.
10 ---
11  src/rfc3315.c | 3 +++
12  1 file changed, 3 insertions(+)
13
14 diff --git a/src/rfc3315.c b/src/rfc3315.c
15 index 8d18a28..03b3f84 100644
16 --- a/src/rfc3315.c
17 +++ b/src/rfc3315.c
18 @@ -216,6 +216,9 @@ static int dhcp6_maybe_relay(struct state *state, void *inbuff, size_t sz,
19    
20    for (opt = opts; opt; opt = opt6_next(opt, end))
21      {
22 +      if (opt6_ptr(opt, 0) + opt6_len(opt) >= end) {
23 +        return 0;
24 +      }
25        int o = new_opt6(opt6_type(opt));
26        if (opt6_type(opt) == OPTION6_RELAY_MSG)
27         {
28 -- 
29 2.9.5
30