Commit graph

24036 commits

Author SHA1 Message Date
Lennart Poettering 2a6658ef55 resolved: never proceed processing truncated packets
Make sure we don't end up processing packets that are truncated.
Instead, actually let the TCP connection do its thing.
2015-12-27 01:41:39 +01:00
Lennart Poettering cbe4216dd1 resolved: remember explicitly whether we already tried a stream connection
On LLMNR we never want to retry stream connections (since local TCP
connections should work, and we don't want to unnecessarily delay
operation), explicitly remember whether we already tried one, instead of
deriving this from a still stored stream object. This way, we can free
the stream early, without forgetting that we tried it.
2015-12-27 01:41:39 +01:00
Lennart Poettering 598f44bd2c resolved: make sure we GC stream transactions properly
Make sure to GC a transaction after dealing with a reply, even if the
transaction is not complete yet.
2015-12-27 01:41:39 +01:00
Lennart Poettering 5a7e41a370 resolved: ignore additional DNS responses we get while validating
No need to choke on them.
2015-12-27 01:41:39 +01:00
Lennart Poettering c61d2b441a resolved: introduce dns_transaction_reset_answer()
Let's unify how we reset the answer data we collected, after all pretty
much every time we do it incompletely so far, let's fix it.
2015-12-27 01:41:39 +01:00
Lennart Poettering 5651285934 shared: fix handling of suffix "." in dns_name_compare_func()
All our other domain name handling functions make no destinction between
domain names that end in a dot plus a NUL, or those just ending in a
NUL. Make sure dns_name_compare_func() and dns_label_unescape_suffix()
do the same.
2015-12-27 01:41:39 +01:00
Lennart Poettering 735323d9d3 shared: fix error propagation in dns_name_compare_func() 2015-12-26 19:09:11 +01:00
Lennart Poettering 08f904fddc resolved: don't unnecessarily allocate memory in dns_packet_append_name()
When compression support is off, there's no point in duplicating the
name string. Hence, don't do it.
2015-12-26 19:09:11 +01:00
Lennart Poettering 49cce12d4a resolved: name TCP and UDP socket calls uniformly
Previously the calls for emitting DNS UDP packets were just called
dns_{transacion|scope}_emit(), but the one to establish a DNS TCP
connection was called dns_transaction_open_tcp(). Clean this up, and
rename them dns_{transaction|scope}_emit_udp() and
dns_transaction_open_tcp().
2015-12-26 19:09:11 +01:00
Lennart Poettering b652d4a209 resolved: add an automatic downgrade to non-DNSSEC mode
This adds a mode that makes resolved automatically downgrade from DNSSEC
support to classic non-DNSSEC resolving if the configured DNS server is
not capable of DNSSEC. Enabling this mode increases compatibility with
crappy network equipment, but of course opens up the system to
downgrading attacks.

The new mode can be enabled by setting DNSSEC=downgrade-ok in
resolved.conf. DNSSEC=yes otoh remains a "strict" mode, where DNS
resolving rather fails then allow downgrading.

Downgrading is done:

- when the server does not support EDNS0+DO
- or when the server supports it but does not augment returned RRs with
  RRSIGs. The latter is detected when requesting DS or SOA RRs for the
  root domain (which is necessary to do proofs for unsigned data)
