~paelzer/ubuntu/+source/dnsmasq:fix-1726017-xenial

Last commit made on 2017-10-23
Get this branch:
git clone -b fix-1726017-xenial https://git.launchpad.net/~paelzer/ubuntu/+source/dnsmasq
Only Christian Ehrhardt  can upload to this branch. If you are Christian Ehrhardt  please log in for upload directions.

Branch merges

Branch information

Name:
fix-1726017-xenial
Repository:
lp:~paelzer/ubuntu/+source/dnsmasq

Recent commits

e11782e... by Christian Ehrhardt 

changelog: Fix replying prematurely on REFUSED (LP: #1726017)

Signed-off-by: Christian Ehrhardt <email address hidden>

f8ef14c... by Baptiste Jonglez <email address hidden>

Stop treating SERVFAIL as a successful response from upstream servers.

This effectively reverts most of 51967f9807 ("SERVFAIL is an expected
error return, don't try all servers.") and 4ace25c5d6 ("Treat REFUSED (not
SERVFAIL) as an unsuccessful upstream response").

With the current behaviour, as soon as dnsmasq receives a SERVFAIL from an
upstream server, it stops trying to resolve the query and simply returns
SERVFAIL to the client. With this commit, dnsmasq will instead try to
query other upstream servers upon receiving a SERVFAIL response.

According to RFC 1034 and 1035, the semantic of SERVFAIL is that of a
temporary error condition. Recursive resolvers are expected to encounter
network or resources issues from time to time, and will respond with
SERVFAIL in this case. Similarly, if a validating DNSSEC resolver [RFC
4033] encounters issues when checking signatures (unknown signing
algorithm, missing signatures, expired signatures because of a wrong
system clock, etc), it will respond with SERVFAIL.

Note that all those behaviours are entirely different from a negative
response, which would provide a definite indication that the requested
name does not exist. In our case, if an upstream server responds with
SERVFAIL, another upstream server may well provide a positive answer for
the same query.

Thus, this commit will increase robustness whenever some upstream servers
encounter temporary issues or are misconfigured.

Quoting RFC 1034, Section 4.3.1. "Queries and responses":

    If recursive service is requested and available, the recursive response
    to a query will be one of the following:

       - The answer to the query, possibly preface by one or more CNAME
         RRs that specify aliases encountered on the way to an answer.

       - A name error indicating that the name does not exist. This
         may include CNAME RRs that indicate that the original query
   name was an alias for a name which does not exist.

       - A temporary error indication.

Here is Section 5.2.3. of RFC 1034, "Temporary failures":

    In a less than perfect world, all resolvers will occasionally be unable
    to resolve a particular request. This condition can be caused by a
    resolver which becomes separated from the rest of the network due to a
    link failure or gateway problem, or less often by coincident failure or
    unavailability of all servers for a particular domain.

And finally, RFC 1035 specifies RRCODE 2 for this usage, which is now more
widely known as SERVFAIL (RFC 1035, Section 4.1.1. "Header section format"):

    RCODE Response code - this 4 bit field is set as part of
                    responses. The values have the following
                    interpretation:
                    (...)

                    2 Server failure - The name server was
                                    unable to process this query due to a
                                    problem with the name server.

For the DNSSEC-related usage of SERVFAIL, here is RFC 4033
Section 5. "Scope of the DNSSEC Document Set and Last Hop Issues":

    A validating resolver can determine the following 4 states:
    (...)

    Insecure: The validating resolver has a trust anchor, a chain of
       trust, and, at some delegation point, signed proof of the
       non-existence of a DS record. This indicates that subsequent
       branches in the tree are provably insecure. A validating resolver
       may have a local policy to mark parts of the domain space as
       insecure.

    Bogus: The validating resolver has a trust anchor and a secure
       delegation indicating that subsidiary data is signed, but the
       response fails to validate for some reason: missing signatures,
       expired signatures, signatures with unsupported algorithms, data
       missing that the relevant NSEC RR says should be present, and so
       forth.
    (...)

    This specification only defines how security-aware name servers can
    signal non-validating stub resolvers that data was found to be bogus
    (using RCODE=2, "Server Failure"; see [RFC4035]).

Notice the difference between a definite negative answer ("Insecure"
state), and an indefinite error condition ("Bogus" state). The second
type of error may be specific to a recursive resolver, for instance
because its system clock has been incorrectly set, or because it does not
implement newer cryptographic primitives. Another recursive resolver may
succeed for the same query.

There are other similar situations in which the specified behaviour is
similar to the one implemented by this commit.

For instance, RFC 2136 specifies the behaviour of a "requestor" that wants
to update a zone using the DNS UPDATE mechanism. The requestor tries to
contact all authoritative name servers for the zone, with the following
behaviour specified in RFC 2136, Section 4:

    4.6. If a response is received whose RCODE is SERVFAIL or NOTIMP, or
    if no response is received within an implementation dependent timeout
    period, or if an ICMP error is received indicating that the server's
    port is unreachable, then the requestor will delete the unusable
    server from its internal name server list and try the next one,
    repeating until the name server list is empty. If the requestor runs
    out of servers to try, an appropriate error will be returned to the
    requestor's caller.

abed1d9... by Chris Novakovic <email address hidden>

Treat REFUSED (not SERVFAIL) as an unsuccessful upstream response

Commit 51967f9807665dae403f1497b827165c5fa1084b began treating SERVFAIL
as a successful response from an upstream server (thus ignoring future
responses to the query from other upstream servers), but a typo in that
commit means that REFUSED responses are accidentally being treated as
successful instead of SERVFAIL responses.

This commit corrects this typo and provides the behaviour intended by
commit 51967f9: SERVFAIL responses are considered successful (and will
be sent back to the requester), while REFUSED responses are considered
unsuccessful (and dnsmasq will wait for responses from other upstream
servers that haven't responded yet).

8adfc5f... by Marc Deslauriers

Update ubuntu/xenial-devel from 2.75-1ubuntu0.16.04.2 to 2.75-1ubuntu0.16.04.3

Prior ubuntu/xenial-devel commit: 7d19fa5a579264e9fcb459d8f630b49dba4dab1d
New ubuntu/xenial-devel commit: 6061624497b6ae600a37d820d5e6213c9775a7b5

6061624... by Marc Deslauriers

Import patches-unapplied version 2.75-1ubuntu0.16.04.3 to ubuntu/xenial-security

Imported using git-ubuntu import.

Publish parent: 31e6443bfab23ad3b3e5a3cd465fb08c72b41f25
Changelog parent: 94be980bff52ad8f2c90f5768086efa7578eb556

New changelog entries:
  * SECURITY UPDATE: add fixes to correct multiple security issues
    - CVE-2017-14491 DNS heap buffer overflow.
    - CVE-2017-14492, DHCPv6 RA heap overflow.
    - CVE-2017-14493, DHCPv6 - Stack buffer overflow.
    - CVE-2017-14494, Infoleak handling DHCPv6 forwarded requests.
    - CVE-2017-14495, OOM in DNS response creation.
    - CVE-2017-14496, Integer underflow in DNS response creation.

7d19fa5... by Nish Aravamudan

Updating lpusip/ubuntu/xenial-devel from eaf3b10bdb1e3545c08b0d0c284f5e29eb4f00b3 to 94be980bff52ad8f2c90f5768086efa7578eb556

94be980... by Nish Aravamudan

Import patches-unapplied version 2.75-1ubuntu0.16.04.2 to ubuntu/xenial-proposed

Imported using usd-importer.

Publish parent: 3b7f24d34913c027c2aadd4d47428c8f3b14e50a
Changelog parent: 31e6443bfab23ad3b3e5a3cd465fb08c72b41f25

New changelog entries:
  * Add two upstream patches to fix binding to an interface being
    destroyed and recreated. LP: #1639776.
      + 2675f2061525bc954be14988d64384b74aa7bf8b
      + 16800ea072dd0cdf14d951c4bb8d2808b3dfe53d

31e6443... by Marc Deslauriers

Import patches-unapplied version 2.75-1ubuntu0.16.04.1 to ubuntu/xenial-security

Imported using usd-importer.

Publish parent: 3b7f24d34913c027c2aadd4d47428c8f3b14e50a

New changelog entries:
  * SECURITY UPDATE: denial of service via crafted CNAME (LP: #1581181)
    - src/cache.c: fix crash when empty address from DNS overlays A record
      from hosts.
    - 41a8d9e99be9f2cc8b02051dd322cb45e0faac87
    - CVE-2015-8899

eaf3b10... by Marc Deslauriers

Updating lpusip/ubuntu/xenial-devel from 3b7f24d34913c027c2aadd4d47428c8f3b14e50a to 31e6443bfab23ad3b3e5a3cd465fb08c72b41f25

3b7f24d... by Simon Kelley

Import patches-unapplied version 2.75-1 to ubuntu/xenial

Imported using usd-importer.

Publish parent: a116f32df27b56b203873d8d3080dc526a798b9b