285702 Commits

Author SHA1 Message Date
rillig
56d3e49d54 lint: extend debugging for initializing objects
No functional change outside debug mode.
2021-02-20 16:34:57 +00:00
rillig
92a76c943c lint: rename mkinit to init_using_expr
No functional change outside debug mode.
2021-02-20 16:03:56 +00:00
rillig
039617c180 lint: add hierarchical debug logging for initializations
No functional change for default mode.
2021-02-20 15:23:07 +00:00
jmcneill
7987f42723 Move 'struct pic_pending' from percpu to struct cpu_info. Saves a few
instructions in splx.
2021-02-20 14:51:06 +00:00
skrll
7a3cc25e41 Reapply the following change - Simon's first attempt had a missing ';'
release builds done for cobalt and evbmips64-eb

Provide an __eprol symbol in TEXT_START_SYMBOLS.  MIPS overrides
TEXT_START_SYMBOLS so it misses out on the default definition of
this that does provide an __eprol symbol.  Fixes linking of profiled
binaries.
2021-02-20 14:48:07 +00:00
jmcneill
3de14f28bd Sync with OpenBSD r1.99:
move the rearming of the cq after the refill of the rq.

   this is the only real diff we have left outstanding on a box that
   experienced rx lockups. since adding this change it's been happy
   for the last 4 weeks and counting so far.
2021-02-20 13:31:35 +00:00
rillig
486e361bf3 lint: make parsing of GCC line directives stricter
The previous code accepted '# 123 "file.c" 23' as specifying a system
header, just because that number ends with '3'.  The original intention
was to compare the complete word, not its suffix.  Fix that.

No practical change since the only flags that are used by GCC are all
single-digit.
2021-02-20 11:06:56 +00:00
rillig
2cab38691c lint: reduce duplicate code in check for getopt
This also changes the conditions to their positive form, which is easier
to read.

No functional change.  The resulting binary would have been the same as
before, were it not for the changed line numbers in the lint_assert
calls further down in the code.
2021-02-20 10:12:52 +00:00
rillig
7f300e59ba lint: clean up check for getopt
The original options string is not needed during the check.  Having only
the unhandled options suffices.

No functional change.
2021-02-20 10:01:27 +00:00
rillig
46a713f776 lint: fix crash from ckgetopt.c 1.2 and document the data structures 2021-02-20 09:57:02 +00:00
rin
55b56938ed Misc style fixes. No binary changes.
- Use uint{32,8}_t instead of unsigned {int, char}.
- Sort headers.
- KNF
2021-02-20 09:51:20 +00:00
rillig
6e51f5af89 lint: reproduce the crash from ckgetopt.c 1.2
The intention of the getopt check was to analyze only those while loops
whose condition consists of the usual getopt call.  For all other while
loops, ck.while_level was intended to stay at 0.

This was not the case in ckgetopt.c 1.2 and has been fixed in ckgetopt.c
1.3.  The code did not document the intended invariants though, which it
should have done.  This will be done in a follow-up commit.
2021-02-20 09:40:42 +00:00
rin
c537dc4487 sn(4): Add rnd(9) support. 2021-02-20 09:36:30 +00:00
nia
fe9db1e16f fix URL 2021-02-20 09:31:51 +00:00
nia
894dfd713b patch(1): use PATH_MAX for the size of rejname
via freebsd, openbsd
2021-02-20 09:17:13 +00:00
nia
ada1367bac patch(1): add test cases for various backup file formats 2021-02-20 08:59:24 +00:00
christos
3061632a16 new OpenSSL 2021-02-20 03:25:35 +00:00
christos
c50ed29de1 merge conflicts 2021-02-20 03:22:13 +00:00
christos
f7bc30e0e2 Changes between 1.1.1i and 1.1.1j [16 Feb 2021]
*) Fixed the X509_issuer_and_serial_hash() function. It attempts
     to create a unique hash value based on the issuer and serial
     number data contained within an X509 certificate. However it
     was failing to correctly handle any errors that may occur
     while parsing the issuer field (which might occur if the issuer
     field is maliciously constructed). This may subsequently result
     in a NULL pointer deref and a crash leading to a potential
     denial of service attack.
     (CVE-2021-23841)
     [Matt Caswell]

  *) Fixed the RSA_padding_check_SSLv23() function and the
     RSA_SSLV23_PADDING padding mode to correctly check for rollback
     attacks. This is considered a bug in OpenSSL 1.1.1 because it
     does not support SSLv2. In 1.0.2 this is CVE-2021-23839.
     [Matt Caswell]

  *) Fixed the EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate
     functions. Previously they could overflow the output length
     argument in some cases where the input length is close to the
     maximum permissable length for an integer on the platform. In
     such cases the return value from the function call would be
     1 (indicating success), but the output length value would be
     negative. This could cause applications to behave incorrectly
     or crash.

     (CVE-2021-23840)
     [Matt Caswell]

  *) Fixed SRP_Calc_client_key so that it runs in constant time.
     The previous implementation called BN_mod_exp without setting
     BN_FLG_CONSTTIME.  This could be exploited in a side channel
     attack to recover the password. Since the attack is local host
     only this is outside of the current OpenSSL threat model and
     therefore no CVE is assigned.

     Thanks to Mohammed Sabt and Daniel De Almeida Braga for reporting
     this issue.
     [Matt Caswell]
