2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00
Commit Graph

32421 Commits

Author SHA1 Message Date
Michal Nowak
10dd78126a Add CHANGES and release note for GL !4045 2020-09-02 11:08:40 +02:00
Michal Nowak
de49699b66 Drop gperftools-profiler configure switch
This switch is believed to be unnecessary. The possibility to use
gperftools CPU profiler was kept, one needs to set 'CFLAGS' and
'LDFLAGS' accordingly.
2020-09-02 11:07:46 +02:00
Mark Andrews
57673de99e Merge branch 'marka-placeholder' into 'main'
placeholder

See merge request isc-projects/bind9!4061
2020-09-02 09:05:12 +00:00
Mark Andrews
10b2620ec5 placeholder 2020-09-02 18:46:56 +10:00
Mark Andrews
c4b8b831c0 Merge branch '2081-data-race-in-zonemgr_test' into 'main'
Resolve "data race in zonemgr_test"

Closes #2081

See merge request isc-projects/bind9!3989
2020-09-02 01:36:51 +00:00
Mark Andrews
ca1b0f1539 Add CHANGES note 2020-09-02 10:33:12 +10:00
Mark Andrews
b8e4b6d303 isc_ratelimiter needs to hold a reference to its task
to prevent the task subsystem shutting down before the
ratelimiter is freed.
2020-09-02 10:32:33 +10:00
Mark Andrews
d1d58a2e78 Merge branch '2111-restore-d-option-to-packet-pl' into 'main'
Resolve "Restore '-d' option to packet.pl"

Closes #2111

See merge request isc-projects/bind9!4054
2020-09-02 00:24:03 +00:00
Mark Andrews
c070bab169 Dump the returned packet 2020-09-02 09:40:45 +10:00
Mark Andrews
6da018dcce Merge branch '2049-cleanup-sock' into 'main'
Resolve "Compiler warnings identified by Intel C++ Compiler"

See merge request isc-projects/bind9!3924
2020-09-01 22:38:43 +00:00
Mark Andrews
b1c424ddf3 remove unused variable sock 2020-09-01 22:24:32 +00:00
Diego dos Santos Fronza
61e8e13c91 Merge branch '1847-recursor-has-issues-recursing-ip6-arpa' into 'main'
Resolve "9.16.* recursor has issues recursing"

Closes #1847

See merge request isc-projects/bind9!4027
2020-09-01 18:49:23 +00:00
Diego Fronza
044a72cca9 Add CHANGES and release note for GL #1847 2020-09-01 15:47:00 -03:00
Diego Fronza
11add69198 Added test for the proposed fix
The test works as follows:

1. Client wants to resolve unusual ip6.arpa. name:

   test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN TXT

2. Query is sent to ns7, a qmin enabled resolver.

3. ns7 do the first stage in query minimization for the name and send a new
   query to root (ns1):

  _.1.0.0.2.ip6.arpa.        IN  A

4. ns1 delegates ip6.arpa. to ns2.good.:

    ;; AUTHORITY SECTION:
    ;ip6.arpa.      20  IN  NS  ns2.good.

    ;; ADDITIONAL SECTION:
    ;ns2.good.      20  IN  A   10.53.0.2

5. ns7 do a second round in minimizing the name and send a new query
   to ns2.good. (10.53.0.2):

   _.8.2.6.0.1.0.0.2.ip6.arpa.    IN  A

6. ans2 delegates 8.2.6.0.1.0.0.2.ip6.arpa. to ns3.good.:

    ;; AUTHORITY SECTION:
    ;8.2.6.0.1.0.0.2.ip6.arpa. 60   IN  NS  ns3.good.

    ;; ADDITIONAL SECTION:
    ;ns3.good.      60  IN  A   10.53.0.3

7. ns7 do a third round in minimizing the name and send a new query to
   ns3.good.:

    _.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN A

8. ans3 delegates 1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. to ns4.good.:

    ;; AUTHORITY SECTION:
    ;1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 60 IN    NS  ns4.good.

    ;; ADDITIONAL SECTION:
    ;ns4.good.      60  IN  A   10.53.0.4

