Commit Graph

32493 Commits

Author SHA1 Message Date
Evan Hunt
80de62645c check return value from uv_tcp_getpeername() when connecting
if we can't determine the peer, the connect should fail.

(cherry picked from commit 8fcad58ea6)
2020-12-09 10:46:16 +01:00
Evan Hunt
12b1ae64ff set REUSEPORT and REUSEADDR on TCP sockets if needed
When binding a TCP socket, if bind() fails with EADDRINUSE,
try again with REUSEPORT/REUSEADDR (or the equivalent options).

(cherry picked from commit 26a3a22895)
2020-12-09 10:46:16 +01:00
Ondřej Surý
e35b8db249 Fix more races between connect and shutdown
There were more races that could happen while connecting to a
socket while closing or shutting down the same socket.  This
commit introduces a .closing flag to guard the socket from
being closed twice.

(cherry picked from commit ed3ab63f74)
2020-12-09 10:46:16 +01:00
Ondřej Surý
d8c3e48970 Fix a race between isc__nm_async_shutdown() and new sends/reads
There was a data race where a new event could be scheduled after
isc__nm_async_shutdown() had cleaned up all the dangling UDP/TCP
sockets from the loop.

(cherry picked from commit 6cfadf9db0)
2020-12-09 10:46:16 +01:00
Ondřej Surý
c4816ce34f Refactor udp_recv_cb()
- more logical code flow.
- propagate errors back to the caller.
- add a 'reading' flag and call the callback from failed_read_cb()
  only when it the socket was actively reading.

(cherry picked from commit 5fcd52209a)
2020-12-09 10:46:16 +01:00
Ondřej Surý
7945fb0c90 Fix netmgr read/connect timeout issues
- don't bother closing sockets that are already closing.
- UDP read timeout timer was not stopped after reading.
- improve handling of TCP connection failures.

(cherry picked from commit cdccac4993)
2020-12-09 10:46:16 +01:00
Ondřej Surý
e9354e7bfe Add isc__nm_udp_shutdown() function
This function will be called during isc_nm_closedown() to ensure
that all UDP sockets are closed and detached.

(cherry picked from commit 7a6056bc8f)
2020-12-09 10:46:16 +01:00
Evan Hunt
c919a3338f add netmgr functions to support outgoing DNS queries
- isc_nm_tcpdnsconnect() sets up up an outgoing TCP DNS connection.
- isc_nm_tcpconnect(), _udpconnect() and _tcpdnsconnect() now take a
  timeout argument to ensure connections time out and are correctly
  cleaned up on failure.
- isc_nm_read() now supports UDP; it reads a single datagram and then
  stops until the next time it's called.
- isc_nm_cancelread() now runs asynchronously to prevent assertion
  failure if reading is interrupted by a non-network thread (e.g.
  a timeout).
- isc_nm_cancelread() can now apply to UDP sockets.
- added shim code to support UDP connection in versions of libuv
  prior to 1.27, when uv_udp_connect() was added

all these functions will be used to support outgoing queries in dig,
xfrin, dispatch, etc.

(cherry picked from commit 5dcdc00b93)
2020-12-09 10:46:16 +01:00
Tinderbox User
7406ea925a prep 9.16.10 2020-12-09 10:46:16 +01:00
Michał Kępień
a01961260d Prepare release notes for BIND 9.16.10 2020-12-09 10:46:16 +01:00
Michał Kępień
2ef1784b85 Reorder release notes 2020-12-09 10:45:49 +01:00
Michał Kępień
3f6f0b9f66 Tweak and reword release notes 2020-12-09 10:45:49 +01:00
Michał Kępień
9f270783ac Tweak and reword recent CHANGES entries 2020-12-09 10:45:49 +01:00
Michał Kępień
d902dc611f Fix formatting of "dnssec-policy" documentation 2020-12-09 10:45:49 +01:00
Michal Nowak
19197034fb Miscellaneous minor documentation updates 2020-12-09 10:45:49 +01:00
Ondřej Surý
645701afb0 Merge branch 'ondrej/release-notes-doesnt-need-copyright-v9_16' into 'v9_16'
Remove the requirement for the release notes to have copyright

See merge request isc-projects/bind9!4484
2020-12-09 09:51:20 +00:00
Ondřej Surý
fcfb3e77bb Remove the requirement for the release notes to have copyright
The release notes doesn't have to have copyright header, it doesn't add
any value there as the release notes are useless outside the project.

(cherry picked from commit cb30d9892d)
2020-12-09 10:50:15 +01:00
Ondřej Surý
2e879edb8c Merge branch 'ondrej/clang-format-11-v9_16' into 'v9_16'
Bump the clang version to 11 (v9.16)