2021-02-20 03:12:10 +00:00
simonb
be1353c20e Revert the MIPS __eprol change. Unintended fallout that doesn't appear
easy to fix so far.
2021-02-20 02:47:21 +00:00
thorpej
9c0eefe177 Query real-mode? at startup and cache the result. 2021-02-20 01:57:54 +00:00
christos
a10402a4f1 libisc needs libssl now 2021-02-20 01:43:04 +00:00
christos
fc13bd7d09 Prevent crashing when options are NULL in libc while linting
src/lib/libc/posix1e/acl_from_text.c
2021-02-20 01:18:02 +00:00
rillig
4e5ad049a7 lint: remove gcov results on "make clean" 2021-02-19 23:25:26 +00:00
rillig
90c29d8403 lint: shorten code in check-msgs.lua
No functional change.
2021-02-19 23:22:19 +00:00
rillig
9c0f980ca3 lint: rename storage class constants to be more expressive
No functional change.
2021-02-19 22:35:42 +00:00
rillig
32266a1930 lint: rename t_isenum and t_aincompl to be more expressive
No functional change.
2021-02-19 22:27:49 +00:00
rillig
468e9e00fb lint: rename tenum_t and its members to be more expressive 2021-02-19 22:20:18 +00:00
rillig
e55559f87e lint: rename str_t and its members to be more expressive
No functional change.
2021-02-19 22:16:12 +00:00
rillig
3fe220d520 lint: replace cryptic sym.s_rimpl with expressive name
No functional change.
2021-02-19 21:35:44 +00:00
martin
2916a307c1 PR kern/55272: do not skip this test on single cpu machines - it is not
the only test causing the watchdog starvation and we better find and
fix the real issue.
2021-02-19 18:36:50 +00:00
thorpej
e360187258 Update some #ifdef PMAC_G5 for previous change that I missed before. 2021-02-19 18:10:51 +00:00
thorpej
eeb852bf73 Fix the previously differently. 2021-02-19 18:05:42 +00:00
thorpej
fd7b9a972c ofwreal_incharge does not need to be global. 2021-02-19 18:03:21 +00:00
thorpej
938bab8258 Put back accidental removal of "ofwreal_incharge". 2021-02-19 18:02:45 +00:00
thorpej
8b6c766aa1 Avoid an unused variable warning for the not-building-macppc case. 2021-02-19 17:58:43 +00:00
nia
8b022a822c patch: make '-V none' work in the expected way
Internally the code confuses the concept of "the user doesn't want
a backup file" and "the user hasn't defined a type of backup file".

Introduce a new "undefined" backup type to serve the purpose "none"
previously did, and make "none" not generate backup files, as expected.

http://mail-index.netbsd.org/tech-userlevel/2021/02/19/msg012901.html

