]> git.ipfire.org Git - thirdparty/pdns.git/log
thirdparty/pdns.git
14 months agoMerge pull request #12698 from omoerbeek/rec-synthesized
Otto Moerbeek [Mon, 3 Apr 2023 11:10:46 +0000 (13:10 +0200)] 
Merge pull request #12698 from omoerbeek/rec-synthesized

rec: Start using newly assigned "Synthesized" EDE

14 months agoMerge pull request #12655 from omoerbeek/rec-hints-names
Otto Moerbeek [Mon, 3 Apr 2023 11:10:24 +0000 (13:10 +0200)] 
Merge pull request #12655 from omoerbeek/rec-hints-names

Rec: rework root priming code to allow multiple addresses per NS

14 months agoMerge pull request #10072 from zeha/debian-update-rec
Otto Moerbeek [Mon, 3 Apr 2023 10:29:44 +0000 (12:29 +0200)] 
Merge pull request #10072 from zeha/debian-update-rec

Update Debian packaging for Recursor

14 months agoAdd test, with some reorganization as reczones is not linked into testrunner. 12655/head
Otto Moerbeek [Mon, 3 Apr 2023 10:18:02 +0000 (12:18 +0200)] 
Add test, with some reorganization as reczones is not linked into testrunner.

So move a few functions to reczones-helpers.cc

14 months agoRefactor of root priming code
Otto Moerbeek [Mon, 6 Feb 2023 07:57:31 +0000 (08:57 +0100)] 
Refactor of root priming code

14 months agorec: process hints with multiple addresses per name correctly.
Otto Moerbeek [Wed, 1 Feb 2023 12:44:47 +0000 (13:44 +0100)] 
rec: process hints with multiple addresses per name correctly.

Fixes #12486

14 months agoMerge pull request #12497 from jsoref/shorthands-for-seconds
Otto Moerbeek [Mon, 3 Apr 2023 08:24:36 +0000 (10:24 +0200)] 
Merge pull request #12497 from jsoref/shorthands-for-seconds

Shorthands for seconds

14 months agoRegression tests should use new EDE 12698/head
Otto Moerbeek [Mon, 3 Apr 2023 07:20:12 +0000 (09:20 +0200)] 
Regression tests should use new EDE

14 months agoMerge pull request #12708 from aerique/bugfix/dnsdist-18-eol
Otto Moerbeek [Mon, 3 Apr 2023 06:22:35 +0000 (08:22 +0200)] 
Merge pull request #12708 from aerique/bugfix/dnsdist-18-eol

Fix EOL table for DNSdist.

14 months agoMerge pull request #12707 from Habbie/ywh
Otto Moerbeek [Mon, 3 Apr 2023 06:22:07 +0000 (08:22 +0200)] 
Merge pull request #12707 from Habbie/ywh

change hackerone references to point to yeswehack

14 months agoMerge pull request #12705 from hlindqvist/pdnsrec-perf-notrack-tcp-reminder
Otto Moerbeek [Mon, 3 Apr 2023 06:20:14 +0000 (08:20 +0200)] 
Merge pull request #12705 from hlindqvist/pdnsrec-perf-notrack-tcp-reminder

Add reminders for 53/tcp rules in the NOTRACK example rules in pdns-rec docs

14 months agoFix EOL table for DNSdist. 12708/head
Erik Winkels [Thu, 30 Mar 2023 14:23:04 +0000 (16:23 +0200)] 
Fix EOL table for DNSdist.

14 months agochange hackerone references to point to yeswehack 12707/head
Peter van Dijk [Thu, 30 Mar 2023 14:03:49 +0000 (16:03 +0200)] 
change hackerone references to point to yeswehack

14 months agoMerge pull request #12692 from rgacogne/ddist180-changelog-secpoll
aerique [Thu, 30 Mar 2023 13:12:18 +0000 (15:12 +0200)] 
Merge pull request #12692 from rgacogne/ddist180-changelog-secpoll

dnsdist: Prepare ChangeLog and secpoll update for 1.8.0

14 months agodnsdist: Prepare ChangeLog and secpoll update for 1.8.0 12692/head
Erik Winkels [Thu, 30 Mar 2023 11:17:16 +0000 (13:17 +0200)] 
dnsdist: Prepare ChangeLog and secpoll update for 1.8.0

14 months agoMerge pull request #12706 from san983/master
Peter van Dijk [Thu, 30 Mar 2023 07:52:55 +0000 (09:52 +0200)] 
Merge pull request #12706 from san983/master

Fixes a typo in pdnsutil clear-zone help output

14 months agoFixes a typo in pdnsutil clear-zone help output 12706/head
Santiago Traversa [Thu, 30 Mar 2023 03:39:02 +0000 (00:39 -0300)] 
Fixes a typo in pdnsutil clear-zone help output

from
# pdnsutil clear-zone foo bar
Syntax: pdnsutil edit-zone ZONE

to
# pdnsutil clear-zone foo bar
Syntax: pdnsutil clear-zone ZONE