See merge request isc-projects/bind9!4480
2020-12-08 19:14:15 +00:00
Ondřej Surý
908f167a5d Bump the clang version to 11 (stable)
(cherry picked from commit c1eb385fdf)
2020-12-08 19:34:12 +01:00
Ondřej Surý
a35a666a7c Reformat sources using clang-format-11
(cherry picked from commit 7ba18870dc)
2020-12-08 19:34:05 +01:00
Ondřej Surý
504969cb63 Explicitly configure new clang-format-11 options
(cherry picked from commit 6c28834354)
2020-12-08 19:30:55 +01:00
Ondřej Surý
dc548b2e83 Merge branch '2250-dns-flag-day-2020-revert-nocookie-udp-size-v9_16' into 'v9_16'
Resolve "DNS Flag Day 2020 - EDNS buffer size configuring does not work anymore"

See merge request isc-projects/bind9!4456
2020-12-02 15:33:06 +00:00
Ondřej Surý
9d35c9b96d Add CHANGES and release not for GL #2250
(cherry picked from commit c7d81f12f8)
2020-12-02 12:02:10 +01:00
Ondřej Surý
5d34daaf78 Change the default value for nocookie-udp-size back to 4096
The DNS Flag Day 2020 reduced all the EDNS buffer sizes to 1232.  In
this commit, we revert the default value for nocookie-udp-size back to
4096 because the option is too obscure and most people don't realize
that they also need to change this configuration option in addition to
max-udp-size.

(cherry picked from commit 79c196fc77)
2020-12-02 12:01:50 +01:00
Mark Andrews
0d3ba105bb Merge branch '2305-adjust-recursion-limits-v9_16' into 'v9_16'
Adjust default value of "max-recursion-queries"

See merge request isc-projects/bind9!4447
2020-12-01 14:13:40 +00:00
Mark Andrews
5c10b5a4e8 Adjust default value of "max-recursion-queries"
Since the queries sent towards root and TLD servers are now included in
the count (as a result of the fix for CVE-2020-8616),
"max-recursion-queries" has a higher chance of being exceeded by
non-attack queries.  Increase its default value from 75 to 100.

(cherry picked from commit ab0bf49203)
2020-12-02 00:53:49 +11:00
Mark Andrews
c4178b7d8d Merge branch '2315-bind-9-11-22-9-11-25-fails-to-build-for-aep-hsm-native-pkcs11-v9_16' into 'v9_16'
Resolve "BIND 9.11.22 - 9.11.25 fails to build for AEP HSM native pkcs11"