9. ns7 do fourth round in minimizing the name and send a new query to
   ns4.good.:

	_.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa.    IN A

10. ns4.good. doesn't know such name, but answers stating it is authoritative for
    the domai:

	;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id:  53815
	...
	;; AUTHORITY SECTION:
	1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 60 IN    SOA ns4.good.  ...

11. ns7 do another minimization on name:
   _.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa
   sends to ns4.good. and gets the same SOA response stated in item #10

12. ns7 do another minimization on name:
	_.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa
	sends to ns4.good. and gets the same SOA response stated in item #10.

13. ns7 do the last query minimization name for the ip6.arpa. QNAME.
	After all IPv6 labels are exausted the algorithm falls back to the
	original QNAME:
	test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa

    ns7 sends a new query with the original QNAME to ans4.

14. Finally ans4 answers with the expected response:
	;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:  40969
	;; flags: qr aa; QUESTION: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
	;; OPT PSEUDOSECTION:
	; EDNS: version: 0, flags:; udp: 8192
	;; QUESTION SECTION:
	;test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN TXT

	;; ANSWER SECTION:
	;test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 1    IN TXT "long_ip6_name"
2020-09-01 15:47:00 -03:00
Diego Fronza
230d79c191 Fix resolution of unusual ip6.arpa names
Before this commit, BIND was unable to resolve ip6.arpa names like
the one reported in issue #1847 when using query minimization.

As reported in the issue, an attempt to resolve a name like
'rec-test-dom-158937817846788.test123.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.3.4.3.5.4.0.8.2.6.0.1.0.0.2.ip6.arpa'
using default settings would fail.

The reason was that query minimization algorithm in 'fctx_minimize_qname'
would divide any ip6.arpa names in increasing number of labels,
7,11, ... up to 35, thus limiting the destination name (minimized) to a number
of 35 labels.

In case the last query minimization attempt (with 35 labels) would fail with
NXDOMAIN, BIND would attempt the query mininimization again with the exact
same QNAME, limited on the 35 labels, and that in turn would fail again.

This fix avoids this fail loop by considering the extra labels that may appear
in the leftmost part of an ip6.arpa name, those after the IPv6 part.
2020-09-01 15:47:00 -03:00
Ondřej Surý
045478ad6a Merge branch '2037-deferred-system-test-fix' into 'main'
Unhexlify 2037-pk11_numbits-crash-test.pkt file

Closes #2037

See merge request isc-projects/bind9!4047
2020-09-01 14:17:21 +00:00
Ondřej Surý
5f6eb014aa Multiply 1996-alloc_dnsbuf-crash-test.pkt by 300000 via TCP
The test for assertion failure via large TCP packet needs to be repeated
multiple times (we use 300000).  This commit fixes the input file to be
properly hexlified and uses the new packet.pl -r feature to send it
300000 times via TCP.
2020-09-01 16:16:02 +02:00
Ondřej Surý
dd46559a19 Add -r <repeats> option to packet.pl
For some tests, we need to send big data streams (for TCP) or repeated
packets (for UDP), this commits adds `-r` option to packet.pl that sends
the same input <repeats> times using the specified protocol.
2020-09-01 16:16:02 +02:00
Ondřej Surý
22e0272063 Properly format 2037-pk11_numbits-crash-test.pkt file 2020-09-01 16:16:02 +02:00
Mark Andrews
84aa74a111 Merge branch '2096-isc_refcount_decrement-needs-acquire-release-memory-ordering' into 'main'
Resolve "isc_refcount_decrement  needs acquire release memory ordering."

Closes #2096

See merge request isc-projects/bind9!4010
2020-09-01 12:21:25 +00:00
Mark Andrews
6278899a38 Use memory_order_acq_rel in isc_refcount_decrement.
While

if (isc_refcount_decrement() == 1) {	// memory_order_release
	isc_refcount_destroy();		// memory_order_acquire
	...
}

