openbsd
3 years agosync
deraadt [Sun, 4 Jul 2021 17:23:49 +0000 (17:23 +0000)]
sync

3 years ago.Fl marks up options not arguments
kn [Sun, 4 Jul 2021 15:58:51 +0000 (15:58 +0000)]
.Fl marks up options not arguments

POSIX says `-v' is an option, not an argument;  options may take arguments,
as documented in getopt(3).

Programs may take arguments as well, e.g. "prog -v -- arg ...", but these
are usually marked up with `.Cm'.

Change "The arguments are as follows:" to "The options are as follows:" in
`.Fl's DESCRIPTION example to match what most of our base manuals say.

OK schwarze jmc

3 years agoThe mandoc(1) manual already mentions that -T man output mode
schwarze [Sun, 4 Jul 2021 15:38:08 +0000 (15:38 +0000)]
The mandoc(1) manual already mentions that -T man output mode
neither supports tbl(7) nor eqn(7) input.
If an input file contains such code anyway, tell the user
rather than failing an assert(3)ion.

Fixing a crash reported by Bjarni Ingi Gislason <bjarniig at rhi dot hi dot is>
in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901636 which the
Debian maintainer of mandoc, Michael at Stapelberg dot ch, forwarded to me.

3 years agosync
deraadt [Sun, 4 Jul 2021 14:29:36 +0000 (14:29 +0000)]
sync

3 years agobump major after zlib update
tb [Sun, 4 Jul 2021 14:29:14 +0000 (14:29 +0000)]
bump major after zlib update

3 years agoUpdate libz to zlib 1.2.11 and reapply local patches as far as this
tb [Sun, 4 Jul 2021 14:24:49 +0000 (14:24 +0000)]
Update libz to zlib 1.2.11 and reapply local patches as far as this
made sense.

Tested in snaps for a few days. deraadt helped with fitting things on
floppies and jmatthew found a bug I introduced.

ok deraadt

3 years agodocument X509_find_by_subject(3) and X509_find_by_issuer_and_serial(3)
schwarze [Sun, 4 Jul 2021 12:56:27 +0000 (12:56 +0000)]
document X509_find_by_subject(3) and X509_find_by_issuer_and_serial(3)

3 years agoBugfix: when X509_NAME_dup(3) failed, X509_NAME_set(3) indicated success
schwarze [Sun, 4 Jul 2021 11:38:37 +0000 (11:38 +0000)]
Bugfix: when X509_NAME_dup(3) failed, X509_NAME_set(3) indicated success
even though it did not actually set the name.
Instead, indicate failure in this case.

This commit sneaks in a small, unrelated change in behaviour.
If the first argument of X509_NAME_set(3) was NULL, the function
used to return failure.  Now it crashes the program by accessing
the NULL pointer, for compatibility with the same change in OpenSSL.

This merges the following two commits from the OpenSSL-1.1.1 branch,
which is still available under a free license:
1. 180794c5  Rich Salz        Sep  3 11:33:34 2017 -0400
2. c1c1783d  Richard Levitte  May 17 09:53:14 2018 +0200

OK tb@

3 years ago__realpath: removes LOCKLEAF from NDINIT.
semarie [Sat, 3 Jul 2021 17:51:59 +0000 (17:51 +0000)]
__realpath: removes LOCKLEAF from NDINIT.

The code doesn't doesn't need it: the returned vnode is released
immediately. The string path is built from the namei() call using
REALPATH, during directories traversal.

Without LOCKLEAF, calling vrele() only is enough if namei() found a
file, instead of calling VOP_UNLOCK() + vrele().

ok claudio@ mpi@

3 years agoDocument X509_NAME_set(3).
schwarze [Sat, 3 Jul 2021 17:04:51 +0000 (17:04 +0000)]
Document X509_NAME_set(3).
It is not particularly well-designed and sets a number of traps for the
unwary, but it is a public API function in both OpenSSL and LibreSSL
and used at various places.

3 years agoDo a first pass clean up of SSL_METHOD.
jsing [Sat, 3 Jul 2021 16:06:44 +0000 (16:06 +0000)]
Do a first pass clean up of SSL_METHOD.

The num_ciphers, get_cipher_by_char and put_cipher_by_char function
pointers use the same function for all methods - call ssl3_num_ciphers()
directly, absorb ssl3_get_cipher_by_char() into SSL_CIPHER_find() and
remove the unused ssl3_put_cipher_by_char() code.

ok inoguchi@ tb@

3 years agoGarbage collect do_test_cipherlist().
jsing [Sat, 3 Jul 2021 16:04:29 +0000 (16:04 +0000)]
Garbage collect do_test_cipherlist().

This code no longer compiles and the equivalent test coverage has been
added to regress/lib/libssl/ciphers (and is actually run).

3 years agoAdd test that ensures ssl3_ciphers[] is sorted by cipher id.
jsing [Sat, 3 Jul 2021 15:54:41 +0000 (15:54 +0000)]
Add test that ensures ssl3_ciphers[] is sorted by cipher id.

3 years agoRewrite get_put_test() as cipher_find_test().
jsing [Sat, 3 Jul 2021 14:52:12 +0000 (14:52 +0000)]
Rewrite get_put_test() as cipher_find_test().

The get_cipher_by_char() and put_cipher_by_char() pointers are no longer
accessible on the SSL_METHOD (and soon will not even exist). Rewrite the
test to use SSL_CIPHER_find() instead.

3 years agofix a bug that resulted in incomplete testing:
schwarze [Sat, 3 Jul 2021 12:04:53 +0000 (12:04 +0000)]
fix a bug that resulted in incomplete testing:
end statements with ';' because ',' isn't enough

3 years agoAvoid spinning with interrupts disabled.
kettenis [Sat, 3 Jul 2021 10:21:38 +0000 (10:21 +0000)]
Avoid spinning with interrupts disabled.

ok patrick@

3 years agoUpdate to go-module.5 to reflect the modgo-gen-modules changes.
abieber [Sat, 3 Jul 2021 02:49:13 +0000 (02:49 +0000)]
Update to go-module.5 to reflect the modgo-gen-modules changes.

3 years agoAvoid local variable definitions in the middle of code.
kettenis [Fri, 2 Jul 2021 20:39:25 +0000 (20:39 +0000)]
Avoid local variable definitions in the middle of code.

3 years agoAvoid spinning with interrupts disabled in the rpi3.
kettenis [Fri, 2 Jul 2021 19:55:00 +0000 (19:55 +0000)]
Avoid spinning with interrupts disabled in the rpi3.

tested by sthen@ (a while ago)

3 years agousleep(3): always call nanosleep(2)
cheloha [Fri, 2 Jul 2021 17:16:20 +0000 (17:16 +0000)]
usleep(3): always call nanosleep(2)

usleep(3) is a wrapper around nanosleep(2).  We should always call
nanosleep(), even if the input is zero.  This makes behavior easier
to reason about and ensures we get a nanosleep() ktrace hit if a
program calls usleep().

ok millert@

3 years agoDocument the read-only (sic!) accessor function X509_NAME_ENTRY_set(3).
schwarze [Fri, 2 Jul 2021 16:13:56 +0000 (16:13 +0000)]
Document the read-only (sic!) accessor function X509_NAME_ENTRY_set(3).
While here, stress that X509_NAME objects cannot share X509_NAME_ENTRY
objects, and polish a few misleading wordings.

3 years agoBefore calling setrlimit(), pull cur up to max.
deraadt [Fri, 2 Jul 2021 15:34:27 +0000 (15:34 +0000)]
Before calling setrlimit(), pull cur up to max.
ok millert

3 years agoUse nanosleep() and setitimer() instead of usleep() and ualarm().
millert [Fri, 2 Jul 2021 15:34:16 +0000 (15:34 +0000)]
Use nanosleep() and setitimer() instead of usleep() and ualarm().
Both usleep() and ualarm() are obsolete and were removed from POSIX.
OK deraadt@

3 years agoRemove bogus comments.
kettenis [Fri, 2 Jul 2021 14:58:33 +0000 (14:58 +0000)]
Remove bogus comments.

3 years agoRemove a few pointless comments.
kettenis [Fri, 2 Jul 2021 14:50:18 +0000 (14:50 +0000)]
Remove a few pointless comments.

3 years agoWriting ktrace files to NFS must no be done while holding the net
bluhm [Fri, 2 Jul 2021 12:17:41 +0000 (12:17 +0000)]
Writing ktrace files to NFS must no be done while holding the net
lock.  accept(2) panics, connect(2) dead locks.  Additionally copy
in or out must not hold the net lock as it may be a memory mapped
file on NFS.
Simplify dns_portcheck(), it does not modify namelen anymore.
In doaccept() release the socket lock before calling copyaddrout().
Rearrange the checks in sys_connect() like they are in sys_bind().
OK mpi@

3 years agoAdd a roff comment saying that X509_certificate_type(3) is intentionally
schwarze [Fri, 2 Jul 2021 11:48:01 +0000 (11:48 +0000)]
Add a roff comment saying that X509_certificate_type(3) is intentionally
undocumented.  It is archaic and practically unused and unusable.
tb@ and jsing@ agree with marking it as undocumented.
Put the comment here because EVP_PKEY_base_id(3) is a viable alternative.

3 years agocall the API function X509_NAME_cmp(3) instead of the obsolete,
schwarze [Fri, 2 Jul 2021 11:15:12 +0000 (11:15 +0000)]
call the API function X509_NAME_cmp(3) instead of the obsolete,
undocumented macro alias X509_name_cmp(3);
no binary change;
OK tb@

3 years agocall the API function X509_NAME_cmp(3) instead of the obsolete,
schwarze [Fri, 2 Jul 2021 11:15:08 +0000 (11:15 +0000)]
call the API function X509_NAME_cmp(3) instead of the obsolete,
undocumented macro alias X509_name_cmp(3);
no change to the assembler code generated by the compiler;
OK tb@

3 years agoAdd a roff comment saying that X509_name_cmp(3) is intentionally
schwarze [Fri, 2 Jul 2021 10:50:39 +0000 (10:50 +0000)]
Add a roff comment saying that X509_name_cmp(3) is intentionally
undocumented because it is almost unused in real-world code.
OK tb@

3 years agoCleanup early bootstrap code. This mostly realigns the code with the
kettenis [Fri, 2 Jul 2021 10:42:22 +0000 (10:42 +0000)]
Cleanup early bootstrap code.  This mostly realigns the code with the
FreeBSD code from which it was derived.  In particular, it uses the same
trick to switch page tables as FreeBSD, which is what we use to spin up
the secondary CPUs already.  This avoids having to install a temporary
1:1 mapping.

ok mlarkin@

3 years agoOnly do TLB shootdown on CPUs where a pmap is active. Only make SBI calls
kettenis [Fri, 2 Jul 2021 08:53:28 +0000 (08:53 +0000)]
Only do TLB shootdown on CPUs where a pmap is active.  Only make SBI calls
that do a remote SFENCE.VMA or FENCE.I if the set of hart IDs isn't empty.
This significantly speeds things up.

ok jsg@

3 years agoRun SBI calls to to get mvendorid/marchid/mimplid on the actual CPU we're
kettenis [Fri, 2 Jul 2021 08:44:37 +0000 (08:44 +0000)]
Run SBI calls to to get mvendorid/marchid/mimplid on the actual CPU we're
probing and decode mvendorid and marchid.

ok mlarkin@, deraadt@, jsg@

3 years agoRemove obsolete comments about SSHv1 auth methods. ok djm@
dtucker [Fri, 2 Jul 2021 07:20:44 +0000 (07:20 +0000)]
Remove obsolete comments about SSHv1 auth methods.  ok djm@

3 years agoRemove references to ChallengeResponseAuthentication in favour of
dtucker [Fri, 2 Jul 2021 05:11:20 +0000 (05:11 +0000)]
Remove references to ChallengeResponseAuthentication in favour of
KbdInteractiveAuthentication.  The former is what was in SSHv1, the
latter is what is in SSHv2 (RFC4256) and they were treated as somewhat
but not entirely equivalent.  We retain the old name as deprecated alias
so config files continue to work and a reference in the man page for
people looking for it.

Prompted by bz#3303 which pointed out the discrepancy between the two
when used with Match.  Man page help & ok jmc@, with & ok djm@

3 years ago__remq.S will be needed soon.
deraadt [Fri, 2 Jul 2021 03:10:19 +0000 (03:10 +0000)]
__remq.S will be needed soon.

3 years agodelete sbin/restore
deraadt [Thu, 1 Jul 2021 20:34:19 +0000 (20:34 +0000)]
delete sbin/restore

3 years agoMerge SSL_METHOD_INTERNAL into SSL_METHOD.
jsing [Thu, 1 Jul 2021 17:53:39 +0000 (17:53 +0000)]
Merge SSL_METHOD_INTERNAL into SSL_METHOD.

Now that SSL_METHOD is opaque and in internal headers, we can remove
SSL_METHOD_INTERNAL by merging it back into SSL_METHOD.

ok tb@

3 years agoPrevent athn(4) from calling ieee80211_find_rxnode() on bad frames.
stsp [Thu, 1 Jul 2021 11:51:55 +0000 (11:51 +0000)]
Prevent athn(4) from calling ieee80211_find_rxnode() on bad frames.

This fixes an issue introduced with our workaround for bogus michael
mic failures seen when hardware receives control frames. We do need
to ignore the michael mic failure in this case but we should not call
ieee80211_find_rxnode() on such frames unconditionally. Do this only
if the transmitter's address has already been cached.

When ieee80211_find_rxnode() is called with an unknown source MAC address
it will create a new entry in the node cache. Frames flagged as incorrectly
received by hardware should not be passed to ieee80211_find_rxnode() without
further verification to avoid creating bogus cache entries based on corrupt
frame headers.

Prompted by an issue seen by kettenis@ on arm64 where the node cache
contains bogus entries. This change doesn't fix the issue but it is
a step in the right direction regardless since it fixes one possible
cause for the issue.

ok kettenis@
tested by myself and Mikolaj Kucharski

3 years agoJust in case another developer besides anton@ and myself even wants to
schwarze [Thu, 1 Jul 2021 10:22:16 +0000 (10:22 +0000)]
Just in case another developer besides anton@ and myself even wants to
look at these tests: add a comment providing a high-level picture of
what is going on here, such that everyday maintenance can be performed
without going down the rabbit hole of subr.sh and edit.c.

3 years agoWe already tested all corner cases for two-byte and three-byte UTF-8
schwarze [Thu, 1 Jul 2021 10:00:15 +0000 (10:00 +0000)]
We already tested all corner cases for two-byte and three-byte UTF-8
sequences, but coverage of four-byte sequences was incomplete, which
contributed to the recently fixed ksh(1) emacs.c bug not being found
for some time.

Consequently, add some tests covering
+ valid sequences starting with \0360, \0361, and \0363;
+ incomplete sequences starting with \0360 and \0361;
+ invalid (too low) sequences starting with \0360.

OK anton@

3 years agoremove useless and confusing log message when client has no certificate
eric [Thu, 1 Jul 2021 07:42:16 +0000 (07:42 +0000)]
remove useless and confusing log message when client has no certificate

ok millert@

3 years agoWe moved myname parsing from /etc/netstart to /etc/rc nov 2020, but
deraadt [Thu, 1 Jul 2021 01:16:13 +0000 (01:16 +0000)]
We moved myname parsing from /etc/netstart to /etc/rc nov 2020, but
this manual page wasn't corrected
from James Jerkins

3 years agoSimplify the way we track the FPU state, using powerpc64 as a model.
kettenis [Wed, 30 Jun 2021 22:20:56 +0000 (22:20 +0000)]
Simplify the way we track the FPU state, using powerpc64 as a model.
The new code still uses the clean/dirty state that the hardware reports
to optimize saving/restoring the FPU register, but no longer attempts to
keep the FPU registers alive across a context switch.  Fixes panics seen
on MP kernels.

ok drahn@

3 years agoThe byte \0363 is not invalid in UTF-8.
schwarze [Wed, 30 Jun 2021 18:55:52 +0000 (18:55 +0000)]
The byte \0363 is not invalid in UTF-8.
The incorrectness of this test was exposed by the bugfix
in /usr/src/bin/ksh/emacs.c rev. 1.88 and reported to me by bluhm@.
This is a minimal fix replacing the incorrect test line
with two correct tests involving the same byte.
OK anton@

3 years agomore trivial .Ar -> .Fa replacements in syscall manuals
schwarze [Wed, 30 Jun 2021 18:46:49 +0000 (18:46 +0000)]
more trivial .Ar -> .Fa replacements in syscall manuals

3 years agouse .Fa rather than .Ar; patch from me at EmilEngler dot com
schwarze [Wed, 30 Jun 2021 18:17:21 +0000 (18:17 +0000)]
use .Fa rather than .Ar; patch from me at EmilEngler dot com

3 years agoDisable some code that reaches into libssl internals.
jsing [Wed, 30 Jun 2021 18:11:47 +0000 (18:11 +0000)]
Disable some code that reaches into libssl internals.

This should be moved to a dedicated regress test.

3 years agoDisable some tests that probably no longer make sense.
jsing [Wed, 30 Jun 2021 18:10:42 +0000 (18:10 +0000)]
Disable some tests that probably no longer make sense.

We'll either fix these or remove them in the near future.

3 years agoPull in ssl_locl.h to allow for move of struct ssl_session_st.
jsing [Wed, 30 Jun 2021 18:09:46 +0000 (18:09 +0000)]
Pull in ssl_locl.h to allow for move of struct ssl_session_st.

3 years agoPrepare to provide SSL_get_signature_nid() and friends.
jsing [Wed, 30 Jun 2021 18:07:50 +0000 (18:07 +0000)]
Prepare to provide SSL_get_signature_nid() and friends.

This adds functionality for SSL_get_signature_nid(),
SSL_get_peer_signature_nid(), SSL_get_signature_type_nid() and
SSL_get_peer_signature_type_nid().

This is not currently publicly visible and will be exposed at a later
date.

ok inoguchi@ tb@

3 years agoMove some structs from public to private headers.
jsing [Wed, 30 Jun 2021 18:04:05 +0000 (18:04 +0000)]
Move some structs from public to private headers.

Move struct ssl_cipher_st, struct ssl_method_st, struct ssl_session_st and
struct ssl3_state_st from public to private headers. These are already
under #ifdef LIBRESSL_INTERNAL and are no longer publicly visible.

ok inoguchi@ tb@

3 years ago... way too much white space!
claudio [Wed, 30 Jun 2021 15:24:10 +0000 (15:24 +0000)]
... way too much white space!

3 years agoRemove splnet() from ifnewlladdr(), it is not needed anymore.
bluhm [Wed, 30 Jun 2021 13:23:33 +0000 (13:23 +0000)]
Remove splnet() from ifnewlladdr(), it is not needed anymore.
Add asserts and comments for the locks that are necessary.
discussed with dlg@ mpi@ mvs@; tested by Hrvoje Popovski; OK mpi@

3 years agoRemove TODO.md, this file is not up-to-date and also not really a good
claudio [Wed, 30 Jun 2021 13:16:45 +0000 (13:16 +0000)]
Remove TODO.md, this file is not up-to-date and also not really a good
todo list for rsync.

3 years agoReplace Id: tags with OpenBSD: tags
claudio [Wed, 30 Jun 2021 13:10:04 +0000 (13:10 +0000)]
Replace Id: tags with OpenBSD: tags
OK deraadt@

3 years agoRemove unused variable cryptodesc_pool. Document global variables
bluhm [Wed, 30 Jun 2021 12:21:02 +0000 (12:21 +0000)]
Remove unused variable cryptodesc_pool.  Document global variables
in crypto.c and annotate locking protection.  Assert kernel lock
where needed.  Remove dead code from crypto_get_driverid().  Move
crypto_init() prototype into header file.
OK mpi@

3 years agogrow ramdisk area due to increased firmware sizes..
deraadt [Wed, 30 Jun 2021 12:19:00 +0000 (12:19 +0000)]
grow ramdisk area due to increased firmware sizes..
ok jsg

3 years agouse @ to silently execute "exec make"
deraadt [Wed, 30 Jun 2021 11:50:22 +0000 (11:50 +0000)]
use @ to silently execute "exec make"

3 years agoFor path MTU discovery tcp_mtudisc() should resend a TCP packet by
bluhm [Wed, 30 Jun 2021 11:26:49 +0000 (11:26 +0000)]
For path MTU discovery tcp_mtudisc() should resend a TCP packet by
calling tcp_output() if the TCP maximum segment size changes.  But
that did not work, as the new value was compared before tcp_mss()
had a chance to modify it.  Move the comparison and change it from
not equal to greater than.  It makes only sense to resend a packet
immediately if it becomes smaller and is more likely to fit.
OK sashan@ tobhe@

3 years agoTLS error messages have changed slightly, adapt regex for expected
bluhm [Wed, 30 Jun 2021 10:11:36 +0000 (10:11 +0000)]
TLS error messages have changed slightly, adapt regex for expected
logs in syslogd regress.

3 years agodocument and deprecate the macros X509_extract_key(3)
schwarze [Wed, 30 Jun 2021 10:06:43 +0000 (10:06 +0000)]
document and deprecate the macros X509_extract_key(3)
and X509_REQ_extract_key(3), using feedback from tb@ and jsing@

3 years agoCorrect sigalg hash usage when signing content for client verify.
jsing [Wed, 30 Jun 2021 09:59:07 +0000 (09:59 +0000)]
Correct sigalg hash usage when signing content for client verify.

This was inadvertently broken during sigalgs refactoring.

3 years agoAlign HT protection flags we send to iwx(4) firmware with flags used by
stsp [Wed, 30 Jun 2021 09:47:57 +0000 (09:47 +0000)]
Align HT protection flags we send to iwx(4) firmware with flags used by
Linux iwlwifi.

Setting the FAT protection flag while we're using 20 MHz channels doesn't
really make a lot of sense to me but apparently firmware expects it to be
set regardless. Linux does not use the SELF_CTS_EN flag so it might be better
to avoid using SELF_CTS_EN.

According to zxystd from OpenIntelWireless, the same change fixed fatal
firmware errors seen during HT protection updates for them:
https://github.com/OpenIntelWireless/itlwm/commit/032a14185a434b7181c0e78a953dc2e1c21a0853

test and ok gnezdo@

3 years agoMake the iwx(4) mac context task send its command only if we are still in
stsp [Wed, 30 Jun 2021 09:47:20 +0000 (09:47 +0000)]
Make the iwx(4) mac context task send its command only if we are still in
RUN state when the task gets to run. Fixes fatal firmware errors where
mac context updates were erroneously sent in states other than RUN state.

Additionally, avoid scheduling a mac context task if a pending newstate
task is going to move us out of RUN state anyway.

Issue debugged by zxystd in OpenIntelWireless itlwm; patch by me.

3 years agoMake Tx-done interrupt processing in iwx(4) more similar to iwlwifi.
stsp [Wed, 30 Jun 2021 09:46:46 +0000 (09:46 +0000)]
Make Tx-done interrupt processing in iwx(4) more similar to iwlwifi.

When iwx(4) takes a frame off the queue we used the ring index reported
by firmware to figure out which frame can be taken off the ring.
This logic was inherited from iwn(4).

We have sometimes seen an index get skipped and had a workaround in place
where we took all pending frames up to this index off the ring.

Apart from the ring index the firmware reports another value which is its
starting sequence number (SSN). An SSN is usually associated with a Tx
aggregation queue that uses block ack. On non-aggregation queues the SSN
matches the ring index most of the time and hence seems redundant at first
sight. But the values are not always the same.

We now always use the SSN as the upper bound which matches the Linux driver.

This seems to fix fatal firmware errors during Tx commands seen by jcs@
which suggests that we were sometimes taking frames off the ring too early.

3 years agoFix Tx queue flushing in iwm(4).
stsp [Wed, 30 Jun 2021 09:45:47 +0000 (09:45 +0000)]
Fix Tx queue flushing in iwm(4).

iwm(4) was still using an outdated version of the TX_FLUSH command.
Current firmware expects a different version which has the same size but
different semantics. The iwx(4) driver is already using the new version.

Also do not log errors if flushing Tx queues fails. This can happen if
the AP disappeared. Just cope by resetting the device and clearing rings.

Should fix "flushing Tx queues failed" and related firmware errors.

3 years agoAlign HT protection flags we send to iwm(4) firmware with flags used by
stsp [Wed, 30 Jun 2021 09:44:56 +0000 (09:44 +0000)]
Align HT protection flags we send to iwm(4) firmware with flags used by
Linux iwlwifi.

Setting the FAT protection flag while we're using 20 MHz channels doesn't
really make a lot of sense to me but apparently firmware expects it to be
set regardless. Linux does not use the SELF_CTS_EN flag so it might be better
to avoid using SELF_CTS_EN.

According to zxystd from OpenIntelWireless, the same change fixed fatal
firmware errors seen during HT protection updates for them:
https://github.com/OpenIntelWireless/itlwm/commit/032a14185a434b7181c0e78a953dc2e1c21a0853

test and ok gnezdo@

3 years agoMake the iwm(4) mac context task send its command only if we are still in
stsp [Wed, 30 Jun 2021 09:43:59 +0000 (09:43 +0000)]
Make the iwm(4) mac context task send its command only if we are still in
RUN state when the task gets to run. Fixes fatal firmware errors where
mac context updates were erroneously sent in states other than RUN state.

Additionally, avoid scheduling a mac context task if a pending newstate
task is going to move us out of RUN state anyway.

Issue debugged by zxystd in OpenIntelWireless itlwm; patch by me.

3 years agoMake Tx-done interrupt processing in iwm(4) more similar to iwlwifi.
stsp [Wed, 30 Jun 2021 09:42:22 +0000 (09:42 +0000)]
Make Tx-done interrupt processing in iwm(4) more similar to iwlwifi.

When iwm(4) takes a frame off a non-aggregation queue we used the ring index
reported by firmware to figure out which frame can be taken off the ring.
This logic was inherited from iwn(4).

We have sometimes seen an index get skipped and had a workaround in place
where we took all pending frames up to this index off the ring.

Apart from the ring index the firmware reports another value which is its
starting sequence number (SSN). An SSN is usually associated with a Tx
aggregation queue that uses block ack. On non-aggregation queues the SSN
matches the ring index most of the time and hence seems redundant at first
sight. But the values are not always the same.

We now always use the SSN as the upper bound which matches the Linux driver.

This seems to fix fatal firmware errors during Tx commands seen by jcs@
which suggests that we were sometimes taking frames off the ring too early.

The ring index is still used to feed information about a frame to the Tx
rate control algorithm but no longer determines when frames are taken off
the ring.

test and ok jcs@

3 years agoadd missing call to sbi_remote_fence_i()
jsg [Wed, 30 Jun 2021 07:39:05 +0000 (07:39 +0000)]
add missing call to sbi_remote_fence_i()

ok kettenis@

3 years agoMULTIPTOCESSOR -> MULTIPROCESSOR
jsg [Wed, 30 Jun 2021 01:08:10 +0000 (01:08 +0000)]
MULTIPTOCESSOR -> MULTIPROCESSOR

ok deraadt@

3 years agosync
deraadt [Tue, 29 Jun 2021 22:41:12 +0000 (22:41 +0000)]
sync

3 years agoinclude bsd.mp (but don't change isntall.md to choose it yet)
deraadt [Tue, 29 Jun 2021 22:03:50 +0000 (22:03 +0000)]
include bsd.mp (but don't change isntall.md to choose it yet)

3 years agobuild bsd.mp
deraadt [Tue, 29 Jun 2021 22:03:30 +0000 (22:03 +0000)]
build bsd.mp

3 years agoDidn't intend to commit the CPU_IS_RUNNING() changes just yet, so revert
kettenis [Tue, 29 Jun 2021 21:31:49 +0000 (21:31 +0000)]
Didn't intend to commit the CPU_IS_RUNNING() changes just yet, so revert
those bits.

3 years agoSMP support. Mostly works, but occasionally craps out during boot.
kettenis [Tue, 29 Jun 2021 21:27:52 +0000 (21:27 +0000)]
SMP support.  Mostly works, but occasionally craps out during boot.

ok drahn@

3 years agowhitespace
kettenis [Tue, 29 Jun 2021 19:58:21 +0000 (19:58 +0000)]
whitespace

3 years agosync
deraadt [Tue, 29 Jun 2021 19:57:23 +0000 (19:57 +0000)]
sync

3 years agoPull sigalg selection up into ssl3_send_client_verify().
jsing [Tue, 29 Jun 2021 19:56:11 +0000 (19:56 +0000)]
Pull sigalg selection up into ssl3_send_client_verify().

This means that we do sigalg selection for all cases, including those
where are are not sending sigalgs. This is needed in order to track our
signature type in legacy cases.

ok tb@

3 years agoTrack sigalg used by ourselves and our peer in the legacy stack.
jsing [Tue, 29 Jun 2021 19:43:15 +0000 (19:43 +0000)]
Track sigalg used by ourselves and our peer in the legacy stack.

This is needed for upcoming API additions.

3 years agoPull up and dedup the TLS version check in ssl_sigalg_pkey_ok().
jsing [Tue, 29 Jun 2021 19:36:14 +0000 (19:36 +0000)]
Pull up and dedup the TLS version check in ssl_sigalg_pkey_ok().

Suggested by tb@

3 years agoSimplify RSA PSS key size comment.
jsing [Tue, 29 Jun 2021 19:33:46 +0000 (19:33 +0000)]
Simplify RSA PSS key size comment.

Wording provided by tb@

3 years agoUse appropriate TLS version when building client sigalg extensions.
jsing [Tue, 29 Jun 2021 19:31:16 +0000 (19:31 +0000)]
Use appropriate TLS version when building client sigalg extensions.

Only use the minimum TLS version to when building a signature algorithms
extension for a ClientHello - in all other cases we should be using the
negotiated TLS version.

ok inoguchi@ tb@

3 years agoChange ssl_sigalg_from_value() to take SSL * instead of a TLS version.
jsing [Tue, 29 Jun 2021 19:29:16 +0000 (19:29 +0000)]
Change ssl_sigalg_from_value() to take SSL * instead of a TLS version.

This simplifies callers, as only the negotiated TLS version needs to be
used here.

Requested by tb@

3 years agoMake various sigalg functions static now that they're only used internally.
jsing [Tue, 29 Jun 2021 19:25:59 +0000 (19:25 +0000)]
Make various sigalg functions static now that they're only used internally.

3 years agoConvert legacy stack server to ssl_sigalg_for_peer().
jsing [Tue, 29 Jun 2021 19:24:07 +0000 (19:24 +0000)]
Convert legacy stack server to ssl_sigalg_for_peer().

ok inoguchi@ tb@

3 years agoConvert legacy stack client to ssl_sigalg_for_peer().
jsing [Tue, 29 Jun 2021 19:23:36 +0000 (19:23 +0000)]
Convert legacy stack client to ssl_sigalg_for_peer().

ok inoguchi@ tb@

3 years agoProvide a ssl_sigalg_for_peer() function and use in the TLSv1.3 code.
jsing [Tue, 29 Jun 2021 19:20:39 +0000 (19:20 +0000)]
Provide a ssl_sigalg_for_peer() function and use in the TLSv1.3 code.

Provide an ssl_sigalg_for_peer() function that knows how to figure out
which signature algorithm should be used for a peer provided signature,
performing appropriate validation to ensure that the peer provided value
is suitable for the protocol version and key in use.

In the TLSv1.3 code, this replaces the need for separate calls to lookup
the sigalg from the peer provided value, then perform validation.

ok inoguchi@ tb@

3 years agoMove the RSA-PSS check for TLSv1.3 to ssl_sigalg_pkey_ok().
jsing [Tue, 29 Jun 2021 19:10:08 +0000 (19:10 +0000)]
Move the RSA-PSS check for TLSv1.3 to ssl_sigalg_pkey_ok().

Also, rather than passing in a check_curve flag, pass in the SSL * and
handle version checks internally to ssl_sigalg_pkey_ok(), simplifying
the callers.

ok inoguchi@ tb@

3 years agoFactor out handling of legacy default signature algorithms.
jsing [Tue, 29 Jun 2021 18:59:25 +0000 (18:59 +0000)]
Factor out handling of legacy default signature algorithms.

In the case of TLSv1.0 and TLSv1.1 there is no signature algorithms
extension and default signature algorithms are used - similar applies to
TLSv1.2 when the signature algorithms extension has been omitted.

ok inoguchi@ tb@

3 years agoMop up now unused variables.
jsing [Tue, 29 Jun 2021 18:55:47 +0000 (18:55 +0000)]
Mop up now unused variables.

3 years agoRequire a ServerHello following a HelloRetryRequest to use the same cipher.
jsing [Tue, 29 Jun 2021 18:47:15 +0000 (18:47 +0000)]
Require a ServerHello following a HelloRetryRequest to use the same cipher.

RFC 8446 section 4.1.4 requires that the client ensure the cipher suite
in the TLSv1.3 HelloRetryRequest and subsequent ServerHello is the same.

Reported via GitHub issue #675.

ok inoguchi@ tb@

3 years agodelete pre-EFI boot kernel location scripting
deraadt [Tue, 29 Jun 2021 18:45:41 +0000 (18:45 +0000)]
delete pre-EFI boot kernel location scripting
ok drahn

3 years agoReject zero-length non-application data fragments in the legacy stack.
jsing [Tue, 29 Jun 2021 18:43:49 +0000 (18:43 +0000)]
Reject zero-length non-application data fragments in the legacy stack.

Per RFC 5246 section 6.2.1, zero-length fragments are only permitted for
application data - reject all others.

Reported via GitHub issue #675.

ok inoguchi@ tb@

3 years agosync maxusers with other 64bits architectures. ok kettenis@, deraadt@.
matthieu [Tue, 29 Jun 2021 17:49:49 +0000 (17:49 +0000)]
sync maxusers with other 64bits architectures. ok kettenis@, deraadt@.

3 years agoFlip the -r RRDP switch, which went through community testing for half a year.
deraadt [Tue, 29 Jun 2021 17:43:57 +0000 (17:43 +0000)]
Flip the -r RRDP switch, which went through community testing for half a year.
Default is now to attempt RRDP first, then try RSYNC.
If problems show up, return to rsync-only behaviour with -R, and file a report.
ok claudio

3 years agomore precision because the argument is signed,
schwarze [Tue, 29 Jun 2021 16:34:52 +0000 (16:34 +0000)]
more precision because the argument is signed,
and even char is signed on some platforms;
OK millert@ jmc@

3 years agoremove unused prototype
claudio [Tue, 29 Jun 2021 16:15:37 +0000 (16:15 +0000)]
remove unused prototype
OK deraadt@

3 years agoSend AUTHENTICATION_FAILED in case of unexpected auth method or auth
tobhe [Tue, 29 Jun 2021 15:39:20 +0000 (15:39 +0000)]
Send AUTHENTICATION_FAILED in case of unexpected auth method or auth
data not being accessible.

From Claudia Priesterjahn @ achelos
ok patrick@