XXX pullup?
2021-02-19 17:46:53 +00:00
christos
2ab3058973 update the date for bind 2021-02-19 17:09:35 +00:00
christos
4d1068f991 new bind 2021-02-19 17:08:22 +00:00
christos
362817299c bump bind libraries 2021-02-19 17:06:26 +00:00
christos
fce770bd40 merge conflicts, adjust build. 2021-02-19 16:42:08 +00:00
christos
a111e46cec --- 9.16.12 released ---
5578.	[protocol]	Make "check-names" accept A records below "_spf",
			"_spf_rate", and "_spf_verify" labels in order to cater
			for the "exists" SPF mechanism specified in RFC 7208
			section 5.7 and appendix D.1. [GL #2377]

5577.	[bug]		Fix the "three is a crowd" key rollover bug in KASP by
			correctly implementing Equation (2) of the "Flexible and
			Robust Key Rollover" paper. [GL #2375]

5575.	[bug]		When migrating to KASP, BIND 9 considered keys with the
			"Inactive" and/or "Delete" timing metadata to be
			possible active keys. This has been fixed. [GL #2406]

5572.	[bug]		Address potential double free in generatexml().
			[GL #2420]

5571.	[bug]		named failed to start when its configuration included a
			zone with a non-builtin "allow-update" ACL attached.
			[GL #2413]

5570.	[bug]		Improve performance of the DNSSEC verification code by
			reducing the number of repeated calls to
			dns_dnssec_keyfromrdata(). [GL #2073]

5569.	[bug]		Emit useful error message when "rndc retransfer" is
			applied to a zone of inappropriate type. [GL #2342]

5568.	[bug]		Fixed a crash in "dnssec-keyfromlabel" when using ECDSA
			keys. [GL #2178]

5567.	[bug]		Dig now reports unknown dash options while pre-parsing
			the options. This prevents "-multi" instead of "+multi"
			from reporting memory usage before ending option parsing
			with "Invalid option: -lti". [GL #2403]

5566.	[func]		Add "stale-answer-client-timeout" option, which is the
			amount of time a recursive resolver waits before
			attempting to answer the query using stale data from
			cache. [GL #2247]

5565.	[func]		The SONAMEs for BIND 9 libraries now include the current
			BIND 9 version number, in an effort to tightly couple
			internal libraries with a specific release. [GL #2387]

5562.	[security]	Fix off-by-one bug in ISC SPNEGO implementation.
			(CVE-2020-8625) [GL #2354]

5561.	[bug]		KASP incorrectly set signature validity to the value of
			the DNSKEY signature validity. This is now fixed.
			[GL #2383]

5560.	[func]		The default value of "max-stale-ttl" has been changed
			from 12 hours to 1 day and the default value of
			"stale-answer-ttl" has been changed from 1 second to 30
			seconds, following RFC 8767 recommendations. [GL #2248]

5456.	[func]		Added "primaries" as a synonym for "masters" in
			named.conf, and "primary-only" as a synonym for
			"master-only" in the parameters to "notify", to bring
			terminology up-to-date with RFC 8499. [GL #1948]

5362.	[func]		Limit the size of IXFR responses so that AXFR will
			be used instead if it would be smaller. This is
			controlled by the "max-ixfr-ratio" option, which
			is a percentage representing the ratio of IXFR size
			to the size of the entire zone. This value cannot
			exceed 100%, which is the default. [GL #1515]

	--- 9.16.11 released ---

5559.	[bug]		The --with-maxminddb=PATH form of the build-time option
			enabling support for libmaxminddb was not working
			correctly. This has been fixed. [GL #2366]

5557.	[bug]		Prevent RBTDB instances from being destroyed by multiple
			threads at the same time. [GL #2317]

5556.	[bug]		Further tweak newline printing in dnssec-signzone and
			dnssec-verify. [GL #2359]

5555.	[bug]		server->reload_status was not properly initialized.
			[GL #2361]

5554.	[bug]		dnssec-signzone and dnssec-verify were missing newlines
			between log messages. [GL #2359]

5553.	[bug]		When reconfiguring named, removing "auto-dnssec" did not
			turn off DNSSEC maintenance. [GL #2341]

5552.	[func]		When switching to "dnssec-policy none;", named now
			permits a safe transition to insecure mode and publishes
			the CDS and CDNSKEY DELETE records, as described in RFC
			8078. [GL #1750]

5551.	[bug]		named no longer attempts to assign threads to CPUs
			outside the CPU affinity set. Thanks to Ole Bjørn
			Hessen. [GL #2245]

5550.	[func]		dnssec-signzone and named now log a warning when falling
			back to the "increment" SOA serial method. [GL #2058]

5545.	[func]		OS support for load-balanced sockets is no longer
			required to receive incoming queries in multiple netmgr
			threads. [GL #2137]

5543.	[bug]		Fix UDP performance issues caused by making netmgr
			callbacks asynchronous-only. [GL #2320]

5542.	[bug]		Refactor netmgr. [GL #1920] [GL #2034] [GL #2061]
			[GL #2194] [GL #2221] [GL #2266] [GL #2283] [GL #2318]
			[GL #2321]

	--- 9.16.10 released ---

5544.	[func]		Restore the default value of "nocookie-udp-size" to 4096
			bytes. [GL #2250]

5541.	[func]		Adjust the "max-recursion-queries" default from 75 to
			100. [GL #2305]

5540.	[port]		Fix building with native PKCS#11 support for AEP Keyper.
			[GL #2315]

5539.	[bug]		Tighten handling of missing DNS COOKIE responses over
			UDP by falling back to TCP. [GL #2275]

5538.	[func]		Add NSEC3 support to KASP. A new option for
			"dnssec-policy", "nsec3param", can be used to set the
			desired NSEC3 parameters. NSEC3 salt collisions are
			automatically prevented during resalting. Salt
			generation is now logged with zone context. [GL #1620]

5534.	[bug]		The CNAME synthesized from a DNAME was incorrectly
			followed when the QTYPE was CNAME or ANY. [GL #2280]

	--- 9.16.9 released ---

5533.	[func]		Add the "stale-refresh-time" option, a time window that
			starts after a failed lookup, during which a stale RRset
			is served directly from cache before a new attempt to
			refresh it is made. [GL #2066]

5530.	[bug]		dnstap did not capture responses to forwarded UPDATE
			requests. [GL #2252]

5527.	[bug]		A NULL pointer dereference occurred when creating an NTA
			recheck query failed. [GL #2244]

5525.	[bug]		Change 5503 inadvertently broke cross-compilation by
			replacing a call to AC_LINK_IFELSE() with a call to
			AC_RUN_IFELSE() in configure.ac.  This has been fixed,
			making cross-compilation possible again. [GL #2237]

5523.	[bug]		The initial lookup in a zone transitioning to/from a
			signed state could fail if the DNSKEY RRset was not
			found. [GL #2236]

5522.	[bug]		Fixed a race/NULL dereference in TCPDNS send. [GL #2227]

5520.	[bug]		Fixed a number of shutdown races, reference counting
			errors, and spurious log messages that could occur
			in the network manager. [GL #2221]

5518.	[bug]		Stub zones now work correctly with primary servers using
			"minimal-responses yes". [GL #1736]

5517.	[bug]		Do not treat UV_EOF as a TCP4RecvErr or a TCP6RecvErr.
			[GL #2208]

	--- 9.16.8 released ---

5516.	[func]		The default EDNS buffer size has been changed from 4096
			to 1232 bytes. [GL #2183]

5515.	[func]		Add 'rndc dnssec -rollover' command to trigger a manual
			rollover for a specific key. [GL #1749]

5514.	[bug]		Fix KASP expected key size for Ed25519 and Ed448.
			[GL #2171]

5513.	[doc]		The ARM section describing the "rrset-order" statement
			was rewritten to make it unambiguous and up-to-date with
			the source code. [GL #2139]

5512.	[bug]		"rrset-order" rules using "order none" were causing
			named to crash despite named-checkconf treating them as
			valid. [GL #2139]

5511.	[bug]		'dig -u +yaml' failed to display timestamps to the
			microsecond. [GL #2190]

5510.	[bug]		Implement the attach/detach semantics for dns_message_t
			to fix a data race in accessing an already-destroyed
			fctx->rmessage. [GL #2124]

5509.	[bug]		filter-aaaa: named crashed upon shutdown if it was in
			the process of recursing for A RRsets. [GL #1040]

5508.	[func]		Added new parameter "-expired" for "rndc dumpdb" that
			also prints expired RRsets (awaiting cleanup) to the
			dump file. [GL #1870]

5507.	[bug]		Named could compute incorrect SIG(0) responses.
			[GL #2109]

5506.	[bug]		Properly handle failed sysconf() calls, so we don't
			report invalid memory size. [GL #2166]

5505.	[bug]		Updating contents of a mixed-case RPZ could cause some
			rules to be ignored. [GL #2169]

5503.	[bug]		Cleaned up reference counting of network manager
			handles, now using isc_nmhandle_attach() and _detach()
			instead of _ref() and _unref(). [GL #2122]

	--- 9.16.7 released ---

5501.	[func]		Log CDS/CDNSKEY publication. [GL #1748]

5500.	[bug]		Fix (non-)publication of CDS and CDNSKEY records.
			[GL #2103]

5499.	[func]		Add '-P ds' and '-D ds' arguments to dnssec-settime.
			[GL #1748]

5497.	[bug]		'dig +bufsize=0' failed to disable EDNS. [GL #2054]

5496.	[bug]		Address a TSAN report by ensuring each rate limiter
			object holds a reference to its task. [GL #2081]

5495.	[bug]		With query minimization enabled, named failed to
			resolve ip6.arpa. names that had extra labels to the
			left of the IPv6 part. [GL #1847]

5494.	[bug]		Silence the EPROTO syslog message on older systems.
			[GL #1928]

5493.	[bug]		Fix off-by-one error when calculating new hash table
			size. [GL #2104]

5492.	[bug]		Tighten LOC parsing to reject a period (".") and/or "m"
			as a value. Fix handling of negative altitudes which are
			not whole meters. [GL #2074]

5491.	[bug]		rbtversion->glue_table_size could be read without the
			appropriate lock being held. [GL #2080]

5489.	[bug]		Named erroneously accepted certain invalid resource
			records that were incorrectly processed after
			subsequently being written to disk and loaded back, as
			the wire format differed. Such records include: CERT,
			IPSECKEY, NSEC3, NSEC3PARAM, NXT, SIG, TLSA, WKS, and
			X25. [GL !3953]

5488.	[bug]		NTA code needed to have a weak reference on its
			associated view to prevent the latter from being deleted
			while NTA tests were being performed. [GL #2067]

5486.	[func]		Add 'rndc dnssec -checkds' command, which signals to
			named that the DS record for a given zone or key has
			been updated in the parent zone. [GL #1613]

	--- 9.16.6 released ---

5484.	[func]		Expire zero TTL records quickly rather than using them
			for stale answers. [GL #1829]

5483.	[func]		A new configuration option "stale-cache-enable" has been
			introduced to enable or disable keeping stale answers in
			cache. [GL #1712]

5482.	[bug]		If the Duplicate Address Detection (DAD) mechanism had
			not yet finished after adding a new IPv6 address to the
			system, BIND 9 would fail to bind to IPv6 addresses in a
			tentative state. [GL #2038]

5481.	[security]	"update-policy" rules of type "subdomain" were
			incorrectly treated as "zonesub" rules, which allowed
			keys used in "subdomain" rules to update names outside
			of the specified subdomains. The problem was fixed by
			making sure "subdomain" rules are again processed as
			described in the ARM. (CVE-2020-8624) [GL #2055]

5480.	[security]	When BIND 9 was compiled with native PKCS#11 support, it
			was possible to trigger an assertion failure in code
			determining the number of bits in the PKCS#11 RSA public
			key with a specially crafted packet. (CVE-2020-8623)
			[GL #2037]

5479.	[security]	named could crash in certain query resolution scenarios
			where QNAME minimization and forwarding were both
			enabled. (CVE-2020-8621) [GL #1997]

5478.	[security]	It was possible to trigger an assertion failure by
			sending a specially crafted large TCP DNS message.
			(CVE-2020-8620) [GL #1996]

5477.	[bug]		The idle timeout for connected TCP sockets, which was
			previously set to a high fixed value, is now derived
			from the client query processing timeout configured for
			a resolver. [GL #2024]

5476.	[security]	It was possible to trigger an assertion failure when
			verifying the response to a TSIG-signed request.
			(CVE-2020-8622) [GL #2028]

5475.	[bug]		Wildcard RPZ passthru rules could incorrectly be
			overridden by other rules that were loaded from RPZ
			zones which appeared later in the "response-policy"
			statement. This has been fixed. [GL #1619]

5474.	[bug]		dns_rdata_hip_next() failed to return ISC_R_NOMORE
			when it should have. [GL !3880]

5473.	[func]		The RBT hash table implementation has been changed
			to use a faster hash function (HalfSipHash2-4) and
			Fibonacci hashing for better distribution. Setting
			"max-cache-size" now preallocates a fixed-size hash
			table so that rehashing does not cause resolution
			brownouts while the hash table is grown. [GL #1775]

5471.	[bug]		The introduction of KASP support inadvertently caused
			the second field of "sig-validity-interval" to always be
			calculated in hours, even in cases when it should have
			been calculated in days. This has been fixed. (Thanks to
			Tony Finch.) [GL !3735]

5469.	[port]		On illumos, a constant called SEC is already defined in
			<sys/time.h>, which conflicts with an identically named
			constant in libbind9. This conflict has been resolved.
			[GL #1993]

5468.	[bug]		Addressed potential double unlock in process_fd().
			[GL #2005]

5466.	[bug]		Addressed an error in recursive clients stats reporting.
			[GL #1719]

5465.	[func]		Added fallback to built-in trust-anchors, managed-keys,
			or trusted-keys if the bindkeys-file (bind.keys) cannot
			be parsed. [GL #1235]

5464.	[bug]		Requesting more than 128 files to be saved when rolling
			dnstap log files caused a buffer overflow. This has been
			fixed. [GL #1989]

5462.	[bug]		Move LMDB locking from LMDB itself to named. [GL #1976]

5461.	[bug]		The STALE rdataset header attribute was updated while
			the write lock was not being held, leading to incorrect
			statistics. The header attributes are now converted to
			use atomic operations. [GL #1475]
2021-02-19 16:37:01 +00:00
jakllsch
6c1cfa34fb it's spelled struct tcphdr, not struct tcp_hdr 2021-02-19 15:43:56 +00:00
christos
2143da8717 - Make ALIGNED_POINTER use __alignof(t) instead of sizeof(t). This is more
correct because it works with non-primitive types and provides the ABI
  alignment for the type the compiler will use.
- Remove all the *_HDR_ALIGNMENT macros and asserts
- Replace POINTER_ALIGNED_P with ACCESSIBLE_POINTER which is identical to
  ALIGNED_POINTER, but returns that the pointer is always aligned if the
  CPU supports unaligned accesses.
[ as proposed in tech-kern ]
2021-02-19 14:51:59 +00:00
rillig
dbf7816e85 lint: fix build in tools mode 2021-02-19 14:44:29 +00:00
hannken
c0f49ec479 When turning off swap during reboot we have to lock with LK_RETRY
as regular files got reclaimed during unmount.

Adresses PR kern/54969 (Disk cache is no longer flushed on shutdown)
2021-02-19 13:20:43 +00:00
rillig
746e9c89cf lint: warn about mismatch in getopt handling 2021-02-19 12:28:56 +00:00
rillig
ded935ea33 videoctl: remove unnecessary code for unknown option -h
The generated binary stays the same.
2021-02-19 11:39:11 +00:00
msaitoh
ffafe9308d Add missing 'q' modifier for the write command. 2021-02-19 08:57:56 +00:00
simonb
0728b0ad24 Remove the incorrect register shuffle - we pass SYS___syscall as the
syscall number in v0 and pass all the original __syscall() args in their
original slots/regs.
2021-02-19 08:33:02 +00:00