See merge request isc-projects/bind9!4445
2020-12-01 13:50:49 +00:00
Mark Andrews
45719ff249 Add release note for [GL #2315]
(cherry picked from commit 356243aaec)
2020-12-01 23:29:43 +11:00
Mark Andrews
a07754cf69 Add CHANGES
(cherry picked from commit 11a3545e32)
2020-12-01 23:19:20 +11:00
Mark Andrews
4926888306 Fix misplaced declaration
(cherry picked from commit 49b9219bb3)
2020-12-01 23:19:20 +11:00
Michal Nowak
d765d024ea Merge branch '2274-drop-centos-6-support-after-november-30-2020' into 'v9_16'
Remove CentOS 6 from GitLab CI

See merge request isc-projects/bind9!4392
2020-11-30 13:29:02 +00:00
Michal Nowak
b908cc9c79 Remove CentOS 6 from GitLab CI
CentOS 6 reaches EOL on November 30, 2020 and will not be officially
supported by the CentOS project.
2020-11-27 13:29:38 +01:00
Mark Andrews
fe07671c9b Merge branch '2275-tighten-dns-cookie-response-handling-v9_16' into 'v9_16'
Resolve "Tighten DNS COOKIE response handling"

See merge request isc-projects/bind9!4438
2020-11-26 22:25:42 +00:00
Mark Andrews
e98edb871d Add release note for [GL #2275]
(cherry picked from commit d0dd71380b)
2020-11-27 08:44:00 +11:00
Mark Andrews
a9c791dfef Add CHANGES note for [GL #2275]
(cherry picked from commit 15e7a4b047)
2020-11-27 08:44:00 +11:00
Mark Andrews
7e85b2cd22 Add comment about cookie sizes
(cherry picked from commit 304df53991)
2020-11-27 08:44:00 +11:00
Mark Andrews
2898f530cd Check that missing cookies are handled
(cherry picked from commit bd9155590e)
2020-11-27 08:44:00 +11:00
Mark Andrews
df5f076a02 Tighten DNS COOKIE response handling
Fallback to TCP when we have already seen a DNS COOKIE response
from the given address and don't have one in this UDP response. This
could be a server that has turned off DNS COOKIE support, a
misconfigured anycast server with partial DNS COOKIE support, or a
spoofed response. Falling back to TCP is the correct behaviour in
all 3 cases.

(cherry picked from commit 0e3b1f5a25)
2020-11-27 08:15:11 +11:00
Michal Nowak
0e5276f9d2 Merge branch '2224-fixup-core-back-traces-v9_16' into 'v9_16'
[v9_16] Resolve "Fixup core back traces."

See merge request isc-projects/bind9!4435
2020-11-26 17:40:11 +00:00
Michal Nowak
f48b221ffa Write traceback file to the same directory as core file
The traceback files could overwrite each other on systems which do not
use different core dump file names for different processes.  Prevent
that by writing the traceback file to the same directory as the core
dump file.

These changes still do not prevent the operating system from overwriting
a core dump file if the same binary crashes multiple times in the same
directory and core dump files are named identically for different
processes.

(cherry picked from commit 6428fc26af)
2020-11-26 18:29:41 +01:00
Mark Andrews
a50ce1bd43 Unify whitespace in bin/tests/system/run.sh
Replace tabs with spaces to make whitespace consistent across the entire
bin/tests/system/run.sh script.

(cherry picked from commit 0f0a006c7e)
2020-11-26 18:29:33 +01:00
Diego dos Santos Fronza
4c8330cb91 Merge branch '2281-cid-313104-error-handling-issues-in-lib-ns-query-c-v9_16' into 'v9_16'
Resolve "CID 313104: Error handling issues in lib/ns/query.c"

See merge request isc-projects/bind9!4418
2020-11-26 14:57:49 +00:00
Diego Fronza
5c28451949 Silence coverity warnings in query.c
Return value of dns_db_getservestalerefresh() and
dns_db_getservestalettl() functions were previously unhandled.

This commit purposefully ignore those return values since there is
no side effect if those results are != ISC_R_SUCCESS, it also supress
Coverity warnings.
2020-11-26 14:56:22 +00:00
Matthijs Mekking
6e945ae520 Merge branch '1620-dnssec-policy-nsec3-saltlen-v9_16' into 'v9_16'
Resolve "dnssec-policy NSEC3 support" (9.16)

See merge request isc-projects/bind9!4423
2020-11-26 14:15:41 +00:00
Matthijs Mekking
2f0b924ce6 Add NSEC3PARAM unit test, refactor zone.c
Add unit test to ensure the right NSEC3PARAM event is scheduled in
'dns_zone_setnsec3param()'.  To avoid scheduling and managing actual
tasks, split up the 'dns_zone_setnsec3param()' function in two parts:

1. 'dns__zone_lookup_nsec3param()' that will check if the requested
   NSEC3 parameters already exist, and if a new salt needs to be
   generated.

2. The actual scheduling of the new NSEC3PARAM event (if needed).

(cherry picked from commit 64db30942d)
2020-11-26 14:15:05 +00:00
Matthijs Mekking
6db879160f Detect NSEC3 salt collisions
When generating a new salt, compare it with the previous NSEC3
paremeters to ensure the new parameters are different from the
previous ones.

This moves the salt generation call from 'bin/named/*.s' to
'lib/dns/zone.c'. When setting new NSEC3 parameters, you can set a new
function parameter 'resalt' to enforce a new salt to be generated. A
new salt will also be generated if 'salt' is set to NULL.

Logging salt with zone context can now be done with 'dnssec_log',
removing the need for 'dns_nsec3_log_salt'.

(cherry picked from commit 6b5d7357df)
2020-11-26 14:15:05 +00:00
Matthijs Mekking
734865e110 Add zone context to "generated salt" logs
(cherry picked from commit 3b4c764b43)
2020-11-26 14:15:05 +00:00
Matthijs Mekking
93f9d3b812 Move logging of salt in separate function
There may be a desire to log the salt without losing the context
of log module, level, and category.

(cherry picked from commit 7878f300ff)
2020-11-26 14:15:04 +00:00
Matthijs Mekking
52d3bf5f31 Change nsec3param salt config to saltlen
Upon request from Mark, change the configuration of salt to salt
length.

Introduce a new function 'dns_zone_checknsec3aram' that can be used
upon reconfiguration to check if the existing NSEC3 parameters are
in sync with the configuration. If a salt is used that matches the
configured salt length, don't change the NSEC3 parameters.

(cherry picked from commit 6f97bb6b1f)
2020-11-26 14:15:04 +00:00
Matthijs Mekking
d35dab3db8 Add check for NSEC3 and key algorithms
NSEC3 is not backwards compatible with key algorithms that existed
before the RFC 5155 specification was published.

(cherry picked from commit 00c5dabea3)
2020-11-26 14:15:03 +00:00