Commit Graph

35087 Commits

Author SHA1 Message Date
Tom Krizek
e2eca8a8a9 Merge branch 'tkrizek/danger-improvements-v9_16' into 'v9_16'
[9.16] danger: refine existing rules

See merge request isc-projects/bind9!7436
2023-01-27 14:09:33 +00:00
Tom Krizek
1ee31187db danger: relax rules for single-line commits
The following are not also accepted as single-line commits without
generating warnings:
- CHANGES/release note may appear in the beginning of the commit message
- Release note may be capitalized
- Allow commits with "GL #" (e.g. Update documentation for [GL #XXXX])

(cherry picked from commit 79ae467973)
2023-01-27 14:50:14 +01:00
Tom Krizek
1bc4186e39 danger: update CHANGES rule to work with -S edition
When updating the -S edition, the CHANGES.SE file is modified. Make sure
danger accepts that.

(cherry picked from commit 1939e585c0)
2023-01-27 14:50:08 +01:00
Michał Kępień
f469580296 Merge branch 'michal/extend-artifact-lifetime-for-release-related-jobs-v9_16' into 'v9_16'
[9.16] Extend artifact lifetime for release-related jobs

See merge request isc-projects/bind9!7434
2023-01-27 12:33:38 +00:00
Michał Kępień
fc0f691c5b Extend artifact lifetime for release-related jobs
Artifacts of the "stress" jobs in GitLab CI are used for generating the
QA summary for a given set of releases.  It happened in the past that
these artifacts were purged before the QA summary was prepared,
unnecessarily prolonging the release process.  A complete set of
artifacts from all such jobs for a single pipeline should be less than 1
GB in size, so extend their lifetime from one day to one week as a more
reasonable compromise between availability and disk space usage.  (Note:
these jobs are also run in scheduled pipelines, but that is expected to
be acceptable in the context of artifact lifetime.)

Artifacts of the "release" jobs in GitLab CI are what we eventually
publish on the FTP server.  It happened in the past that these artifacts
were purged before we copied them to their destination, unnecessarily
prolonging the release process, even though we usually press the "Keep"
button for the "release" jobs manually to keep them around indefinitely
(as they are the source of what we publish in other places).  Since
there is only one "release" job per tag pipeline and its artifacts only
take up tens of megabytes of space, keep the artifacts of the "release"
jobs around indefinitely by default.

(cherry picked from commit 71c9d69145)
2023-01-27 13:30:46 +01:00
Michał Kępień
7b0e57095a Merge tag 'v9_16_37' into v9_16
BIND 9.16.37
2023-01-25 21:34:55 +01:00
Mark Andrews
1c80708561 Merge branch '3799-tsan-race-between-dns_rbtnode_t-bitfields-v9_16' into 'v9_16'
[9.16] Add missing node lock when setting node->wild in rbtdb.c

See merge request isc-projects/bind9!7415
2023-01-19 14:13:13 +00:00
Mark Andrews
89f287b538 Add CHANGES for [GL #3799]
(cherry picked from commit 5c471c5d2c)
2023-01-20 00:38:43 +11:00
Mark Andrews
b548ee5815 Add missing node lock when setting node->wild in rbtdb.c
The write node lock needs to be held when setting node->wild in
add_wildcard_magic except when being called from loading_addrdataset
which is used to load the zone without locking during its initial
load.

(cherry picked from commit 81c24b8da2)
2023-01-20 00:38:43 +11:00
Ondřej Surý
6c62088347 Merge branch '3252-repair-isc_task_purgeevent-v9_16' into 'v9_16'
[9.16] Keep the list of scheduled events on the timer

See merge request isc-projects/bind9!7400
2023-01-19 10:28:38 +00:00
Ondřej Surý
e5017090d7 Add CHANGES note for [GL #3252]
(cherry picked from commit a7cd0868a2)
2023-01-19 11:28:10 +01:00
Mark Andrews
363b40b1da Unlink the timer event before trying to purge it
as far as I can determine the order of operations is not important.

    *** CID 351372:  Concurrent data access violations  (ATOMICITY)
    /lib/isc/timer.c: 227 in timer_purge()
    221     		LOCK(&timer->lock);
    222     		if (!purged) {
    223     			/*
    224     			 * The event has already been executed, but not
    225     			 * yet destroyed.
    226     			 */
    >>>     CID 351372:  Concurrent data access violations  (ATOMICITY)
    >>>     Using an unreliable value of "event" inside the second locked section. If the data that "event" depends on was changed by another thread, this use might be incorrect.
    227     			timerevent_unlink(timer, event);
    228     		}
    229     	}
    230     }
    231
    232     void

(cherry picked from commit 98718b3b4b)
2023-01-19 11:28:10 +01:00
Ondřej Surý
e241a3f4db Don't use reference counting in isc_timer unit
The reference counting and isc_timer_attach()/isc_timer_detach()
semantic are actually misleading because it cannot be used under normal
conditions.  The usual conditions under which is timer used uses the
object where timer is used as argument to the "timer" itself.  This
means that when the caller is using `isc_timer_detach()` it needs the
timer to stop and the isc_timer_detach() does that only if this would be
the last reference.  Unfortunately, this also means that if the timer is
attached elsewhere and the timer is fired it will most likely be
use-after-free, because the object used in the timer no longer exists.

Remove the reference counting from the isc_timer unit, remove
isc_timer_attach() function and rename isc_timer_detach() to
isc_timer_destroy() to better reflect how the API needs to be used.

The only caveat is that the already executed event must be destroyed
before the isc_timer_destroy() is called because the timer is no longet
attached to .ev_destroy_arg.

(cherry picked from commit ae01ec2823)
2023-01-19 11:28:10 +01:00
Ondřej Surý
3cf7055286 Set quantum to infinity for the zone loading task
When we are loading the zones, set the quantum to UINT_MAX, which makes
task_run process all tasks at once.  After the zone loading is finished
the quantum will be dropped to 1 to not block server when we are loading
new zones after reconfiguration.

(cherry picked from commit 87c4c24cde)
2023-01-19 11:28:10 +01:00
Ondřej Surý
7fef8e77d6 Add isc_task_setquantum() and use it for post-init zone loading
Add isc_task_setquantum() function that modifies quantum for the future
isc_task_run() invocations.

NOTE: The current isc_task_run() caches the task->quantum into a local
variable and therefore the current event loop is not affected by any
quantum change.

(cherry picked from commit 15ea6f002f)
2023-01-19 11:28:10 +01:00
Ondřej Surý
617186d514 Keep the list of scheduled events on the timer
Instead of searching for the events to purge, keep the list of scheduled
events on the timer list and purge the events that we have scheduled.

(cherry picked from commit 3f8024b4a2f12fcd28a9dd813b6f1f3f11d506f2)
2023-01-19 11:28:10 +01:00
Ondřej Surý
76859344fe Repair isc_task_purgeevent()
The isc_task_purgerange() was walking through all events on the task to
find a matching task.  Instead use the ISC_LINK_LINKED to find whether
the event is active.

(cherry picked from commit 17aed2f895)
2023-01-19 11:28:10 +01:00
Ondřej Surý
6efd8d5faf Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach-lock-order-inversion-v9_16' into 'v9_16'
[9.16] Detach the zone views outside of the zone lock

See merge request isc-projects/bind9!7409
2023-01-19 10:15:40 +00:00
Ondřej Surý
4b222f154b Detach the zone views outside of the zone lock
Detaching the views in the zone_shutdown() could lead to
lock-order-inversion between adb->namelocks[bucket], adb->lock,
view->lock and zone->lock.  Detach the views outside of the section that
zone-locked.

(cherry picked from commit 978a0ef84c)
2023-01-19 10:21:27 +01:00
Ondřej Surý
93082bd010 Merge branch 'ondrej/replace-lgtm-with-codeql-add-python-ply-v9_16' into 'v9_16'
[9.16] Add python3-ply for ./configure to succeed on BIND 9.16 branch

See merge request isc-projects/bind9!7407
2023-01-19 09:17:40 +00:00
Ondřej Surý
60d43925b3 Add python3-ply to GitHub CodeQL configuration
BIND 9.16 needs Python and PLY packages for configure to succeed.
Unless we want to tweak the build script to exclude python, we need to
add python3-ply package to the CodeQL configuration.

(cherry picked from commit 0622d11366)
2023-01-19 10:12:12 +01:00
Ondřej Surý
c6bb1c93a2 Merge branch 'ondrej/replace-lgtm-with-codeql-v9_16' into 'v9_16'
[9.16] Add CodeQL GitHub Action

See merge request isc-projects/bind9!7404
2023-01-19 08:46:54 +00:00
Ondřej Surý
dfe2f2120a Add CodeQL GitHub Action
Replace the decommissioned LGTM service with CodeQL GitHub action.

(cherry picked from commit 77abe612a1)
2023-01-19 08:46:50 +00:00
Ondřej Surý
ef27382794 Merge branch '3795-speed-up-EVP_DigestInit_ex-v9_16' into 'v9_16'
[9.16] Avoid implicit algorithm fetch for OpenSSL EVP_MD family

See merge request isc-projects/bind9!7399
2023-01-19 08:33:40 +00:00
Ondřej Surý
74b74dacd2 Add CHANGES and release note for [GL #3795]
(cherry picked from commit 401294cf60)
2023-01-18 23:26:40 +01:00
Ondřej Surý
49af3a23b9 Use OpenSSL 1.x SHA_CTX API in isc_iterated_hash()
Instead of going through another layer, use OpenSSL SHA1 API directly
in the isc_iterated_hash() implementation.

(cherry picked from commit 25db8d0103)
2023-01-18 23:26:40 +01:00
Ondřej Surý
abb367615c Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach-v9_16' into 'v9_16'
[9.16] Detach the views in zone_shutdown(), not in zone_free()

See merge request isc-projects/bind9!7389
2023-01-17 22:23:09 +00:00
Ondřej Surý
1177891f9c Add CHANGES and release note for [GL #3801]
(cherry picked from commit b049e329ef)
2023-01-17 22:49:14 +01:00
Ondřej Surý
235ce6c888 Commit the change of view for view->managed_keys
When we change the view in the view->managed_keys, we never commit the
change, keeping the previous view possibly attached forever.

Call the dns_zone_setviewcommit() immediately after changing the view as
we are detaching the previous view anyway and there's no way to recover
from that.

(cherry picked from commit 7e8b53720d)
2023-01-17 22:48:37 +01:00
Ondřej Surý
cb083876c1 Detach the views in zone_shutdown(), not in zone_free()
The .view (and possibly .prev_view) would be kept attached to the
removed zone until the zone is fully removed from the memory in
zone_free().  If this process is delayed because server is busy
something else like doing constant `rndc reconfig`, it could take
seconds to detach the view, possibly keeping multiple dead views in the
memory.  This could quickly lead to a massive memory bloat.

Release the views early in the zone_shutdown() call, and don't wait
until the zone is freed.

(cherry picked from commit 13bb821280)
2023-01-17 22:48:37 +01:00
Tom Krizek
55545b8377 Merge branch '3804-fix-feature-detection-in-pytests-v9_16' into 'v9_16'
[9.16] Fix feature detection for pytest markers in tests

See merge request isc-projects/bind9!7384
2023-01-17 14:14:49 +00:00
Tom Krizek
7139e297b2 Fix feature detection for pytest markers in tests
The condition was accidentally reversed during refactoring in
9730ac4c56 . It would result in skipped
tests on builds with proper support and false negatives on builds
without proper feature support.

Credit for reporting the issue and the fix goes to Stanislav Levin.

(cherry picked from commit 473cb530f4)
2023-01-17 14:49:38 +01:00
Ondřej Surý
ff48b58a1d Merge branch 'cherry-pick-d7bcdf8b-2' into 'v9_16'
[9.16] Merge branch 'feature/main/zt-rwlock.h' into 'main'

See merge request isc-projects/bind9!7378
2023-01-16 11:10:11 +00:00
Ondřej Surý
606fc6d4aa Merge branch 'feature/main/zt-rwlock.h' into 'main'
Include isc_rwlocktype_t type definition in zt.h

See merge request isc-projects/bind9!7376

(cherry picked from commit d7bcdf8bd6)

395d6fca Include isc_rwlocktype_t type definition in zt.h
2023-01-16 11:08:43 +00:00
Michał Kępień
4a30ced1cb Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.38' into 'v9_16'
Set up version and release notes for BIND 9.16.38

See merge request isc-projects/bind9!7364
2023-01-13 14:47:09 +00:00
Michał Kępień
7db230d6bf Set up release notes for BIND 9.16.38 2023-01-13 15:41:30 +01:00
Michał Kępień
265dbeb3f2 Update BIND version to 9.16.38-dev 2023-01-13 15:41:30 +01:00
Michał Kępień
2b2afb28ab Merge branch 'prep-release' into security-v9_16 v9.16.37 2023-01-12 23:45:02 +01:00
Michał Kępień
de338feb9b prep 9.16.37 2023-01-12 23:44:53 +01:00
Michał Kępień
5aca4eb3c4 Merge branch 'michal/prepare-documentation-for-bind-9.16.37' into 'security-v9_16'
Prepare documentation for BIND 9.16.37

See merge request isc-private/bind9!494
2023-01-12 22:43:27 +00:00
Michał Kępień
0fc6b76870 Add release note for GL #3744 2023-01-12 22:34:32 +01:00
Michał Kępień
d048f6d5f0 Add release note for GL #3678 2023-01-12 22:34:32 +01:00
Michał Kępień
28c04575f1 Tweak and reword release notes 2023-01-12 22:34:32 +01:00
Michał Kępień
f76d95cdbb Prepare release notes for BIND 9.16.37 2023-01-12 22:34:32 +01:00
Michał Kępień
7ce861864d Fix a typo in the DNSSEC Guide 2023-01-12 22:34:32 +01:00
Michał Kępień
b4a65aaea1 Merge branch '3619-security-serve-stale-client-timeout-crash-v9_16' into 'security-v9_16'
[9.16] [CVE-2022-3924] Fix the serve-stale crash when recursive clients soft quota is reached

See merge request isc-private/bind9!479
2023-01-12 12:05:11 +00:00
Aram Sargsyan
8a05a6d1d7 Add CHANGES and release notes for [GL #3619]
(cherry picked from commit d08a478b42)
2023-01-12 13:00:03 +01:00
Aram Sargsyan
6bebcedb80 Cancel all fetch events in dns_resolver_cancelfetch()
Although 'dns_fetch_t' fetch can have two associated events, one for
each of 'DNS_EVENT_FETCHDONE' and 'DNS_EVENT_TRYSTALE' types, the
dns_resolver_cancelfetch() function is designed in a way that it
expects only one existing event, which it must cancel, and when it
happens so that 'stale-answer-client-timeout' is enabled and there
are two events, only one of them is canceled, and it results in an
assertion in dns_resolver_destroyfetch(), when it finds a dangling
event.

Change the logic of dns_resolver_cancelfetch() function so that it
cancels both the events (if they exist), and in the right order.

(cherry picked from commit ec2098ca35)
2023-01-12 13:00:03 +01:00
Michał Kępień
ea79385990 Merge branch '3622-serve-stale-rrsig-fix-security-v9_16' into 'security-v9_16'
[9.16] [CVE-2022-3736] Properly handle stale RRSIG lookups

See merge request isc-private/bind9!486
2023-01-12 11:39:34 +00:00
Mark Andrews
8309e2656c Add release note for [GL #3622]
(cherry picked from commit 42c42be9a9)
2023-01-12 12:33:28 +01:00