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-14495.patch
1 From f2ad2cecb55825f7e4409222de1688b9ceebceda Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Mon, 25 Sep 2017 20:16:50 +0100
4 Subject: [PATCH 6/9]     Security fix, CVE-2017-14495, OOM in DNS response
5  creation.
6
7     Fix out-of-memory Dos vulnerability. An attacker which can
8     send malicious DNS queries to dnsmasq can trigger memory
9     allocations in the add_pseudoheader function
10     The allocated memory is never freed which leads to a DoS
11     through memory exhaustion. dnsmasq is vulnerable only
12     if one of the following option is specified:
13     --add-mac, --add-cpe-id or --add-subnet.
14 ---
15  src/edns0.c | 8 +++++++-
16  1 file changed, 7 insertions(+), 1 deletion(-)
17
18 diff --git a/src/edns0.c b/src/edns0.c
19 index eed135e..5bdc133 100644
20 --- a/src/edns0.c
21 +++ b/src/edns0.c
22 @@ -192,9 +192,15 @@ size_t add_pseudoheader(struct dns_header *header, size_t plen, unsigned char *l
23           !(p = skip_section(p, 
24                              ntohs(header->ancount) + ntohs(header->nscount) + ntohs(header->arcount), 
25                              header, plen)))
26 +      {
27 +       free(buff);
28         return plen;
29 +      }
30        if (p + 11 > limit)
31 -       return plen; /* Too big */
32 +      {
33 +        free(buff);
34 +        return plen; /* Too big */
35 +      }
36        *p++ = 0; /* empty name */
37        PUTSHORT(T_OPT, p);
38        PUTSHORT(udp_sz, p); /* max packet length, 512 if not given in EDNS0 header */
39 -- 
40 2.9.5
41