Commit Graph

98 Commits

Author SHA1 Message Date
Petr Menšík
4f18fb958f Add sysusers named user creation (rhbz#2105415)
Drop original user creating in favor of sysusers file definition.

(cherry picked from commit 071ec07d27989a8d548834292fa46ca2312b4862)
(cherry picked from commit efb20ad8e7)

Resolves: RHEL-135629
2025-12-17 14:41:57 +01:00
Petr Menšík
f17cf87212 Create /var/named directories for bind-chroot
Fixes bind-chroot in Image Mode. Include even subdirectories.

Resolves: RHEL-135629
2025-12-12 21:26:55 +01:00
Petr Menšík
cae911494f Copy named.* into /usr/share/named
Imagemode might have separate /var partition not properly initialized by
package installation. Add creation of compat files into tmpfiles.d
definition.

Make copies of those files from /var/named to /usr/shared/named, so we
even have some place to symlink them from. Originally it had only copy
in sample documentation, which may not be installed.

These source file should be read-only from named and not modified
anyway. Move them to /usr/share/named as read-only, always present
sources. Make symlinks in /var/named to point to them only when files
are missing.

To maximize backward compatibility, make copies and avoid replacing
those files with symlinks.

Resolves: RHEL-122168
2025-12-01 19:50:50 +01:00
Petr Menšík
6b33345a14 Address various spoofing attacks (CVE-2025-40778)
https://kb.isc.org/docs/cve-2025-40778

Replace our downstream backports with upstream 9.16 patches

aba2fa7e35

Resolves: RHEL-123323
2025-11-10 19:10:54 +01:00
Petr Menšík
8f4b62a54d Prevent cache poisoning due to weak PRNG (CVE-2025-40780)
https://kb.isc.org/docs/cve-2025-40780

Replace our downstream backports with upstream 9.16 patches

dd61449747

Resolves: RHEL-123323
2025-11-10 19:10:30 +01:00
psklenar@redhat.com
6f580e5a5e ci plans for rhel9 2025-10-14 12:03:41 +02:00
Petr Menšík
9f410e2a2e Fix expectations on idna system test
IDNA tests always redirect output into the file. That means its
behaviour has changed and is now processing IDN input by default and
just disables IDN output by default.

New behaviour when redirected is the same as +idnin +noidnout, but does
not fail hard on input errors.

Resolves: RHEL-66172
2025-09-16 12:50:44 +02:00
Petr Menšík
4a05d2d777 logrotate: skip if empty and remove old variants
Many variants are never built anymore. Clean actions to just those still
shipped. But do not trigger named reload when named.run file is empty.
That is common on freeipa installation, where configuration changes
logging to put it elsewhere. named reload is disruptive because how
bind-dyndb-ldap behaves during reloads. Avoid unnecessary reloads with
visible service disruption.

Keep named-pkcs11 reload variant.

Resolves: RHEL-113942
2025-09-12 15:41:21 +02:00
Petr Menšík
8f4a1161b8 Decode IDN names on input in all situations in utilities
Use the same name in dig or host utilities when stdout is not a
terminal. Until now it disabled IDN processing when stdout were not a
terminal. Disable just IDN output in that case and try to decode input
name with IDN. Keep failing in interactive sessions, but send even
undecoded name query when output is redirected.

That should limit new surprises and keep most of behaviour without
changes. But do not break in when input name failed to decode and
it were not trying to decode it before.

Resolves: RHEL-66172
2025-09-03 19:21:46 +02:00
Petr Menšík
adbc5d4315 Add runtime tunable limit for max additional records
NAMED_MAXADDITIONAL environment can change default limit of 13. Format
is just number of accepted NS, which will be processed for additional
records.

Resolves: RHEL-84006
2025-07-09 11:36:27 +02:00
Petr Menšík
76f8c8bbb5 Change additional NS to be served partially
When too many NS records are fetched from authoritative zone, limit
number of fetched additional records. Instead of not producing any
additional record when there is over 13 NS servers, limit number of
records for which those records would be fetched.

Resolves: RHEL-84006
2025-06-20 20:57:37 +02:00
Petr Mensik
1a2cdb3553 Add extra protections to places needing absolute names
Insert just potential protection in case Patch32 does not cover all
possible cases.

Resolves: RHEL-30407
2025-06-10 20:03:10 +02:00
Petr Mensik
bf3c76e9c3 Prevent name.c:670: REQUIRE((name1->attributes & 0x00000001) == (name2->attributes & 0x00000001)) failed
resume_qmin did not handle special case of recursing query hit
unexpected DNS_R_CNAME result. Change result to SERVFAIL in case
of a zone loaded after the recursion started. That prevents crashing
later in query_setorder, where there is uninitialized foundname compared
with absolute order names.

https://gitlab.isc.org/isc-projects/bind9/-/issues/5357
Resolves: RHEL-30407
2025-06-10 20:03:10 +02:00
Petr Menšík
469e799820 Improve a bit ability to run testsuite from mockbuild
Intended to be run like:
centpkg mockbuild --with SYSTEMTEST -N --enable-network

Do fail when it does not pass. But allow running tests as root.

Related: RHEL-76884
2025-03-13 15:30:39 +01:00
Petr Menšík
e092ec92b8 Fix vulnerability test backport
Vulnerability: CVE-2024-11187
Resolves: RHEL-76884
2025-03-13 15:30:32 +01:00
Petr Menšík
fcee29f568 Limit the additional processing for large RDATA sets
When answering queries, don't add data to the additional section if
the answer has more than 13 names in the RDATA.  This limits the
number of lookups into the database(s) during a single client query,
reducing query processing load.

Also, don't append any additional data to type=ANY queries. The
answer to ANY is already big enough.

Vulnerability: CVE-2024-11187
Resolves: RHEL-76884
2025-03-13 15:30:25 +01:00
Petr Menšík
a1695fd72e Change patches applying to autopatch
RPM tools keep complaining about old-style patches applying with
%patchX. Avoid that by using autopatch from now on, applying all changes
sorted but patch number.

Related: RHEL-76884
2025-03-13 15:30:18 +01:00
Petr Menšík
152329ccea Bump version above RHEL 9.5
RHEL 9.5 build did not use z-stream rightmost bump. Make sure 9.6 has
higher version.

Resolves: RHEL-49900
2024-09-06 14:14:59 +02:00
Petr Menšík
585cc3f41a Minor fix of reclimit test backport
Fix local rebuilds on Fedora. BIND 9.16 does not work well with fortify
source level 3. Fix also DEFAULT_HMAC not properly set in tests, failing
reclimit test. That was issue only of backport.

Resolves: RHEL-49900
2024-08-27 22:33:14 +02:00
Petr Menšík
9f14cef3c2 Properly test also gsstsig upstream test
Disabled by mistake by downstream patch.

Related: RHEL-49900
2024-08-27 22:33:06 +02:00
Petr Menšík
45d01dade1 [9.16] chg: usr: Backport max-types-per-name to BIND 9.16
This aligns the fix for large number of RRs in RRSet with 9.18 and up
by backporting to `max-records-per-type` configuration option to
BIND 9.16.

Merge branch 'ondrej/max-types-per-rr-backport-9.16' into 'bind-9.16'

See merge request isc-projects/bind9!9178

Resolves: RHEL-49900
2024-08-27 22:32:58 +02:00
Petr Menšík
979a7d3a93 [9.16] chg: usr: Backport max-records-per-type to BIND 9.16
This aligns the fix for large number of RRs in RRSet with 9.18 and up
by backporting to `max-records-per-type` configuration option to
BIND 9.16.

Merge branch 'ondrej/max-records-per-type-backport-9.16' into 'bind-9.16'

See merge request isc-projects/bind9!9177

Remove also custom environment feature, which is not necessary with
proper config options backported.

Increase rightmost version to become higher than _4 suffix.

Resolves: RHEL-49900
2024-08-27 22:32:42 +02:00
Petr Menšík
7d262e3039 Allow runtime customization of CVE-2024-1737 limits
Do not introduce new options into configuration file. But if limits are
hit in unexpected way, allow tuning them by environment variables
DNS_RDATASET_MAX_RECORDS and DNS_RBTDB_MAX_RTYPES. They accept number of
maximum records of types. Both defaults to 100.

These replaces max-records-per-type and max-types-per-name in later
versions. But can be configured only by environment and can be
configured only globally, not in each view or zone.

Related: RHEL-49900
2024-08-27 22:32:21 +02:00
Petr Menšík
6a3f81b6a8 Resolve CVE-2024-4076
6403.	[security]	qctx-zversion was not being cleared when it should have
			been leading to an assertion failure if it needed to be
			reused. (CVE-2024-4076) [GL #4507]

Resolves: RHEL-49940
2024-08-27 22:30:26 +02:00
Petr Menšík
809898a212 Resolve CVE-2024-1737
6400.	[security]	Excessively large rdatasets can slow down database
			query processing, so a limit has been placed on the
			number of records that can be stored per rdataset
			in a cache or zone database. This is configured
			with the new "max-records-per-type" option, and
			defaults to 100. (CVE-2024-1737)
			[GL #497] [GL #3405]

6401.	[security]	An excessively large number of rrtypes per owner can
			slow down database query processing, so a limit has been
			placed on the number of rrtypes that can be stored per
			owner (node) in a cache or zone database. This is
			configured with the new "max-rrtypes-per-name" option,
			and defaults to 100. (CVE-2024-1737)
			[GL #3403] [GL #4548]

Does not change db methods like 9.18 fix. It makes limits set at build
time and fixed numbers, but does not need adjusting db interface to set
new limits.

Resolves: RHEL-49900
2024-08-27 22:29:25 +02:00
Petr Menšík
ad377f82ce Resolve CVE-2024-1975
6404.	[security]	Remove SIG(0) support from named as a countermeasure
			for CVE-2024-1975. [GL #4480]

Resolves: RHEL-50350
2024-08-27 22:27:20 +02:00
Petr Menšík
1cd66a1c12 Increase size of hazard pointer array
Extends even more change Downstream specific changes related to KeyTrap,
which added safety guards into hazard pointers. Because it seems they
are not still enough. Add fixed base to accomodate common threads like
main app thread and ldap worker threads. Multiply one more, just to be
sure. We do not want to hit maximal limit again.

Resolves: RHEL-39131
2024-07-09 16:36:12 +02:00
Petr Menšík
f8826d54eb Ensure bind CVE fixes hits public Stream repository
Builds were made, but did not hit public repositories. Errata for RHEL
were done before these could be published, but we need another errata
just for CentOS Stream.

Resolves: RHEL-25130 RHEL-25132  RHEL-25162 RHEL-25166 RHEL-25169 RHEL-25173
2024-05-28 20:00:46 +02:00
Petr Menšík
86862fc8d8 Fixes of CVE-2023-50387 and CVE-2023-50868 caused ABI change
Enforce updated rebuild is accepted only, conflict with older builds

; Related: CVE-2023-50387 CVE-2023-50868
Related: RHEL-25397 RHEL-25386
2024-04-16 21:26:11 +02:00
Petr Menšík
c3e15c4a64 Stop crashes at masterformat system tests
Fix of CVE-2023-6516 has changed format of map file and masterformat has
started crashing. Adjust test values to pass cleanly.

Related: RHEL-25375
; Related: CVE-2023-6516
2024-03-26 12:05:32 +01:00
Petr Menšík
02426200e2 Downstream specific changes related to KeyTrap
Fix for CVE-2023-50387 introduced new additional thread. But because
isc_hp functions were removed from later bind 9.16 release, their
changes did not contain increase of hazard pointers max thread limit.
To prevent obscure memory corruption increase thread max size.

In addition place at least few INSISTs to check this is catched before
random memory overwrites begins. It would be quite difficult to track
without any check.

Resolves: RHEL-25386
; Resolves: CVE-2023-50387
2024-03-26 12:05:32 +01:00
Petr Menšík
650ecb34a1 Add mctx attach/detach when creating/destroying a memory pool
This should make sure that the memory context is not destroyed
before the memory pool, which is using the context.

Related: RHEL-25386
; Related: CVE-2023-50387
2024-03-26 12:05:32 +01:00
Petr Menšík
cfba145ce5 Define variables used for test variants
Patch171 introduces undefined variables, which may fail some tests.
Define them to empty values. Also required python3-dns with SYSTEMTEST
feature enabled.

Related: RHEL-25342
; Related: CVE-2023-4408
2024-03-26 12:05:32 +01:00
Petr Menšík
f8725ad962 Allow testing from more recent Fedora by skipping python rule
More recent python3 module ply does not accept statements used in
isc/policy.py, which generates parsetab.py. Allow to skip that target on
local only fedora builds.

Related: RHEL-25342
; Related: CVE-2023-4408
2024-03-26 12:05:32 +01:00
Petr Menšík
5dc319b2a8 Import tests for large DNS messages fix
Tests part of fixes of CVE-2023-4408.

Related: RHEL-25342
; Related: CVE-2023-4408
2024-03-26 12:05:32 +01:00
Petr Menšík
e919059dfa Prevent increased CPU consumption in DNSSEC validator
KeyTrap - Extreme CPU consumption in DNSSEC validator. Preparing an
NSEC3 closest encloser proof can exhaust CPU resources.

6322.	[security]	Specific DNS answers could cause a denial-of-service
			condition due to DNS validation taking a long time.
			(CVE-2023-50387) [GL #4424]

Resolves: RHEL-25397 RHEL-25386
; Resolves: CVE-2023-50387 CVE-2023-50868
2024-03-26 12:05:32 +01:00
Petr Menšík
2efe6d155b Specific recursive query patterns may lead to an out-of-memory condition
6319.	[security]	Query patterns that continuously triggered cache
			database maintenance could exhaust all available memory
			on the host running named. (CVE-2023-6516) [GL #4383]

Resolves: RHEL-25375
; Resolves: CVE-2023-6516
2024-03-26 12:05:32 +01:00
Petr Menšík
e51b6b2b70 Prevent assertion failure if DNS64 and serve-stale is used
Enabling both DNS64 and serve-stale may cause an assertion failure
during recursive resolution.

6317.	[security]	Restore DNS64 state when handling a serve-stale timeout.
			(CVE-2023-5679) [GL #4334]

Resolves: RHEL-25364
; Resolves: CVE-2023-5679
2024-03-26 12:05:32 +01:00
Petr Menšík
e09e829119 Prevent assertion failure when nxdomain-redirect is used with
RFC 1918 reverse zones

6316.	[security]	Specific queries could trigger an assertion check with
			nxdomain-redirect enabled. (CVE-2023-5517) [GL #4281]

Resolves: RHEL-25353
; Resolves: CVE-2023-5517
2024-03-26 12:05:32 +01:00
Petr Menšík
deeca182e3 Prevent increased CPU load on large DNS messages
6315.	[security]	Speed up parsing of DNS messages with many different
			names. (CVE-2023-4408) [GL #4234]
6321.	[security]	Change 6315 inadvertently introduced regressions that
			could cause named to crash. [GL #4234]
6343.	[bug]		Fix case insensitive setting for isc_ht hashtable.

Resolves: RHEL-25342
; Resolves: CVE-2023-4408
2024-03-26 12:05:22 +01:00
Petr Menšík
2b46612566 Update addresses of b.root-servers.net
https://b.root-servers.org/news/2023/05/16/new-addresses.html

Resolves: RHEL-18188
2023-12-07 15:20:38 +01:00
Petr Menšík
814f798219 Fix CVE-2023-3341
6245.	[security]	Limit the amount of recursion that can be performed
			by isccc_cc_fromwire. (CVE-2023-3341) [GL #4152]

Resolves: RHEL-5239
2023-09-20 13:22:16 +02:00
Petr Menšík
12f1cd3444 Fix CVE-2023-2911
6192.	[security]	A query that prioritizes stale data over lookup
			triggers a fetch to refresh the stale data in cache.
			If the fetch is aborted for exceeding the recursion
			quota, it was possible for 'named' to enter an infinite
			callback loop and crash due to stack overflow. This has
			been fixed. (CVE-2023-2911) [GL #4089]

Resolves: CVE-2023-2911
2023-07-19 18:24:02 +02:00
Petr Menšík
d6566b65ba Fix CVE-2023-2828
6190.	[security]	Improve the overmem cleaning process to prevent the
			cache going over the configured limit. (CVE-2023-2828)
			[GL #4055]

Resolves: CVE-2023-2828
2023-07-19 18:09:09 +02:00
Petr Menšík
889db13e6f fixup! Have dns_zt_apply lock the zone table
Correct the change to include important locks.
Correct backport issue in statistics rendering fix.

Resolves: rhbz#2126912
2023-02-27 14:44:05 +01:00
Petr Menšík
dc3f4d28ab Fix small differences to upstream patches
Some small differences went unnoticed and cause system test upforwd
failure. Fix both code change and test to pass.

Resolves: CVE-2022-3094
2023-02-25 03:10:37 +01:00
Petr Menšík
512b305b43 Fix crash when soft-quota is reached and serve-stale is active
6067.	[security]	Fix serve-stale crash when recursive clients soft quota
			is reached. (CVE-2022-3924) [GL #3619]

Resolves: CVE-2022-3924
2023-02-09 17:52:04 +01:00
Petr Menšík
288db36de7 Handle RRSIG queries when server-stale is active
6066.	[security]	Handle RRSIG lookups when serve-stale is active.
			(CVE-2022-3736) [GL #3622]

Resolves: CVE-2022-3736
2023-02-09 17:28:30 +01:00
Petr Menšík
495baa1377 test failure conditions
verify that updates are refused when the client is disallowed by
allow-query, and update forwarding is refused when the client is
is disallowed by update-forwarding.

verify that "too many DNS UPDATEs" appears in the log file when too
many simultaneous updates are processing.

Related: CVE-2022-3094
2023-02-08 18:47:31 +01:00
Petr Menšík
a85d02f014 Prevent flooding with UPDATE requests
6064.	[security]	An UPDATE message flood could cause named to exhaust all
			available memory. This flaw was addressed by adding a
			new "update-quota" statement that controls the number of
			simultaneous UPDATE messages that can be processed or
			forwarded. The default is 100. A stats counter has been
			added to record events when the update quota is
			exceeded, and the XML and JSON statistics version
			numbers have been updated. (CVE-2022-3094) [GL #3523]

Resolves: CVE-2022-3094
2023-02-08 18:47:31 +01:00