14 months agoAdd reminders for 53/tcp in the NOTRACK rules in docs 12705/head
Håkan Lindqvist [Wed, 29 Mar 2023 20:25:29 +0000 (22:25 +0200)] 
Add reminders for 53/tcp in the NOTRACK rules in docs

14 months agoMerge pull request #12704 from omoerbeek/rec-spellcheck-memlock
Peter van Dijk [Wed, 29 Mar 2023 21:04:09 +0000 (23:04 +0200)] 
Merge pull request #12704 from omoerbeek/rec-spellcheck-memlock

spellcheck: Fix entry for memlock

14 months agoFix entry for memlock 12704/head
Otto Moerbeek [Wed, 29 Mar 2023 14:20:37 +0000 (16:20 +0200)] 
Fix entry for memlock

16:20 < Habbie> uppercase requires uppercase, lowercase matches both?
16:20 < Habbie> and putting both in triggers a bug?
16:20 < timeless> Right
16:20 < timeless> More or less

14 months agoMerge pull request #12703 from omoerbeek/rec-prep-2023-02
Otto Moerbeek [Wed, 29 Mar 2023 11:11:36 +0000 (13:11 +0200)] 
Merge pull request #12703 from omoerbeek/rec-prep-2023-02

Prep for PowerDNS Security Advisory 2023-02

14 months agoMerge pull request #12699 from omoerbeek/rec-spoof
Otto Moerbeek [Wed, 29 Mar 2023 10:33:07 +0000 (12:33 +0200)] 
Merge pull request #12699 from omoerbeek/rec-spoof

rec: Deterred spoofing attempts can lead to authoritative servers being marked unavailable

14 months agoSpellcheck 12703/head
Otto Moerbeek [Wed, 29 Mar 2023 10:08:50 +0000 (12:08 +0200)] 
Spellcheck

14 months agoPrep for PowerDNS Security Advisory 2023-02
Otto Moerbeek [Tue, 28 Mar 2023 07:51:38 +0000 (09:51 +0200)] 
Prep for PowerDNS Security Advisory 2023-02

14 months agoStart using newly assigned "Synthesized" EDE
Otto Moerbeek [Wed, 29 Mar 2023 09:18:54 +0000 (11:18 +0200)] 
Start using newly assigned "Synthesized" EDE

14 months agoPowerDNS Security Advisory 2023-02: Deterred spoofing attempts can lead to authoritat... 12699/head
Otto Moerbeek [Wed, 29 Mar 2023 07:44:10 +0000 (09:44 +0200)] 
PowerDNS Security Advisory 2023-02: Deterred spoofing attempts can lead to authoritative servers being marked unavailable (CVE-2023-26437)

14 months agoMerge pull request #12697 from rgacogne/ddist-wait-longer-before-killing
Remi Gacogne [Wed, 29 Mar 2023 03:38:16 +0000 (05:38 +0200)] 
Merge pull request #12697 from rgacogne/ddist-wait-longer-before-killing

dnsdist: Wait a bit longer for the process to exit before killing it

14 months agoMerge pull request #12696 from omoerbeek/rec-negcache-test-race
Otto Moerbeek [Tue, 28 Mar 2023 15:48:08 +0000 (17:48 +0200)] 
Merge pull request #12696 from omoerbeek/rec-negcache-test-race

rec: fix a race in the negcache unit tests

14 months agodnsdist: Wait a bit longer for the process to exit before killing it 12697/head
Remi Gacogne [Tue, 28 Mar 2023 15:22:27 +0000 (17:22 +0200)] 
dnsdist: Wait a bit longer for the process to exit before killing it

This prevents a long list of
```
kill... <Popen: returncode: None args: ['../pdns/dnsdistdist/dnsdist', '--supervised...>
```
when running with TSAN-enabled.
In my tests it did not seem to really slow the build: roughly 3%
slower but that might even be in the error margin for these tests.

14 months agorec: fix a race in the negcache unit tests 12696/head
Otto Moerbeek [Tue, 28 Mar 2023 14:32:41 +0000 (16:32 +0200)] 
rec: fix a race in the negcache unit tests

14 months agoMerge pull request #12694 from omoerbeek/rec-reset-ede
Otto Moerbeek [Tue, 28 Mar 2023 14:16:32 +0000 (16:16 +0200)] 
Merge pull request #12694 from omoerbeek/rec-reset-ede

rec: reset EDE in context when starting to resolve

14 months agoMerge pull request #12695 from omoerbeek/rec-map-stack-fbsd
Otto Moerbeek [Tue, 28 Mar 2023 12:52:54 +0000 (14:52 +0200)] 
Merge pull request #12695 from omoerbeek/rec-map-stack-fbsd

rec: Unbreak FreeBSD mthread stack allocation

14 months agoTest that an intermediate EDE does not get reported with the final answer 12694/head
Otto Moerbeek [Tue, 28 Mar 2023 12:48:26 +0000 (14:48 +0200)] 
Test that an intermediate EDE does not get reported with the final answer

14 months agoUnbreak FreeBSD mthread stack allocation 12695/head
Otto Moerbeek [Tue, 28 Mar 2023 12:00:03 +0000 (14:00 +0200)] 
Unbreak FreeBSD mthread stack allocation

