Commit Graph
8990 Commits
Author SHA1 Message Date
Mark Andrews e4e4ff0e10 Update ZONEMD to match RFC 8976
* The location of the digest type field has changed to where the
  reserved field was.
* The reserved field is now called scheme and is where the digest
  type field was.
* Digest type 2 has been defined (SHA256).

(cherry picked from commit 8510ccaa54)
2021-04-30 11:31:05 +10:00
Mark Andrews e0fbb10017 Check that excessive iterations in logged by named when
loading an existing zone or transfering from the primary.

(manually picked from commit 46eb21c546)
2021-04-30 10:49:00 +10:00
Mark Andrews aa6a2d3902 Check NSEC3 iterations with dnssec-signzone
(cherry picked from commit 8ec16c378d)
2021-04-30 10:49:00 +10:00
Mark Andrews 80e8f72500 Check that named rejects excessive iterations via UPDATE
(cherry picked from commit 4ce8437a6e)
2021-04-30 10:49:00 +10:00
Mark Andrews f5625719a0 nsupdate: reject attempts to add NSEC3PARAM with excessive iterations
(manually picked from commit 3fe75d9809)
2021-04-30 10:49:00 +10:00
Mark Andrews 91a7f94a66 Reduce nsec3 max iterations to 150
(manually picked from commit 29126500d2)
2021-04-30 10:49:00 +10:00
Mark AndrewsandMichał Kępień dacfd3fb87 Handle DNAME lookup via itself
When answering a query, named should never attempt to add the same RRset
to the ANSWER section more than once.  However, such a situation may
arise when chasing DNAME records: one of the DNAME records placed in the
ANSWER section may turn out to be the final answer to a client query,
but there is no way to know that in advance.  Tweak the relevant INSIST
assertion in query_find() so that it handles this case properly.  The
rdataset is freed later anyway, so there is no need to clean it up
immediately.
2021-04-29 11:56:03 +02:00
Michał Kępień 7a06b8aefe Test "tkey-gssapi-credential" conditionally
If "tkey-gssapi-credential" is set in the configuration and GSSAPI
support is not available, named will refuse to start.  As the test
system framework does not support starting named instances
conditionally, ensure that "tkey-gssapi-credential" is only present in
named.conf if GSSAPI support is available.

(cherry picked from commit 6feac68b50)
2021-04-26 09:46:23 +02:00
Petr Špaček d0a16000dd Add tests for the "tkey-gssapi-credential" option
Four named instances in the "nsupdate" system test have GSS-TSIG support
enabled.  All of them currently use "tkey-gssapi-keytab".  Configure two
of them with "tkey-gssapi-credential" to test that option.

As "tkey-gssapi-keytab" and "tkey-gssapi-credential" both provide the
same functionality, no test modifications are required.  The difference
between the two options is that the value of "tkey-gssapi-keytab" is an
explicit path to the keytab file to acquire credentials from, while the
value of "tkey-gssapi-credential" is the name of the principal whose
credentials should be used; those credentials are looked up in the
keytab file expected by the Kerberos library, i.e. /etc/krb5.keytab by
default.  The path to the default keytab file can be overridden using by
setting the KRB5_KTNAME environment variable.  Utilize that variable to
use existing keytab files with the "tkey-gssapi-credential" option.

The KRB5_KTNAME environment variable should not interfere with the
"tkey-gssapi-keytab" option.  Nevertheless, rename one of the keytab
files used with "tkey-gssapi-keytab" to something else than the contents
of the KRB5_KTNAME environment variable in order to make sure that both
"tkey-gssapi-keytab" and "tkey-gssapi-credential" are actually tested.

(cherry picked from commit 1746d2e84a)
2021-04-23 10:24:00 +02:00
Mark AndrewsandOndřej Surý 0e9cd93c06 Handle expected signals in tsiggss authsock.pl script
When the authsock.pl script would be terminated with a signal,
it would leave the pidfile around.  This commit adds a signal
handler that cleanups the pidfile on signals that are expected.
2021-04-01 10:19:33 +02:00
Mark Andrews dc88bd641d Address unchecked returns leading to NULL pointer dereferences
on out of memory conditions.
2021-02-25 11:44:28 +11:00
Michal Nowak 936f7a2da9 Prevent Git to expand $systest
CentOS 8 "git status" unexpectedly expands search directory "tsig" to
also search in the "tsiggss" directory, thus incorrectly identifying
files as "not removed" in the "tsig" directory:

$ git status -su --ignored tsig
$ touch tsiggss/ns1/{named.run,named.memstats}
$ git status -su --ignored tsig
!! tsiggss/ns1/named.memstats
!! tsiggss/ns1/named.run

(cherry picked from commit f310b75250)
2021-02-18 10:16:30 +01:00
Michal Nowak c6fcb29a27 Clean omitted files from system tests
Any CI job:
- I:dns64:file ns1/Ksigned.+005+*.key not removed
- I:dns64:file ns1/Ksigned.ns1/Ksigned.+005+*.private
- I:dns64:file ns1/Ksigned.ns1/Ksigned.+005+*.key
- I:dns64:file ns1/Ksigned.ns1/Ksigned.+005+*.private
- I:dns64:file ns1/Ksigned.ns1/dsset-signed.
- I:dns64:file ns1/Ksigned.ns1/named.conf
- I:dns64:file ns1/Ksigned.ns1/signed.db
- I:dns64:file ns1/Ksigned.ns1/signed.db.signed
- I:dns64:file ns1/Ksigned.ns2/named.conf
- I:ixfr:file ns5/named.run.prev not removed
- I:legacy:file ns1/named_dump.db.test20 not removed

(cherry picked from commit 14a104d121)
2021-02-18 10:05:18 +01:00
Michal Nowak eb26769b45 Add system test name to "file not removed" info
(cherry picked from commit 10bf725ee2)
2021-02-18 09:42:12 +01:00
Michal Nowak aee29f7c17 Add README.md file to rsabigexponent system test
This README.md describes why is bigkey needed.

(cherry picked from commit a247f24dfa)
2021-01-29 15:48:39 +01:00
Tinderbox UserandMichał Kępień 177d66e39f prep 9.11.27 2021-01-21 09:38:24 +01:00
Michal Nowak 187fd98bca update for 2021 2021-01-06 16:55:54 +01:00
Mark Andrews 5cec1ba2fa Handle shared library platforms that don't support inter library dependancies 2020-12-21 01:10:00 +00:00
Mark Andrews d744db22f3 fix LIB0 for isc-hmac-fixup and named-nzd2nzf 2020-12-21 01:10:00 +00:00
Tinderbox UserandMichał Kępień 363a2c3e5e prep 9.11.26 2020-12-16 22:32:08 +01:00
Mark Andrews 8780605bc0 Flush client before putting it on inactive
WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1:
    #0 get_client bin/named/client.c:3928:16
    #1 ns_client_replace bin/named/client.c:3725:12
    #2 query_recurse bin/named/query.c:4366:13
    #3 query_find bin/named/query.c
    #4 ns_query_start bin/named/query.c:9716:8
    #5 client_request bin/named/client.c:3127:3
    #6 dispatch lib/isc/task.c:1157:7
    #7 run lib/isc/task.c:1331:2

    Previous write of size 4 at 0x000000000001 by thread T2:
    #0 exit_check bin/named/client.c:706:17
    #1 ns_client_detach bin/named/client.c:3702:8
    #2 query_resume bin/named/query.c:4186:3
    #3 dispatch lib/isc/task.c:1157:7
    #4 run lib/isc/task.c:1331:2
2020-12-10 06:31:20 +00:00
Mark Andrews 7382c3929a Ingore TSAN errors accessing 'last'
WARNING: ThreadSanitizer: data race
    Read of size 4 at 0x000000000001 by thread T1:
    #0 log_quota bin/named/query.c:4291:22
    #1 query_recurse bin/named/query.c:4346:4
    #2 query_find bin/named/query.c
    #3 ns_query_start bin/named/query.c:9716:8
    #4 client_request bin/named/client.c:3115:3
    #5 dispatch lib/isc/task.c:1157:7
    #6 run lib/isc/task.c:1331:2

    Previous write of size 4 at 0x000000000001 by thread T2:
    #0 last_cmpxchg bin/named/query.c:81:6
    #1 log_quota bin/named/query.c:4293:7
    #2 query_recurse bin/named/query.c:4346:4
    #3 query_find bin/named/query.c
    #4 ns_query_start bin/named/query.c:9716:8
    #5 client_request bin/named/client.c:3115:3
    #6 dispatch lib/isc/task.c:1157:7
    #7 run lib/isc/task.c:1331:2