2015-12-26 19:09:11 +01:00
Lennart Poettering 0e4fb6b2de resolved: no need to store return value of dns_server_possible_features()
The call already updates possible_features, it's pointless doing this in
the caller a second time.
2015-12-26 19:09:10 +01:00
Lennart Poettering fbd5e3526c resolved: don't set TCP_NODELAY twice for TCP sockets
We previously set it once in the scope code and once in the stream code.
Remove it from the latter, as all other socket options are set in the
former.
2015-12-26 19:09:10 +01:00
Lennart Poettering ac720200b7 resolved: generate an explicit transaction error when we cannot reach server via TCP
Previously, if we couldn't reach a server via UDP we'd generate an
MAX_ATTEMPTS transaction result, but if we couldn't reach it via TCP
we'd generate a RESOURCES transaction result. While it is OK to generate
two different errors I think, "RESOURCES" is certainly a misnomer.
Introduce a new transaction result "CONNECTION_FAILURE" instead.
2015-12-26 19:09:10 +01:00
Lennart Poettering b63fca6245 resolved: deal with unsigned DS/NSEC/NSEC3 properly
Previously, we'd insist on an RRSIG for all DS/NSEC/NSEC3 RRs. With this
change we don't do that anymore, but also allow unsigned DS/NSEC/NSEC3
if we can prove that the zone they are located in is unsigned.
2015-12-26 19:09:10 +01:00
Lennart Poettering f61dfddbff resolved: log each dnssec failure, in a recognizable way 2015-12-26 19:09:10 +01:00
Lennart Poettering a150ff5e4e resolved: gather statistics about resolved names
This collects statistical data about transactions, dnssec verifications
and the cache, and exposes it over the bus. The systemd-resolve-host
tool learns new options to query these statistics and reset them.
2015-12-26 19:09:10 +01:00
Lennart Poettering ed29bfdce6 resolved: if we accepted unauthenticated NSEC/NSEC3 RRs, use them for proofs
But keep track that the proof is not authenticated.
2015-12-26 19:09:10 +01:00
Lennart Poettering 94aa707129 resolved: don't insist on finding DNSKEYs for RRsets of zones with DNSSEC off 2015-12-26 19:09:10 +01:00
Lennart Poettering d1c4ee3248 resolved: be stricter when searching for a DS RR for a DNSKEY RR 2015-12-26 19:09:10 +01:00
Lennart Poettering 6b2f709364 resolved: make use of dns_type_may_redirect() where possible 2015-12-26 19:09:10 +01:00
Lennart Poettering 3ecc3df8ff update DNSSEC TODO 2015-12-26 19:09:10 +01:00
Lennart Poettering db5b0e92b3 resolved: tighten search for NSEC3 RRs a bit
Be stricter when searching suitable NSEC3 RRs for proof: generalize the
check we use to find suitable NSEC3 RRs, in nsec3_is_good(), and add
additional checks, such as checking whether all NSEC3 RRs use the same
parameters, have the same suffix and so on.
2015-12-26 19:09:10 +01:00
Lennart Poettering 13b78323ba resolved: when doing NSEC3 proof, first find right NSEC3 suffix
When doing an NSEC3 proof, before detrmining whether a name is the
closest encloser we first need to figure out the longest common suffix
we have with any NSEC3 RR in the reply.
2015-12-26 19:09:10 +01:00
Lennart Poettering e7ff0e0b39 resolved: properly implement RRSIG validation of wildcarded RRsets
Note that this is still not complete, one additional step is still
missing: when we verified that a wildcard RRset is properly signed, we
still need to do an NSEC/NSEC3 proof that no more specific RRset exists.
2015-12-26 19:09:10 +01:00
Lennart Poettering d38d5ca65b resolved: never use data from failed transactions
Otherwise if we have an A lookup that failed DNSSEC validation, but an
AAAA lookup that succeeded, we might end up using the A data, but we
really should not.
2015-12-26 19:09:10 +01:00
Lennart Poettering 10b4504002 resolved: don't choke on NSEC/NSEC3 RRs with no bitmap
This might happen in some cases (empty non-terminals...) and we should
not choke on it.
2015-12-26 19:09:10 +01:00
Lennart Poettering 7d7fa31c62 bitmap: don't do bitwise XOR on booleans
It's weird doing bitwise operations on booleans. Let's use the boolean
XOR (i.e. "!=") instead of the bitweise XOR (i.e. "^") on them.
2015-12-26 19:09:10 +01:00
Lennart Poettering 0b8086379f util-lib: make sure more bitmap calls can deal with NULL objects fine 2015-12-26 19:09:10 +01:00
Lennart Poettering 7b50eb2efa resolved: internalize string buffer of dns_resource_record_to_string()
Let's simplify usage and memory management of DnsResourceRecord's
dns_resource_record_to_string() call: cache the formatted string as
part of the object, and return it on subsequent calls, freeing it when
the DnsResourceRecord itself is freed.
2015-12-26 19:09:10 +01:00
Lennart Poettering 0936416a1c resolved: when matching SOA RRs, don't eat up errors 2015-12-26 19:09:09 +01:00
Lennart Poettering 65b200e70d resolved: when matching SOA RRs, honour RR class 2015-12-26 19:09:09 +01:00
Lennart Poettering 81f7fc5e84 resolved: when looking for a SOA RR in a reply, pick the right one
If there are multiple SOA RRs, and we look for a suitable one covering
our request, then make sure to pick the one that is furthest away from
the root name, not just the first one we encounter.
2015-12-26 19:09:09 +01:00
Lennart Poettering a5444ca9fd resolved: when caching NXDOMAIN for an RR, make sure we flush out old ANY entries
We use ANY RR keys to store NXDOMAIN information, but we previously
didn't flush out old ANY RR items in the cache when adding new entries.
Fix that.
2015-12-26 19:09:09 +01:00
Lennart Poettering d3c7e9139c resolved: split out a new dns_type_may_redirect() call
Let's abstract which RRs shall honour CNAMEs, and which ones should not.
2015-12-26 19:09:09 +01:00
Lennart Poettering 40667ebe74 resolve-host: propagate error properly 2015-12-26 19:09:09 +01:00
Zbigniew Jędrzejewski-Szmek 720e593603 Merge pull request #2197 from mscherer/add_seal_config
Add Seal option in the configuration file for journald-remote
2015-12-25 11:16:18 -05:00
Zbigniew Jędrzejewski-Szmek d790d8c1b2 Merge pull request #2223 from ssahani/lldp
Closes #2223.
2015-12-25 00:40:07 -05:00
Susant Sahani 859c37b152 V3 LLDP: Add packet validation (system name and description)
LLDP type system name and system description should
be with in 255 characters and unique.