On FreeBSD, MAP_STACK has a completely different meaning compared to
OpenBSD. So only use MAP_STACK on OpenBSD.

14 months agoMerge pull request #12674 from rgacogne/less-shared-ptr dnsdist-1.9.0-alpha0
Remi Gacogne [Tue, 28 Mar 2023 11:20:16 +0000 (13:20 +0200)] 
Merge pull request #12674 from rgacogne/less-shared-ptr

validate: Stop passing shared pointers all the way down

14 months agoMerge pull request #12689 from rgacogne/ddist-grepq-tofile
Remi Gacogne [Tue, 28 Mar 2023 11:19:18 +0000 (13:19 +0200)] 
Merge pull request #12689 from rgacogne/ddist-grepq-tofile

dnsdist: Add an option to write `grepq`'s output to a file

14 months agoMerge pull request #12682 from rgacogne/ddist-ci-wait-for dnsdist-1.8.0
Remi Gacogne [Tue, 28 Mar 2023 10:39:46 +0000 (12:39 +0200)] 
Merge pull request #12682 from rgacogne/ddist-ci-wait-for

dnsdist: Wait until dnsdist is listening on the requested port in the tests

14 months agorec: reset EDE in context when starting to resolve
Otto Moerbeek [Tue, 28 Mar 2023 09:09:40 +0000 (11:09 +0200)] 
rec: reset EDE in context when starting to resolve

Fixes #12691

There is a slight complication here: If QM found an error, a retry
without QM is done, and that clears the EDE but might not find an
EDE itself (since it does not walk all labels).  So remember the
original EDE and put it back in place if the last effort attempt
failed but did not set an EDE.

14 months agodnsdist: Apply suggestions from code review, apply formatting 12689/head
Remi Gacogne [Tue, 28 Mar 2023 07:12:25 +0000 (09:12 +0200)] 
dnsdist: Apply suggestions from code review, apply formatting

14 months agoMerge pull request #12688 from omoerbeek/rec-bound-invariant
Otto Moerbeek [Mon, 27 Mar 2023 15:04:41 +0000 (17:04 +0200)] 
Merge pull request #12688 from omoerbeek/rec-bound-invariant

rec: re-establish "recursion depth is always increasing" invariant

14 months agodnsdist: Add an option to write `grepq`'s output to a file
Remi Gacogne [Mon, 27 Mar 2023 15:03:43 +0000 (17:03 +0200)] 
dnsdist: Add an option to write `grepq`'s output to a file

14 months agoALso derive alias recursion bound from s_maxdepth. 12688/head
Otto Moerbeek [Mon, 27 Mar 2023 10:22:16 +0000 (12:22 +0200)] 
ALso derive alias recursion bound from s_maxdepth.

This should be revisited, as it looks like the check
in doCNAMECacheCheck() overrides the less strick check in
doResolveNoQNameMinimization().

14 months agodnsdist: Don't test the web server port before the concurrent conns check 12682/head
Remi Gacogne [Mon, 27 Mar 2023 08:01:51 +0000 (10:01 +0200)] 
dnsdist: Don't test the web server port before the concurrent conns check

14 months agorec: re-establish "recursion depth is always increasing" invariant
Otto Moerbeek [Thu, 23 Mar 2023 10:42:35 +0000 (11:42 +0100)] 
rec: re-establish "recursion depth is always increasing" invariant

Now that we have getQMFallbackMode(), we can go back to always increase depth
and never decrease it and adapt the upper bound check if needed.

This should prevent a re-occurence of a bug similar to PowerDNS Security Advisory 2023-01.

14 months agoMerge pull request #12687 from rgacogne/ddist-rule-params
Remi Gacogne [Sat, 25 Mar 2023 14:54:09 +0000 (15:54 +0100)] 
Merge pull request #12687 from rgacogne/ddist-rule-params

dnsdist: Fix 'Unknown key' issue for actions and rules parameters

14 months agoMerge pull request #12684 from Habbie/amazon-linux-2023
Peter van Dijk [Fri, 24 Mar 2023 22:51:20 +0000 (23:51 +0100)] 
Merge pull request #12684 from Habbie/amazon-linux-2023

builder: add amazon-2023 target

14 months agodnsdist: Fix 'Unknown key' issue for actions and rules parameters 12687/head
Remi Gacogne [Fri, 24 Mar 2023 17:26:13 +0000 (18:26 +0100)] 
dnsdist: Fix 'Unknown key' issue for actions and rules parameters

The parameters were properly parsed but not marked as consumed,
leading to warnings such as:
```
addAction: Unknown key 'name' given - ignored
```

14 months agobuilder: add amazon-2023 target 12684/head
Peter van Dijk [Tue, 21 Mar 2023 14:32:06 +0000 (15:32 +0100)] 
builder: add amazon-2023 target

14 months agoMerge pull request #12668 from aerique/feature/add-auth-48-to-repo-script
Remi Gacogne [Fri, 24 Mar 2023 13:49:27 +0000 (14:49 +0100)] 
Merge pull request #12668 from aerique/feature/add-auth-48-to-repo-script

