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

32401 Commits

Author SHA1 Message Date
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
Mark Andrews
33d0e8d168 rbtversion->glue_table_size must be read when holding a lock 2020-08-26 21:16:04 +10:00
Michal Nowak
0ede73b9f1 Merge branch 'mnowak/tumbleweed-fix-krb5-config-location' into 'main'
Tumbleweed changed location of krb5-config

See merge request isc-projects/bind9!4016
2020-08-26 08:57:20 +00:00
Michal Nowak
6095811461 Tumbleweed changed location of krb5-config
krb5-config is now in /usr/bin/ and we should detect it automatically.
2020-08-26 10:56:01 +02:00
Ondřej Surý
045173f8a7 Merge branch '2097-manual-page-tools-need-updating' into 'main'
Fix generated documentation

Closes #2097

See merge request isc-projects/bind9!4017
2020-08-26 08:51:49 +00:00
Michal Nowak
56abe27b9e Fix generated documentation
With Sphinx 3.2.1 line-leading period should be escaped.
2020-08-26 10:34:01 +02:00
Ondřej Surý
f3270a6d88 Merge branch 'ondrej/copy-wire-test-to-fuzz' into 'main'
Add dns_message_parse() fuzzer

See merge request isc-projects/bind9!4009
2020-08-25 18:19:02 +00:00
Ondřej Surý
9d14522469 Add minimized (cmin-tmin-cmin) corpus for dns_message_parse fuzzer
The non-minimized corpus from https://github.com/CZ-NIC/dns-fuzzing was
used as input to afl-cmin, then every case were processed by afl-tmin
and then afl-cmin was used to further minimize the corpus again.
2020-08-25 16:40:24 +02:00
Ondřej Surý
01cc80376e Add dns_message_parse() fuzzer
Previously, the bin/system/wire_test.c was optionally used as a fuzzer,
this commit extracts the parts relevant to the fuzzing into a
specialized fuzzer that can be used in oss-fuzz project.

The fuzzer parses the input as UDP DNS message, then prints parsed DNS
message, then renders the DNS message and then prints the rendered DNS
message.  No part of the code should cause a assertion failure.
2020-08-25 16:40:24 +02:00
Ondřej Surý
2164b6926f Merge branch '2095-shifting-large-rcode-in-dns-message-c-results-in-undefined-behaviour' into 'main'
Resolve "Shifting large rcode in dns/message.c results in undefined behaviour"

Closes #2095

See merge request isc-projects/bind9!4011
2020-08-25 14:11:04 +00:00
Mark Andrews
a347641782 Cast the original rcode to (dns_ttl_t) when setting extended rcode
Shifting (signed) integer left could trigger undefined behaviour when
the shifted value would overflow into the sign bit (e.g. 2048).

The issue was found when using AFL++ and UBSAN:

    message.c:2274:33: runtime error: left shift of 2048 by 20 places cannot be represented in type 'int'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior message.c:2274:33 in
2020-08-25 14:10:05 +00:00
Michal Nowak
3f85b0fe3b Merge branch '2053-test-disable-buffer-useinline-in-gitlab-ci' into 'main'
Resolve "Test --disable-buffer-useinline in GitLab CI"

Closes #2053

See merge request isc-projects/bind9!3983
2020-08-25 14:04:47 +00:00
Michal Nowak
f34df4ef90 Build CentOS 8 with --enable-buffer-useinline 2020-08-25 16:02:55 +02:00
Michal Nowak
dd425254a7 Fix warnings in when build with --enable-buffer-useinline
sockaddr.c:147:49: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness
    rdata.c:1780:30: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness
2020-08-25 16:02:55 +02:00
Mark Andrews
f036e0bc7f Merge branch 'marka-add-missing-isc_mutex_init' into 'main'
Add missing isc_mutex_init to manytasks subtest.

See merge request isc-projects/bind9!3996
2020-08-24 23:54:46 +00:00
Mark Andrews
2eb5c29c83 Add missing isc_mutex_init to manytasks subtest. 2020-08-24 22:38:08 +00:00
Ondřej Surý
273d21fc93 Merge branch 'ondrej/update-pregenerated-files' into 'main'
Update pregenerated documentation files

See merge request isc-projects/bind9!4005
2020-08-24 17:48:14 +00:00
Ondřej Surý
ca487a5db0 Sync the pregenerated files with their source counterparts 2020-08-24 14:44:05 +02:00
Ondřej Surý
586415fea2 Make sure the maintainer files are clean after rebuild
When updating source files, we might forget to update pre-generated
files (generated by sphinx-build and cfg_gen) and then the extra changes
would get included in the random merge request.

This commit updates the tarball-create job to enable the maintainer
mode, then clean all maintainer files (`make maintainer-clean`) rebuild
all the file from scratch and compare the result which must be a clean
git directory.
2020-08-24 14:40:39 +02:00
Ondřej Surý
62971d4a3c Merge branch 'ondrej/update-readline-support-fix' into 'main'
Add missing support for --with-readline=yes

See merge request isc-projects/bind9!3984
2020-08-24 11:39:18 +00:00
Michal Nowak
727272934e editline's pkg-config name is libeditline 2020-08-24 09:11:47 +02:00