2020-12-10 06:31:19 +00:00
Mark Andrews b86b3fe853 Ignore TSAN errors when accessing 'ns_client_requests' 2020-12-10 06:31:19 +00:00
Mark Andrews 0e5a076cc1 Prevent inlining of code with thread sanitiser disabled 2020-12-10 06:31:19 +00:00
Ondřej SurýandOndřej Surý 6425dfa9cb 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:04:28 +01:00
Mark Andrews d09991e4e9 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-01 22:13:05 +00:00
Mark AndrewsandEvan Hunt ca9dc40634 Fix DNAME when QTYPE is CNAME or ANY
The synthesised CNAME is not supposed to be followed when the
QTYPE is CNAME or ANY as the lookup is satisfied by the CNAME
record.
2020-12-01 11:46:32 -08:00
Michał Kępień dfdd3a8a2f Make DocBook sources namespaced again
Every DocBook source document can be namespaced (DocBook 5) or
non-namespaced (DocBook 4).  The set of XSL stylesheets used for
producing an output document can also be namespaced or non-namespaced.
Namespaced source documents should be used with namespaced stylesheets
and non-namespaced source documents should be used with non-namespaced
stylesheets.  However, both stylesheet flavors contain processing rules
which allow them to be used interchangeably for any type of source
document.

Unfortunately, these processing rules became broken in version 1.79.1 of
the stylesheets, which means that non-namespaced source documents can no
longer be correctly transformed into man pages using namespaced
stylesheets and vice versa.  This problem was fixed upstream [1], but no
released version of the XSL stylesheets contains that fix yet.

Back in 2016, this problem was reported as RT #43831 and allegedly fixed
in commit 1b8ce3b330.  However, that fix
only helped for the non-namespaced version of the stylesheets - while
also breaking man page generation for the namespaced flavor.

Since using namespaced DocBook sources is the current best practice
(DocBook 5), make BIND DocBook sources namespaced again.  When using
version 1.79.1 or 1.79.2 of the XSL stylesheets, care must be taken to
ensure namespaced stylesheets are used for generating BIND
documentation.