Add auth-48 to repo test script.

14 months agodnsdist: Remove a left-over startup delay in the regression tests
Remi Gacogne [Fri, 24 Mar 2023 09:47:27 +0000 (10:47 +0100)] 
dnsdist: Remove a left-over startup delay in the regression tests

14 months agodnsdist: Wait the correct port to come up on special case tests
Remi Gacogne [Fri, 24 Mar 2023 09:47:02 +0000 (10:47 +0100)] 
dnsdist: Wait the correct port to come up on special case tests

14 months agodnsdist: Wait for the API port to be available before running the tests
Remi Gacogne [Fri, 24 Mar 2023 09:45:08 +0000 (10:45 +0100)] 
dnsdist: Wait for the API port to be available before running the tests

14 months agovalidate: Stop passing shared pointers all the way down 12674/head
Remi Gacogne [Wed, 22 Mar 2023 16:55:42 +0000 (17:55 +0100)] 
validate: Stop passing shared pointers all the way down

14 months agoMerge pull request #12672 from omoerbeek/dnsheader-aligned
Otto Moerbeek [Wed, 22 Mar 2023 13:34:59 +0000 (14:34 +0100)] 
Merge pull request #12672 from omoerbeek/dnsheader-aligned

rec and dnsdist: fix a dnsheader unaligned case

14 months agoContinue processing records after OPT in ageDNSPacket() 12672/head
Otto Moerbeek [Wed, 22 Mar 2023 10:04:13 +0000 (11:04 +0100)] 
Continue processing records after OPT in ageDNSPacket()

14 months agoMerge pull request #12664 from rgacogne/auth-svcb-race-copy-const
Remi Gacogne [Wed, 22 Mar 2023 09:17:10 +0000 (10:17 +0100)] 
Merge pull request #12664 from rgacogne/auth-svcb-race-copy-const

DNSRecord: Ensure that the content can be read or replaced, not edited

14 months agoAnother case of too early API access
Otto Moerbeek [Tue, 21 Mar 2023 16:07:46 +0000 (17:07 +0100)] 
Another case of too early API access

14 months agorec and dnsdist: fix a case of potential unaligned header access
Otto Moerbeek [Tue, 21 Mar 2023 12:34:35 +0000 (13:34 +0100)] 
rec and dnsdist: fix a case of potential unaligned header access

I addded an argument to ageDNSPacket to circumvent having to do it in
two places in rec.

I am also wondering if the break in ageDNSPakcet() is right.
I suspect we want to continue with other records even if we see an OPT
(which does not *have* to be the last as far as I know)

14 months agoMerge pull request #12661 from Habbie/auth-4.8.0-alpha1-docs
Peter van Dijk [Tue, 21 Mar 2023 13:56:38 +0000 (14:56 +0100)] 
Merge pull request #12661 from Habbie/auth-4.8.0-alpha1-docs

auth-4.8.0-alpha1: secpoll&docs

14 months agoMerge pull request #12627 from Habbie/ubuntu-lunar
Peter van Dijk [Tue, 21 Mar 2023 12:34:03 +0000 (13:34 +0100)] 
Merge pull request #12627 from Habbie/ubuntu-lunar

add ubuntu:lunar builder target and test it daily

14 months agoauth-4.8.0-alpha1: secpoll&docs 12661/head
Peter van Dijk [Fri, 17 Mar 2023 13:09:01 +0000 (14:09 +0100)] 
auth-4.8.0-alpha1: secpoll&docs

14 months agoAdd auth-48 to repo test script. 12668/head
Erik Winkels [Tue, 21 Mar 2023 09:28:13 +0000 (10:28 +0100)] 
Add auth-48 to repo test script.

14 months agoMerge pull request #12667 from omoerbeek/rec-test-notify-wait-for-api
Otto Moerbeek [Tue, 21 Mar 2023 08:39:26 +0000 (09:39 +0100)] 
Merge pull request #12667 from omoerbeek/rec-test-notify-wait-for-api

rec: Wait for the API to come alive before using it in notify test

14 months agoMerge pull request #12654 from Habbie/dnsdist-secpoll-ctime
Remi Gacogne [Tue, 21 Mar 2023 08:25:08 +0000 (09:25 +0100)] 
Merge pull request #12654 from Habbie/dnsdist-secpoll-ctime

dnsdist secpoll: explicitly include necessary ctime header for time_t

14 months agorec: Wait for the API to come alive before using it in notify test 12667/head
Otto Moerbeek [Mon, 20 Mar 2023 11:36:20 +0000 (12:36 +0100)] 
rec: Wait for the API to come alive before using it in notify test

14 months agoMerge pull request #12666 from Habbie/lmdb-bit-header auth-4.8.0-alpha1
Peter van Dijk [Mon, 20 Mar 2023 10:03:26 +0000 (11:03 +0100)] 
Merge pull request #12666 from Habbie/lmdb-bit-header

lmdb-safe: remove unused header, plus assert macro presence

