Skip to content
Snippets Groups Projects
  1. Jan 27, 2021
  2. Jan 14, 2021
  3. Jan 12, 2021
    • Pavel Doležal's avatar
      dnstap: multiple changes · 2126723a
      Pavel Doležal authored and Vladimír Čunát's avatar Vladimír Čunát committed
      - log queries and responses as separate dnstap messages
      - use "query" instead of "request" to mirror dnstap specification
      - don't export "query_zone" field in "CLIENT_*" messages
      2126723a
  4. Jan 07, 2021
    • Tomas Krizek's avatar
      daemon/http: fix memleak · 1d68f5ed
      Tomas Krizek authored
      The http_data structure is allocated in http_write_pkt() and the last
      callback that uses it is on_pkt_write(), so it should be responsible for
      freeing the memory.
      
      This used to leak a small amount of memory on every DoH response.
      1d68f5ed
  5. Jan 04, 2021
  6. Dec 31, 2020
  7. Dec 18, 2020
    • Vladimír Čunát's avatar
      iterate: accept parent-side records for nameservers · bb719def
      Vladimír Čunát authored
      When resolving just NS names and addresses which won't go to answers,
      our cache can satisfy them with just parent-side records.
      Now we also make iterator consistent with that, and it will cut short
      if a delegation satisfies what the kr_query wants.
      
      There's a general risk that we will never get the child-side records,
      and in practice the parent-side ones are sometimes "less accurate".
      This change may increase this risk (to NS addresses in particular),
      but we'd better consider addressing the risk later and systematically.
      A suggestion is to refresh the records asynchronously:
      https://tools.ietf.org/html/draft-ietf-dnsop-ns-revalidation
      
      ---
      State before this commit lead to a weird behaviour where some IPv4-only
      tests in Deckard (namely `iter_pcdiff.rpl`) were failing with IPv6
      turned off.
      
      This was due to the resolvers' internal preference towards AAAA records
      for NS names.  With IPv6 networking on, NS name resolution was first
      done for AAAA record and the glue (containing A record for the NS name
      in question) from parent zone was put into cache.  As the AAAA
      resolution failed (there is no AAAA for this NS name), A was queried
      next and was satisfied from cache.
      
      With IPv6 off, there is no query for the AAAA record, so no A record
      from glue gets put in to the cache.  A record is resolved first, and
      resolution ignores the glue in parent zone and continue to the child
      zone which might be broken (intentionally in the case of that
      `iter_pcdiff.rpl` test).
      bb719def
  8. Dec 14, 2020
    • Vladimír Čunát's avatar
      view.addr(): throw error on bad subnet · 8289094d
      Vladimír Čunát authored
      It's more consistent with what we do.  Now it will look like:
      [system] error while loading config: .../lib/knot-resolver/kres_modules/view.lua:28: failed to parse subnet [::1]/128 (workdir '/foo/bar')
      8289094d
  9. Dec 08, 2020
  10. Dec 07, 2020
  11. Nov 16, 2020
    • Vladimír Čunát's avatar
      fix map() command on 32-bit platforms; regressed in 5.2.0 · e0197962
      Vladimír Čunát authored
      LuaJIT FFI was using opendir() (etc.) variants with 32-bit inodes
      but the C parts was using them as 64-bit inode variants.
      Consequently the `struct dirent` layout didn't match and we were getting
      filenames shifted by eight bytes.
      
      Now the whole dir-listing lua function is written in C.
      e0197962
  12. Nov 11, 2020
  13. Nov 02, 2020
  14. Oct 29, 2020
  15. Oct 27, 2020
  16. Oct 26, 2020
    • Petr Špaček's avatar
      map: prevent crash on unrepresentable responses · 9eb440ec
      Petr Špaček authored and Tomas Krizek's avatar Tomas Krizek committed
      Typical example of unrepresentable message is a Lua error.
      E.g. error() called from kresc would lead to NULL message.
      9eb440ec
    • Lukas Jezek's avatar
      map: use control sockets instead of pipe from parent process · 4d6bf767
      Lukas Jezek authored and Tomas Krizek's avatar Tomas Krizek committed
      This change allows map() to work with systemd integration.
      
      As a bonus the new client implementation is based on Lua cqueues
      allows caller to wrap map() in worker.corroutine() and get
      asynchronous execution/avoid blocking main loop.
      
      Currently socket communication does not employ timeouts so a hang
      instance will lead to hang map() call. This does not affect query
      processing _if_ map() is being run in worker.corroutine.
      
      Fixes: #554
      Fixes: #620
      4d6bf767
  17. Oct 23, 2020
  18. Oct 21, 2020
  19. Oct 20, 2020
  20. Oct 15, 2020
  21. Oct 09, 2020
    • Petr Špaček's avatar
      lib/cache: fix cache lock based on fcntl() · 1158e3c1
      Petr Špaček authored
      Fixes bug introduced in b65e8977.
      open() was creating a file which could not be open again because of
      insufficient permissions. This somehow worked because lockfile_release()
      unlinks the file, but it broke terribly if lockfile_release() was not
      called because of crash or something like that.
      
      Fixes: merge request !1042
      1158e3c1
  22. Oct 08, 2020
  23. Oct 07, 2020
    • Vladimír Čunát's avatar
      validator: avoid using RRSIG from a different packet · 9432a427
      Vladimír Čunát authored and Petr Špaček's avatar Petr Špaček committed
      Restrict tried RRSIGs by qry_uid equality.
      I see no use case against and it could be confusing.
      (Also rewrite the conditions around to positive form.)
      
      An assertion in cache noticed an NSEC with _SECURE rank but no RRSIG
      (in practice).  It was a side-effect of still not keeping RRSIGs with
      their RRs in some places.  It wasn't a security problem, as it doesn't
      really matter where the signatures came from.  Theoretically it
      might've lead to incorrect caching (missing usable RRSIGs), as cache
      was restricting qry_uid to match, but that hasn't been noticed
      in practice.
      9432a427
  24. Oct 02, 2020
    • Tomas Krizek's avatar
      modules/http: answer to /dns-query endpoint as well · b1677948
      Tomas Krizek authored
      When using DoH, it seems /dns-query is a more common convetion for
      an endpoint name. Let's use it in addition to /doh, since it doesn't
      hurt anything and makes kresd more alike the other DoH implementations
      out there. It'll also play more nicely with kdig, which uses /dns-query
      as default as well.
      b1677948
  25. Sep 09, 2020
  26. Sep 08, 2020
  27. Sep 01, 2020
  28. Aug 13, 2020
  29. Aug 10, 2020
  30. Aug 07, 2020
    • Vladimír Čunát's avatar
      validator: bottom->up chase DS if RRSIG(s) are missing · 703d918a
      Vladimír Čunát authored and Petr Špaček's avatar Petr Špaček committed
      This is about situations when validator *thinks* it's in a signed zone
      but an unsigned answer comes in. The assumption was that RRSIGs didn't
      make it through some middle-boxes and it retried with explicit QTYPE=RRSIG.
      
      There were two issues with that.
      1. It seems that in most cases the cause of the situation is that
         we skipped over a zone cut that transitioned to insecure state,
         so the signatures correctly don't exist.
      2. An explicit RRSIG query appears to be more trouble than worth;
         it seems reasonable for servers not to answer it (fully);
         see RFC 8482 sect. 7.
      
      The new approach simply tries to find a proof that the name is insecure,
      by spawning a QTYPE=DS sub-query on that name.  That fixes some
      real-life cases; usually this happens in iteration mode where one IP
      address serves zones on both sides of a cut that transitions to insecure.
      For details see new comments in that rrsig_not_found() function.
      
      The change resulted in the iterator fallback not making sense anymore
      so it was removed.
      703d918a
  31. Aug 06, 2020
  32. Aug 05, 2020
    • Vladimír Čunát's avatar
      daemon/lua: get rid of __engine symbol in lua · b7629c55
      Vladimír Čunát authored
      In particular this gets rid of last light user data inside kresd.
      
      It was still causing problems on some systems, for example Debian Sid.
      The error was the same: "bad light userdata pointer" from luajit,
      but note that the problem can still be triggered by lua libraries,
      e.g. cqueues.
      b7629c55
  33. Jul 27, 2020
  34. Jul 23, 2020
    • Vladimír Čunát's avatar
      validate: don't chase non-sensical signers · 468e762b
      Vladimír Čunát authored and Petr Špaček's avatar Petr Špaček committed
      When signer name isn't a prefix of owner, the signature does not make
      sense and it's no use trying to use that signer name in any way.
      
      We generally don't force queries on every level of the path,
      so this signer confusion could "introduce SERVFAILs" if we
      skip over a transition to insecure.
      468e762b
  35. Jul 16, 2020
Loading