[1] https://github.com/docbook/xslt10-stylesheets/issues/109
2020-11-30 09:33:32 +01:00
Mark Andrews 81e5877520 Check that missing cookies are handled
(cherry picked from commit bd9155590e)
2020-11-27 10:20:40 +11:00
Michal Nowak 76d1c90ef7 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:25:44 +01:00
Mark AndrewsandMichal Nowak 43c1e5be46 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 0f0a006c)
2020-11-26 18:21:05 +01:00
Tinderbox UserandMichał Kępień 66faf3215c prep 9.11.25 2020-11-26 12:33:58 +01:00
Havard EidnesandMichal Nowak e73d2f6bbe Avoid a non-standard bashism: use of "==" in "test".
(cherry picked from commit 1f83daa4ac)
2020-11-10 14:13:57 +01:00
Mark Andrews 1b8b355ec5 Add CHANGES note for [GL #2236]
(cherry picked from commit decf117eb6)
2020-10-30 09:08:44 +11:00
Mark Andrews 8d2e091d46 Check that a zone in the process of being signed resolves
ans10 simulates a local anycast server which has both signed and
unsigned instances of a zone.  'A' queries get answered from the
signed instance.  Everything else gets answered from the unsigned
instance.  The resulting answer should be insecure.

(cherry picked from commit d7840f4b93)
2020-10-30 08:25:34 +11:00
Evan Hunt c94559480e fix a typo in rpz test
"tcp-only" was not being tested correctly in the RPZ system test
because the option to the "digcmd" function that causes queries to
be sent via TCP was misspelled in one case, and was being interpreted
as a query name.

the "ckresult" function has also been changed to be case sensitive
for consistency with "digcmd".

(cherry picked from commit 78af071c11)
2020-10-28 22:42:37 -07:00
Michal Nowak 523050f054 Fix system test backtrace generation on OpenBSD
On Linux core dump contains absolute path to crashed binary

    Core was generated by `/home/newman/isc/ws/bind9/bin/named/.libs/lt-named -D glue-ns1 -X named.lock -m'.

However, on OpenBSD there's only a basename

    Core was generated by `named'.

This commit adds support for the latter, retains the former.

(cherry picked from commit f0b13873a3)
(cherry picked from commit 659feff963)
2020-10-26 16:58:30 +01:00
Diego Fronza 29043867c7 Update copyrights 2020-10-26 10:45:27 -03:00
Diego Fronza 4fef8acbfa Adjusted additional system test (NS, non-root zone)
After the updates from this branch, BIND now sends glue records for
NS queries even when configured with minimal-responses yes.
2020-10-26 10:45:27 -03:00
Diego Fronza acef95ce44 Added test for the proposed fix
This test is very simple, two nameserver instances are created:
    - ns4: master, with 'minimal-responses yes', authoritative
        for example. zone
    - ns5: slave, stub zone

The first thing verified is the transfer of zone data from master
to slave, which should be saved in ns5/example.db.

After that, a query is issued to ns5 asking for target.example.
TXT, a record present in the master database with the "test" string
as content.

If that query works, it means stub zone successfully request
nameserver addresses from master, ns4.example. A/AAAA

The presence of both A/AAAA records for ns4 is also verified in the
stub zone local file, ns5/example.db.
2020-10-26 10:45:27 -03:00
Diego Fronza 07564aedcf Always return address records in additional section for NS queries 2020-10-26 10:45:27 -03:00
Michal Nowak e0af53ac0f Ensure use of "echo_i" where possible
In many instances 'echo "I:' construct was used where echo_i function
should have been.
2020-10-22 12:16:24 +02:00
Diego Fronza 0cd414a390 Fix dnstap system test on FreeBSD
This commit ensures that dnstap output files captured
by fstrm_capture are properly flushed before any attempt
on reading them with dnstap-read is done.

By reading fstrm-capture source code it was noticed that
signal SIGHUP is used to flush the capture file.
2020-10-20 10:39:48 -03:00
Mark Andrews 140659c57a Drop the expected minimum number of buckets to 4.
The previous value of 5 produced too many false errors.

(cherry picked from commit 0abb49034e)
2020-10-15 12:32:26 +11:00
Mark Andrews 96399960c1 Try to improve rrl timing
Add a +burst option to mdig so that we have a second to setup the
mdig calls then they run at the start of the next second.

RRL uses 'queries in a second' as a approximation to
'queries per second'. Getting the bursts of traffic to all happen in
the same second should prevent false negatives in the system test.

We now have a second to setup the traffic in.  Then the traffic should
be sent at the start of the next second.  If that still fails we
should move to +burst=<now+2> (further extend mdig) instead of the
implicit <now+1> as the trigger second.

(cherry picked from commit 92cdc7b6c7)
2020-10-15 11:47:08 +11:00
Michal Nowak d7ea583ad0 Bring back --rpz-log-qtype-qclass feature-test option
It was unintentionally removed during a backport.
2020-10-07 11:24:16 +02:00
Ondřej SurýandOndřej Surý d7b16b780f Adjust legacy tests for default 1232 EDNS Buffer Size
* legacy test was just expecting default server EDNS buffer size to be 4096,
  the test needed the adjustment to reset the buffer sizes back to 4096.
2020-10-06 09:34:49 +02:00
Ondřej Surý 3ab08cdaa4 Adjust digdelv tests for default 1232 EDNS Buffer Size
* digdelv test was just expecting default server EDNS buffer size to be
  4096, the test needed only slight adjustment

(cherry picked from commit f1556f8c41)
(cherry picked from commit 6b303721f1ee472dc8ab2d1df03191a98d4e4e5e)
2020-10-05 17:00:24 +02:00
Ondřej Surý c164c9a819 Change the default ENDS buffer size to 1232 for DNS Flag Day 2020
The DNS Flag Day 2020 aims to remove the IP fragmentation problem from
the UDP DNS communication.  In this commit, we implement the minimal
required changes by changing the defaults for `edns-udp-size`,
`max-udp-size` and `nocookie-udp-size` to `1232` (the value picked by
DNS Flag Day 2020).

(cherry picked from commit bb990030d3)
(cherry picked from commit df06773f9a73e4a4bb0b5e7f4bd8e40394e64032)
2020-10-05 16:54:39 +02:00
Diego FronzaandOndřej Surý 79c62017eb Properly handling dns_message_t shared references
This commit fix the problems that arose when moving the dns_message_t
object from fetchctx_t to the query structure.

Since the lifetime of query objects are different than that of a
fetchctx and the dns_message_t object held by the query may be being
used by some external module, e.g. validator, even after the query may
have been destroyed, propery handling of the references to the message
were added in this commit to avoid accessing an already destroyed
object.

Specifically, in resquery_response(), a reference to the message is
attached at the beginning of the function and detached at the end, since
a possible call to fctx_cancelquery() would release the dns_message_t
object, and in the next lines of code a call to add_bad() would require
a valid pointer to the same object.

In valcreate() a new reference is attached to the message object, this
ensures that if the corresponding query object is destroyed before the
validator attempts to access it, no invalid pointer access occurs.

In validated() we have to attach a new reference to the message, since
we destroy the validator object at the beginning of the function, and we
need access to the message in the next lines of the same function.
2020-09-30 14:04:04 +02:00