14 months agolmdb-safe: remove unused header, plus assert macro presence 12666/head
Peter van Dijk [Mon, 20 Mar 2023 09:03:25 +0000 (10:03 +0100)] 
lmdb-safe: remove unused header, plus assert macro presence

14 months agoDNSRecord: Ensure that the content can be read or replaced, not edited 12664/head
Remi Gacogne [Thu, 16 Mar 2023 21:55:56 +0000 (22:55 +0100)] 
DNSRecord: Ensure that the content can be read or replaced, not edited

14 months agoMerge pull request #12546 from Habbie/auth-lmdb-schema-5
Peter van Dijk [Fri, 17 Mar 2023 15:29:17 +0000 (16:29 +0100)] 
Merge pull request #12546 from Habbie/auth-lmdb-schema-5

auth: LMDB schema version 5

14 months ago auth: Prevent a race during the processing of SVC auto-hints
Remi Gacogne [Thu, 16 Mar 2023 13:18:49 +0000 (14:18 +0100)] 
 auth: Prevent a race during the processing of SVC auto-hints

When `svc-autohints` is enabled, the content of SVCB and HTTPS records
is modified in `PacketHandler::doAdditionalProcessing()` to expand
the IPv4 and IPv6 with their actual values.
This causes an issue because the content of these records might be
shared between threads, via the record cache, and one thread could
be trying to read from the internal `std::set` while a second thread
is altering it, leading to a data race and possibly to memory corruption
and a crash.
This is correctly detected by TSAN:
```
WARNING: ThreadSanitizer: data race (pid=102795)
  Write of size 8 at 0x7b3400010350 by thread T33:
    #0 operator delete(void*) <null> (pdns_server+0x211b7c) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #1 std::__new_allocator<std::_Rb_tree_node<SvcParam>>::deallocate(std::_Rb_tree_node<SvcParam>*, unsigned long) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/new_allocator.h:158:2 (pdns_server+0x33fc78) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #2 std::allocator_traits<std::allocator<std::_Rb_tree_node<SvcParam>>>::deallocate(std::allocator<std::_Rb_tree_node<SvcParam>>&, std::_Rb_tree_node<SvcParam>*, unsigned long) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/alloc_traits.h:496:13 (pdns_server+0x33fc78)
    #3 std::_Rb_tree<SvcParam, SvcParam, std::_Identity<SvcParam>, std::less<SvcParam>, std::allocator<SvcParam>>::_M_put_node(std::_Rb_tree_node<SvcParam>*) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/stl_tree.h:565:9 (pdns_server+0x33fc78)
    #4 std::_Rb_tree<SvcParam, SvcParam, std::_Identity<SvcParam>, std::less<SvcParam>, std::allocator<SvcParam>>::_M_drop_node(std::_Rb_tree_node<SvcParam>*) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/stl_tree.h:632:2 (pdns_server+0x33fc78)
    #5 std::_Rb_tree<SvcParam, SvcParam, std::_Identity<SvcParam>, std::less<SvcParam>, std::allocator<SvcParam>>::_M_erase_aux(std::_Rb_tree_const_iterator<SvcParam>) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/stl_tree.h:2495:7 (pdns_server+0x33fc78)
    #6 std::_Rb_tree<SvcParam, SvcParam, std::_Identity<SvcParam>, std::less<SvcParam>, std::allocator<SvcParam>>::erase[abi:cxx11](std::_Rb_tree_const_iterator<SvcParam>) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/stl_tree.h:1197:2 (pdns_server+0x33fc78)
    #7 std::set<SvcParam, std::less<SvcParam>, std::allocator<SvcParam>>::erase[abi:cxx11](std::_Rb_tree_const_iterator<SvcParam>) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/stl_set.h:655:21 (pdns_server+0x33fc78)
    #8 SVCBBaseRecordContent::setHints(SvcParam::SvcParamKey const&, std::vector<ComboAddress, std::allocator<ComboAddress>> const&) /work/pdns/pdns/dnsrecords.cc:768:14 (pdns_server+0x33fc78)
    #9 PacketHandler::doAdditionalProcessing(DNSPacket&, std::unique_ptr<DNSPacket, std::default_delete<DNSPacket>>&) /work/pdns/pdns/packethandler.cc:565:16 (pdns_server+0x4ed330) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #10 PacketHandler::doQuestion(DNSPacket&) /work/pdns/pdns/packethandler.cc:1794:5 (pdns_server+0x4f79b4) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    PowerDNS#11 PacketHandler::question(DNSPacket&) /work/pdns/pdns/packethandler.cc:1175:10 (pdns_server+0x4f649a) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    PowerDNS#12 MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::distribute(int) /work/pdns/pdns/./distributor.hh:220:14 (pdns_server+0x260f70) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    PowerDNS#13 MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()::operator()() const /work/pdns/pdns/./distributor.hh:179:25 (pdns_server+0x260b31) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    PowerDNS#14 void std::__invoke_impl<void, MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>(std::__invoke_other, MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:61:14 (pdns_server+0x260b31)
    PowerDNS#15 std::__invoke_result<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>::type std::__invoke<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>(MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:96:14 (pdns_server+0x260b31)
    PowerDNS#16 void std:thread:_Invoker<std::tuple<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>>::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:258:13 (pdns_server+0x260b31)
    PowerDNS#17 std:thread:_Invoker<std::tuple<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>>::operator()() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:265:11 (pdns_server+0x260b31)
    PowerDNS#18 std:thread:_State_impl<std:thread:_Invoker<std::tuple<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>>>::_M_run() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:210:13 (pdns_server+0x260b31)
    PowerDNS#19 execute_native_thread_routine /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:82:18 (libstdc++.so.6+0xd72c2) (BuildId: 6fe66a2d539a78c993bd2d377e00fad389220963)

  Previous read of size 2 at 0x7b3400010350 by thread T39:
    #0 SvcParam::getKey() const /work/pdns/pdns/./svc-records.hh:80:12 (pdns_server+0x3721f3) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #1 GenericDNSPacketWriter<std::vector<unsigned char, std::allocator<unsigned char>>>::xfrSvcParamKeyVals(std::set<SvcParam, std::less<SvcParam>, std::allocator<SvcParam>> const&) /work/pdns/pdns/dnswriter.cc:404:23 (pdns_server+0x3721f3)
    #2 void HTTPSRecordContent::xfrPacket<GenericDNSPacketWriter<std::vector<unsigned char, std::allocator<unsigned char>>>>(GenericDNSPacketWriter<std::vector<unsigned char, std::allocator<unsigned char>>>&, bool) /work/pdns/pdns/dnsrecords.cc:348:1 (pdns_server+0x3349bd) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #3 HTTPSRecordContent::toPacket(GenericDNSPacketWriter<std::vector<unsigned char, std::allocator<unsigned char>>>&) /work/pdns/pdns/dnsrecords.cc:348:1 (pdns_server+0x3349bd)
    #4 DNSRecordContent::serialize[abi:cxx11](DNSName const&, bool, bool) /work/pdns/pdns/./dnsparser.hh:215:11 (pdns_server+0x311140) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #5 DNSPacket::addRecord(DNSZoneRecord&&) /work/pdns/pdns/dnspacket.cc:177:68 (pdns_server+0x2fa894) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #6 PacketHandler::doAdditionalProcessing(DNSPacket&, std::unique_ptr<DNSPacket, std::default_delete<DNSPacket>>&) /work/pdns/pdns/packethandler.cc:542:8 (pdns_server+0x4eccf2) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #7 PacketHandler::doQuestion(DNSPacket&) /work/pdns/pdns/packethandler.cc:1794:5 (pdns_server+0x4f79b4) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #8 PacketHandler::question(DNSPacket&) /work/pdns/pdns/packethandler.cc:1175:10 (pdns_server+0x4f649a) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #9 MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::distribute(int) /work/pdns/pdns/./distributor.hh:220:14 (pdns_server+0x260f70) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #10 MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()::operator()() const /work/pdns/pdns/./distributor.hh:179:25 (pdns_server+0x260b31) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    PowerDNS#11 void std::__invoke_impl<void, MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>(std::__invoke_other, MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:61:14 (pdns_server+0x260b31)
    PowerDNS#12 std::__invoke_result<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>::type std::__invoke<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>(MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:96:14 (pdns_server+0x260b31)
    PowerDNS#13 void std:thread:_Invoker<std::tuple<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>>::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:258:13 (pdns_server+0x260b31)
    PowerDNS#14 std:thread:_Invoker<std::tuple<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>>::operator()() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:265:11 (pdns_server+0x260b31)
    PowerDNS#15 std:thread:_State_impl<std:thread:_Invoker<std::tuple<MultiThreadDistributor<DNSPacket, DNSPacket, PacketHandler>::MultiThreadDistributor(int)::'lambda'()>>>::_M_run() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:210:13 (pdns_server+0x260b31)
    PowerDNS#16 execute_native_thread_routine /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:82:18 (libstdc++.so.6+0xd72c2) (BuildId: 6fe66a2d539a78c993bd2d377e00fad389220963)

  Thread T33 'pdns/distributo' (tid=102833, running) created by thread T17 at:
    #0 pthread_create <null> (pdns_server+0x1904e6) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #1 __gthread_create /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663:35 (libstdc++.so.6+0xd73a9) (BuildId: 6fe66a2d539a78c993bd2d377e00fad389220963)
    #2 std:thread:_M_start_thread(std::unique_ptr<std:thread:_State, std::default_delete<std:thread:_State>>, void (*)()) /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:147:37 (libstdc++.so.6+0xd73a9)
    #3 Distributor<DNSPacket, DNSPacket, PacketHandler>::Create(int) /work/pdns/pdns/./distributor.hh:134:18 (pdns_server+0x256d23) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #4 qthread(unsigned int) /work/pdns/pdns/auth-main.cc:536:25 (pdns_server+0x256d23)
    #5 void std::__invoke_impl<void, void (*)(unsigned int), unsigned int>(std::__invoke_other, void (*&&)(unsigned int), unsigned int&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:61:14 (pdns_server+0x2635f0) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #6 std::__invoke_result<void (*)(unsigned int), unsigned int>::type std::__invoke<void (*)(unsigned int), unsigned int>(void (*&&)(unsigned int), unsigned int&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:96:14 (pdns_server+0x2635f0)
    #7 void std:thread:_Invoker<std::tuple<void (*)(unsigned int), unsigned int>>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:258:13 (pdns_server+0x2635f0)
    #8 std:thread:_Invoker<std::tuple<void (*)(unsigned int), unsigned int>>::operator()() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:265:11 (pdns_server+0x2635f0)
    #9 std:thread:_State_impl<std:thread:_Invoker<std::tuple<void (*)(unsigned int), unsigned int>>>::_M_run() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:210:13 (pdns_server+0x2635f0)
    #10 execute_native_thread_routine /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:82:18 (libstdc++.so.6+0xd72c2) (BuildId: 6fe66a2d539a78c993bd2d377e00fad389220963)

  Thread T39 'pdns/distributo' (tid=102837, running) created by thread T19 at:
    #0 pthread_create <null> (pdns_server+0x1904e6) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #1 __gthread_create /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663:35 (libstdc++.so.6+0xd73a9) (BuildId: 6fe66a2d539a78c993bd2d377e00fad389220963)
    #2 std:thread:_M_start_thread(std::unique_ptr<std:thread:_State, std::default_delete<std:thread:_State>>, void (*)()) /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:147:37 (libstdc++.so.6+0xd73a9)
    #3 Distributor<DNSPacket, DNSPacket, PacketHandler>::Create(int) /work/pdns/pdns/./distributor.hh:134:18 (pdns_server+0x256d23) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #4 qthread(unsigned int) /work/pdns/pdns/auth-main.cc:536:25 (pdns_server+0x256d23)
    #5 void std::__invoke_impl<void, void (*)(unsigned int), unsigned int>(std::__invoke_other, void (*&&)(unsigned int), unsigned int&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:61:14 (pdns_server+0x2635f0) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593)
    #6 std::__invoke_result<void (*)(unsigned int), unsigned int>::type std::__invoke<void (*)(unsigned int), unsigned int>(void (*&&)(unsigned int), unsigned int&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:96:14 (pdns_server+0x2635f0)
    #7 void std:thread:_Invoker<std::tuple<void (*)(unsigned int), unsigned int>>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:258:13 (pdns_server+0x2635f0)
    #8 std:thread:_Invoker<std::tuple<void (*)(unsigned int), unsigned int>>::operator()() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:265:11 (pdns_server+0x2635f0)
    #9 std:thread:_State_impl<std:thread:_Invoker<std::tuple<void (*)(unsigned int), unsigned int>>>::_M_run() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:210:13 (pdns_server+0x2635f0)
    #10 execute_native_thread_routine /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:82:18 (libstdc++.so.6+0xd72c2) (BuildId: 6fe66a2d539a78c993bd2d377e00fad389220963)

SUMMARY: ThreadSanitizer: data race (/work/pdns-rgacogne/pdns/pdns_server+0x211b7c) (BuildId: 384adc19a67695435bd5e89d0a77f562561f4593) in operator delete(void*)
```

