<div dir="ltr">Hello,<div><br></div><div>I'd like to ask about how to use dnsmasq to limit the dangers of CVE-2015-7547.</div><div><br></div><div>This issue was discussed in these links:</div><div><br></div><div><a href="https://googleonlinesecurity.blogspot.com/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html">https://googleonlinesecurity.blogspot.com/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html</a><br></div><div><a rel="nofollow noreferrer" target="_blank" href="https://www.google.com/url?q=https%3A%2F%2Fsourceware.org%2Fml%2Flibc-alpha%2F2016-02%2Fmsg00416.html&sa=D&sntz=1&usg=AFQjCNEaOnkLB_utlE1Vs-NmxifGdiyc-A" class="" tabindex="-1" dir="ltr" style="color:rgb(38,50,56);font-size:13px;line-height:16px">https://sourceware.org/ml/libc-alpha/2016-02/msg00416.html</a><br></div><div><br></div><div>and they suggest using a local resolver ( google specifically mentions dnsmasq ) to drop these malformed packets.</div><div><br></div><div>What I'd like to understand is what should be set in dnsmasq to actually limit the UDP size to 512 bytes and the TCP replies to 1024 bytes as suggested. Or if the packets needed are always malformed and dnsmasq will always drop them?</div><div><br></div><div>I checked the settings and the only size limit I saw was for "edns-packet-max", but that doesn't seem like the right setting.</div><div><br></div><div>I tried looking at the code, but I wasn't able to find where the size is limited and large packets are therefore dropped. I also wasn't able to find ( by grepping all the instances of "my_syslog" ) a spot where malformed packets were mentioned. So I'm at a bit of a loss about what to do to progress further.</div><div><br></div><div>I did use the PoC script provided by Google and was able to see that while running the test code does cause a segfault, having the test program query through dnsmasq causes no issues. Since it appears the PoC code uses large packets to cause the issue ( i.e. 2500 byte UDP packets when we should be limiting it to 512 per the suggestion ), I'm not 100% convinced that dnsmasq with it's default settings is the best mitigation to use until glibc can be updated.</div><div><br></div><div>Thanks,</div><div><br></div><div>Ethan</div></div>