is theoretically the most efficent in practice, using
memory_order_acq_rel produces the same code on x86_64 and doesn't
trigger tsan data races (which use a idealistic model) if
isc_refcount_destroy() is not called immediately.  In fact
isc_refcount_destroy() could be removed if we didn't want
to check for the count being 0 when isc_refcount_destroy() is
called.

https://stackoverflow.com/questions/49112732/memory-order-in-shared-pointer-destructor
2020-09-01 12:05:18 +00:00
Michał Kępień
fcd6962e8b Merge branch '2075-add-T-maxcachesize-command-line-option' into 'main'
Add "-T maxcachesize=..." command line option

Closes #2075

See merge request isc-projects/bind9!4043
2020-08-31 21:40:28 +00:00
Michał Kępień
dad6572093 Use "-T maxcachesize=2097152" in all system tests
In order to lower the amount of memory allocated at startup by named
instances used in the BIND system test suite, set the default value of
"max-cache-size" for these to 2 megabytes.  The purpose of this change
is to prevent named instances (or even entire virtual machines) from
getting killed by the operating system on the test host due to excessive
memory use.

Remove all "max-cache-size" statements from named configuration files
used in system tests ("checkconf" notwithstanding) to prevent confusion
as the "-T maxcachesize=..." command line option takes precedence over
configuration files.
2020-08-31 13:15:33 +02:00
Michał Kępień
9ac1f6a9bc Add "-T maxcachesize=..." command line option
An implicit default of "max-cache-size 90%;" may cause memory use issues
on hosts which run numerous named instances in parallel (e.g. GitLab CI
runners) due to the cache RBT hash table now being pre-allocated [1] at
startup.  Add a new command line option, "-T maxcachesize=...", to allow
the default value of "max-cache-size" to be overridden at runtime.  When
this new option is in effect, it overrides any other "max-cache-size"
setting in the configuration, either implicit or explicit.  This
approach was chosen because it is arguably the simplest one to
implement.

The following alternative approaches to solving this problem were
considered and ultimately rejected (after it was decided they were not
worth the extra code complexity):

  - adding the same command line option, but making explicit
    configuration statements have priority over it,

  - adding a build-time option that allows the implicit default of
    "max-cache-size 90%;" to be overridden.

[1] see commit e24bc324b4
2020-08-31 13:15:33 +02:00
Ondřej Surý
96c4010fe5 Merge branch '1996-deferred-system-test' into 'main'
[CVE-2020-8620] Fix TCP DNS buffer sizes [TEST]

See merge request isc-projects/bind9!4038
2020-08-31 10:04:42 +00:00
Ondřej Surý
2c796bb9c8 Add PoC for assertion failure on large TCP DNS messages 2020-08-31 12:04:01 +02:00
Ondřej Surý
bd3d9f33dc Merge branch '1997-deferred-system-test' into 'main'
[CVE-2020-8621] Ensure QNAME minimization is permanently disabled when forwarding [TEST]

See merge request isc-projects/bind9!4039
2020-08-31 09:59:01 +00:00
Evan Hunt
dd8db89525 test whether DS chasing works correctly when forwarding 2020-08-31 11:21:22 +02:00
Ondřej Surý
ed98f65479 Merge branch '2037-deferred-system-test' into 'main'
Resolve "[CVE-2020-8623] A flaw in native PKCS#11 code can lead to a remotely triggerable assertion failure in pk11.c"

See merge request isc-projects/bind9!4037
2020-08-31 08:58:03 +00:00
Ondřej Surý
a69433ba40 Add PoC system test for pk11_numbits() assertion 2020-08-31 09:18:13 +02:00
Michał Kępień
a7b78f3a40 Fix relative path to conf.sh in cleanpkcs11.sh 2020-08-31 09:18:13 +02:00
Ondřej Surý
c3a351275b Merge branch '2028-deferred-system-test' into 'main'
[CVE-2020-8622] Properly handle malformed truncated responses to TSIG queries [TEST]