To prevent this issue, this commit clones the content of SVCB/HTTPS
records before modifying the copy. the drawback is that we need to
do this operation every single time we process them.

14 months agoformat 12546/head
Peter van Dijk [Fri, 17 Mar 2023 13:51:45 +0000 (14:51 +0100)] 
format

14 months agocleanup
Peter van Dijk [Fri, 17 Mar 2023 13:51:21 +0000 (14:51 +0100)] 
cleanup

14 months agostring_view
Peter van Dijk [Fri, 17 Mar 2023 13:46:38 +0000 (14:46 +0100)] 
string_view

14 months agoApply suggestions from code review
Peter van Dijk [Fri, 17 Mar 2023 13:33:26 +0000 (14:33 +0100)] 
Apply suggestions from code review

Co-authored-by: Remi Gacogne <github@coredump.fr>
14 months agoUpdate ext/lmdb-safe/lmdb-safe.cc
Peter van Dijk [Fri, 17 Mar 2023 13:29:03 +0000 (14:29 +0100)] 
Update ext/lmdb-safe/lmdb-safe.cc

Co-authored-by: Remi Gacogne <github@coredump.fr>
14 months agoUpdate ext/lmdb-safe/lmdb-safe.cc
Peter van Dijk [Fri, 17 Mar 2023 13:28:46 +0000 (14:28 +0100)] 
Update ext/lmdb-safe/lmdb-safe.cc

