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
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.
15 src/edns0.c | 8 +++++++-
16 1 file changed, 7 insertions(+), 1 deletion(-)
18 diff --git a/src/edns0.c b/src/edns0.c
19 index eed135e..5bdc133 100644
22 @@ -192,9 +192,15 @@ size_t add_pseudoheader(struct dns_header *header, size_t plen, unsigned char *l
24 ntohs(header->ancount) + ntohs(header->nscount) + ntohs(header->arcount),
31 - return plen; /* Too big */
34 + return plen; /* Too big */
36 *p++ = 0; /* empty name */
38 PUTSHORT(udp_sz, p); /* max packet length, 512 if not given in EDNS0 header */