See merge request isc-projects/bind9!4034
2020-08-31 06:24:41 +00:00
Mark Andrews
8bbf3eb5f3 check that a malformed truncated response to a TSIG query is handled 2020-08-31 08:19:13 +02:00
Ondřej Surý
9af47af0f7 Merge branch '1928-handle-EPROTO' into 'main'
Resolve "error: socket.c:1540: unexpected error:"

Closes #1928

See merge request isc-projects/bind9!4023
2020-08-28 18:47:43 +00:00
Ondřej Surý
4722196b13 Add CHANGES and release note for GL #1928 2020-08-28 20:46:34 +02:00
Ondřej Surý
e0380d437d Handle EPROTO errno from recvmsg
It was discovered, that some systems might set EPROTO instead of EACCESS
on recvmsg() call causing spurious syslog messages from the socket
code.  This commit returns soft handling of EPROTO errno code to the
socket code. [GL #1928]
2020-08-28 20:45:52 +02:00
Ondřej Surý
f59067807e Merge branch '2104-fix-off-by-one-error-in-rehash_bits' into 'main'
Resolve "Bind 9.16.6 due to assertion failure"

Closes #2104

See merge request isc-projects/bind9!4030
2020-08-28 15:42:13 +00:00
Ondřej Surý
d47d2b3fe0 Add CHANGES and release notes for GL #2104 2020-08-28 16:21:56 +02:00
Ondřej Surý
78543ad5a7 Fix off-by-one error when calculating new hashtable size
When calculating the new hashtable bitsize, there was an off-by-one
error that would allow the new bitsize to be larger than maximum allowed
causing assertion failure in the rehash() function.
2020-08-28 16:21:21 +02:00
Michal Nowak
25d35029eb Merge branch 'mnowak/fix-tarball-test-suite.log-print' into 'main'
Print test-suite.log correctly in tarball system test job

See merge request isc-projects/bind9!3990
2020-08-28 12:38:32 +00:00
Michal Nowak
0c9c755952 Print test-suite.log correctly in tarball system test job
Printing test-suite.log on system test failure does not work for system
test run from tarball because the "after_script" step does not honour
directory change from the "before_script" step and fails with:

    Running after script...
    $ cat bin/tests/system/test-suite.log
    cat: bin/tests/system/test-suite.log: No such file or directory
2020-08-28 14:00:10 +02:00
Ondřej Surý
56ee60e130 Merge branch '2074-bind-allows-an-empty-cm-value-for-optional-loc-rdata-fields' into 'main'
Resolve "BIND allows an empty 'cm' value for optional LOC RDATA fields"

Closes #2074

See merge request isc-projects/bind9!3988
2020-08-26 14:28:17 +00:00
Mark Andrews
d9594cffab Add CHANGES note 2020-08-26 15:31:51 +02:00
Mark Andrews
2ca4d35037 Refactor totext_loc 2020-08-26 15:31:31 +02:00
Mark Andrews
337cc878fa Correctly encode LOC records with non integer negative altitudes. 2020-08-26 15:31:31 +02:00
Mark Andrews
888dfd78c7 Check LOC's altitude field is properly parsed and encoded. 2020-08-26 15:31:31 +02:00
Mark Andrews
9225c67835 Tighten LOC parsing to reject period and/or m as a value. 2020-08-26 15:31:31 +02:00
Mark Andrews
daca5e8912 Merge branch '2080-data-race-in-rdataset_addglue' into 'main'
Resolve "data race in rdataset_addglue"

Closes #2080

See merge request isc-projects/bind9!3987
2020-08-26 11:32:57 +00:00
Mark Andrews
48973c3ec6 Add CHANGES note 2020-08-26 21:16:04 +10:00
Ondřej Surý
01684cc219 Use the Fibonacci Hashing for the RBTDB glue table
The rbtdb version glue_table has been refactored similarly to rbt.c hash
table, so it does use 32-bit hash function return values and apply
Fibonacci Hashing to lookup the index to the hash table instead of
modulo.  For more details, see the lib/dns/rbt.c commit log.
2020-08-26 21:16:04 +10:00