Co-authored-by: Remi Gacogne <github@coredump.fr>
14 months agoUpdate ext/lmdb-safe/lmdb-safe.cc
Peter van Dijk [Fri, 17 Mar 2023 13:28:26 +0000 (14:28 +0100)] 
Update ext/lmdb-safe/lmdb-safe.cc

Co-authored-by: Remi Gacogne <github@coredump.fr>
14 months agoMerge pull request #12660 from omoerbeek/rec-regr-threads-pc
Otto Moerbeek [Fri, 17 Mar 2023 12:31:00 +0000 (13:31 +0100)] 
Merge pull request #12660 from omoerbeek/rec-regr-threads-pc

rec: Start using multiple threads in regression tests and enable packetcache

14 months agocleanup
Peter van Dijk [Fri, 17 Mar 2023 12:23:50 +0000 (13:23 +0100)] 
cleanup

14 months agoavoid char signedness trap
Peter van Dijk [Fri, 17 Mar 2023 12:23:46 +0000 (13:23 +0100)] 
avoid char signedness trap

14 months agoformat
Peter van Dijk [Fri, 17 Mar 2023 11:18:10 +0000 (12:18 +0100)] 
format

14 months agouse &
Peter van Dijk [Fri, 17 Mar 2023 10:59:27 +0000 (11:59 +0100)] 
use &