Let's add the validation to discard corrupt packets.
2015-12-25 10:48:23 +05:30
Susant Sahani e5c42b7ff1 lldp: improve logging 2015-12-25 10:42:43 +05:30
Zbigniew Jędrzejewski-Szmek cd81bc5802 Merge pull request #2153 from evverx/fix-verify-for-templates
analyze: verify verifies templates too
2015-12-24 23:59:48 -05:00
Lennart Poettering 7b8f930ce4 Merge pull request #2216 from zonque/nameownerchanged
core: re-sync bus name list after deserializing during daemon-reload
2015-12-24 00:46:19 +01:00
Daniel Mack 8936a5e34d core: re-sync bus name list after deserializing during daemon-reload
When the daemon reloads, it doesn not actually give up its DBus connection,
as wrongly stated in an earlier commit. However, even though the bus
connection stays open, the daemon flushes out all its internal state.

Hence, if there is a NameOwnerChanged signal after the flush and before the
deserialization, it cannot be matched against any pending unit.

To fix this, rename bus_list_names() to manager_sync_bus_names() and call
it explicitly at the end of the daemon reload operation.
2015-12-23 23:31:35 +01:00
Lennart Poettering 838c669055 Merge pull request #2158 from keszybz/journal-decompression
Journal decompression fixes
2015-12-23 21:31:07 +01:00
Lennart Poettering d6ef10fadf Merge pull request #2214 from zonque/leak
Core: plug a memory leak in socket.c, and some related cleanups
2015-12-23 21:07:07 +01:00
Daniel Mack 0a78712e81 socket: nullify pointers after free
A socket shouldn't be used after socket_done() returns, but follow the
general guideline here and avoid dangling pointers anyway.
2015-12-22 12:56:33 +01:00
Daniel Mack a97b23d65a socket: free fdname member
Plug a small memory leak.
2015-12-22 12:56:31 +01:00
Lennart Poettering a6cff5d3c0 Merge pull request #2202 from zonque/nameownerchanged
core: fix bus name synchronization after daemon-reload
2015-12-21 14:24:29 +01:00
Lennart Poettering 0ced2b1289 Merge pull request #2204 from zonque/sd-event-debug
sd-event: improve debugging of event source errors
2015-12-21 14:21:29 +01:00
Daniel Mack 55cbfaa54b sd-event: improve debugging of event source errors
Printing the pointer variable really doesn't help, so drop that.

Instead, add a string lookup table for the EventSourceType enum, and print
the type of event source in case of errors.
2015-12-21 13:03:24 +01:00
Daniel Mack 0eefe19393 Merge pull request #2203 from mbiebl/man-typo-fix
man: fix typo in systemctl(1)
2015-12-21 12:09:46 +01:00