14 months agoavoid one unaligned uint16_t access
Peter van Dijk [Fri, 17 Mar 2023 10:57:26 +0000 (11:57 +0100)] 
avoid one unaligned uint16_t access

14 months agoremove unused (and unsafe) methods
Peter van Dijk [Fri, 17 Mar 2023 10:55:59 +0000 (11:55 +0100)] 
remove unused (and unsafe) methods

14 months agopush declarations down
Peter van Dijk [Fri, 17 Mar 2023 10:55:44 +0000 (11:55 +0100)] 
push declarations down

14 months agoPrevent data race by initing NOD protobuf tag values not in the NOD threads but in... 12660/head
Otto Moerbeek [Fri, 17 Mar 2023 10:35:55 +0000 (11:35 +0100)] 
Prevent data race by initing NOD protobuf tag values not in the NOD threads but in the main thread

14 months agocleanup
Peter van Dijk [Fri, 17 Mar 2023 10:33:56 +0000 (11:33 +0100)] 
cleanup

14 months agoenforce val size
Peter van Dijk [Fri, 17 Mar 2023 10:33:28 +0000 (11:33 +0100)] 
enforce val size

14 months agobe explicit about sizeof(T)
Peter van Dijk [Fri, 17 Mar 2023 10:23:43 +0000 (11:23 +0100)] 
be explicit about sizeof(T)

14 months agoremove redundant include
Peter van Dijk [Fri, 17 Mar 2023 10:16:27 +0000 (11:16 +0100)] 
remove redundant include

14 months agoUpdate ext/lmdb-safe/lmdb-safe.hh
Peter van Dijk [Fri, 17 Mar 2023 10:21:46 +0000 (11:21 +0100)] 
Update ext/lmdb-safe/lmdb-safe.hh

Co-authored-by: Remi Gacogne <github@coredump.fr>
14 months agoUpdate ext/lmdb-safe/lmdb-typed.hh
Peter van Dijk [Fri, 17 Mar 2023 10:13:49 +0000 (11:13 +0100)] 
Update ext/lmdb-safe/lmdb-typed.hh

Co-authored-by: Remi Gacogne <github@coredump.fr>
14 months agoUpdate ext/lmdb-safe/lmdb-typed.hh
Peter van Dijk [Fri, 17 Mar 2023 10:13:37 +0000 (11:13 +0100)] 
Update ext/lmdb-safe/lmdb-typed.hh

Co-authored-by: Remi Gacogne <github@coredump.fr>
14 months agoUpdate ext/lmdb-safe/lmdb-safe.hh
Peter van Dijk [Fri, 17 Mar 2023 10:13:12 +0000 (11:13 +0100)] 
Update ext/lmdb-safe/lmdb-safe.hh

Co-authored-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
14 months agoUpdate ext/lmdb-safe/lmdb-safe.cc
Peter van Dijk [Fri, 17 Mar 2023 10:11:49 +0000 (11:11 +0100)] 
Update ext/lmdb-safe/lmdb-safe.cc

Co-authored-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
14 months agorec: Start using multiple threads in regression tests and enable packetcache
Otto Moerbeek [Fri, 17 Mar 2023 09:57:35 +0000 (10:57 +0100)] 
rec: Start using multiple threads in regression tests and enable packetcache

Only two tests needed fixes.

14 months agoformat
Peter van Dijk [Fri, 17 Mar 2023 09:15:02 +0000 (10:15 +0100)] 
format

14 months agoreinstate lmdb-schema-version setting
Peter van Dijk [Fri, 17 Mar 2023 09:12:47 +0000 (10:12 +0100)] 
reinstate lmdb-schema-version setting

14 months agoremove pdnsutil lmdb-get-schema-version, it breaks building with dynmodule lmdb
Peter van Dijk [Fri, 17 Mar 2023 09:09:19 +0000 (10:09 +0100)] 
remove pdnsutil lmdb-get-schema-version, it breaks building with dynmodule lmdb

14 months agonote number of DBIs required
Peter van Dijk [Fri, 17 Mar 2023 08:53:06 +0000 (09:53 +0100)] 
note number of DBIs required