openbsd
3 years agoAdd test for exporting pubkey from a passphrase-protected private key.
dtucker [Fri, 23 Jul 2021 04:56:21 +0000 (04:56 +0000)]
Add test for exporting pubkey from a passphrase-protected private key.

3 years agoAdd a ForkAfterAuthentication ssh_config(5) counterpart to the
djm [Fri, 23 Jul 2021 04:04:52 +0000 (04:04 +0000)]
Add a ForkAfterAuthentication ssh_config(5) counterpart to the
ssh(1) -f flag. Last part of GHPR231 from Volker Diels-Grabsch.
ok dtucker

3 years agoAdd a StdinNull directive to ssh_config(5) that allows the config
djm [Fri, 23 Jul 2021 04:00:59 +0000 (04:00 +0000)]
Add a StdinNull directive to ssh_config(5) that allows the config
file to do the same thing as -n does on the ssh(1) commandline.
Patch from Volker Diels-Grabsch via GHPR231; ok dtucker

3 years agomake authorized_keys environment="..." directives first-match-wins
djm [Fri, 23 Jul 2021 03:57:20 +0000 (03:57 +0000)]
make authorized_keys environment="..." directives first-match-wins
and more strictly limit their maximum number; prompted by OOM
reported by OSS-fuzz (35470).

feedback and ok dtucker@

3 years agoregression test for time-limited signature keys
djm [Fri, 23 Jul 2021 03:54:55 +0000 (03:54 +0000)]
regression test for time-limited signature keys

3 years agoLet allowed signers files used by ssh-keygen(1) signatures support key
djm [Fri, 23 Jul 2021 03:37:52 +0000 (03:37 +0000)]
Let allowed signers files used by ssh-keygen(1) signatures support key
lifetimes, and allow the verification mode to specify a signature time
to check at. This is intended for use by git to support signing
objects using ssh keys. ok dtucker@

3 years agopci_intr_msix_count() is the function that drivers using multiple MSI-X
jmatthew [Fri, 23 Jul 2021 00:29:14 +0000 (00:29 +0000)]
pci_intr_msix_count() is the function that drivers using multiple MSI-X
vectors use to decide whether to use MSI-X, so make it return 0 if MSI
is not enabled for the device.

fixes problems with ix(4) on older amd64 hardware and current riscv64
ok kettenis@ dlg@

3 years agodocument X509_STORE_CTX_set_time(3) and X509_STORE_CTX_set_depth(3)
schwarze [Thu, 22 Jul 2021 19:44:30 +0000 (19:44 +0000)]
document X509_STORE_CTX_set_time(3) and X509_STORE_CTX_set_depth(3)

3 years agoMajor cleanup.
schwarze [Thu, 22 Jul 2021 19:09:26 +0000 (19:09 +0000)]
Major cleanup.
1. Fix the order of functions to match the order they occur in
application code, making the text significantly easier to follow.
2. Do not use the same argument placeholder *sk for several different
things; call the arguments *trusted, *untrusted, and *crls as
appropriate.
3. Avoid using the word "initialised" for two different concepts
in the same manual page; it was sometimes intended to mean "fill
with zeros" and sometimes "replace the zeros with useful data".
4. Generally, make the text more precise, more straightforward,
and shorter (-84 +65 lines of mdoc code).

3 years agombrfile can be const.
krw [Thu, 22 Jul 2021 18:54:17 +0000 (18:54 +0000)]
mbrfile can be const.

3 years agoSync dwctwo(4) with the NetBSD-current code base.
mglocker [Thu, 22 Jul 2021 18:32:33 +0000 (18:32 +0000)]
Sync dwctwo(4) with the NetBSD-current code base.

On the Raspberry Pi 3 Model B+ this does as a benefit:

* Enable the USB on-board Ethernet controller through mue(4).
* Enable the two USB uhub2 ports for removable devices.

Feedback incorporated from kettenis@ and jsg@.

ok kettenis@

3 years agoOnly perform the default-route-pause if there are interfaces with the
deraadt [Thu, 22 Jul 2021 18:29:47 +0000 (18:29 +0000)]
Only perform the default-route-pause if there are interfaces with the
AUTOCONF flag set.  This removes the delay for even more (strange)
static configs.
ok sthen

3 years agoDelete unused non-PIC code.
kettenis [Thu, 22 Jul 2021 18:16:13 +0000 (18:16 +0000)]
Delete unused non-PIC code.

ok mlarkin@

3 years agosmall tweak for default route checking, we don't care about the number of
sthen [Thu, 22 Jul 2021 18:09:04 +0000 (18:09 +0000)]
small tweak for default route checking, we don't care about the number of
routes, only if at least one exists, so can avoid the subshell and just use
grep -q. ok deraadt

3 years agoMake dhcpleased(8) always configure provided routes, regardless of
stsp [Thu, 22 Jul 2021 18:01:29 +0000 (18:01 +0000)]
Make dhcpleased(8) always configure provided routes, regardless of
whether the address we received in our lease is already configured.

In the case I observed, no default route was added to the routing table
even though the server provided both an address and a route option.
As it happened the leased address was already configured on the interface.
This should not prevent routing table updates, but it did.

ok florian

3 years agoSplit the functions operating on the X509_VERIFY_PARAM object out
schwarze [Thu, 22 Jul 2021 17:11:14 +0000 (17:11 +0000)]
Split the functions operating on the X509_VERIFY_PARAM object out
of X509_STORE_CTX_new(3) because i'm about to document five additional
functions of this kind and the page X509_STORE_CTX_new(3) is growing
unwieldy.

No text change yet, except that i added an introductory sentence
to the beginning of the DESCRIPTION of the new page.

3 years agoAdd sizes for free() in zlib
tb [Thu, 22 Jul 2021 16:40:19 +0000 (16:40 +0000)]
Add sizes for free() in zlib

Rebased version of a diff from miod who described it as follows:

This tries to keep diffability against upstream, hence a questionable
choice of the size type for zcfree() - but all sizes should fit in 32
bits anyway.

Since all zcfree routines used in the tree cope with NULL arguments
(including the various alloc.c used by the boot blocks), I have
simplified TRY_FREE to compensate for the growth.

Reminded by and ok mpi

3 years agodocument X509_STORE_CTX_get0_current_issuer(3)
schwarze [Thu, 22 Jul 2021 15:35:50 +0000 (15:35 +0000)]
document X509_STORE_CTX_get0_current_issuer(3)
and X509_STORE_CTX_get0_current_crl(3)

3 years agoSend rDNS proposals on ramdisks
kn [Thu, 22 Jul 2021 15:32:51 +0000 (15:32 +0000)]
Send rDNS proposals on ramdisks

Otherwise resolvd(8) will never learn nameservers and update
/etc/resolv.conf with IPv6 resolvers.

At the moment IPv6 only installations always prompt for nameservers
anyway, but that is its own bug and will be fixed soon.

This enables the upcoming fix to detect learned nameservers in the
first place.

Feedback OK florian

3 years agoMove X509_STORE_CTX_get0_cert(3) to the X509_STORE_CTX_new(3) manual.
schwarze [Thu, 22 Jul 2021 14:30:38 +0000 (14:30 +0000)]
Move X509_STORE_CTX_get0_cert(3) to the X509_STORE_CTX_new(3) manual.

OpenSSL documents it in X509_STORE_CTX_get_error(3), but it is
misplaced there.  It has nothing to do with accessing status or
error information but merely retrieves a pointer to the certificate
that the users wants to validate.  It is a companion function to
X509_STORE_CTX_init(3), X509_STORE_CTX_set_cert(3),
X509_STORE_CTX_get0_store(3), and X509_STORE_CTX_get0_untrusted(3).

While here:
1. Clarify how the new, init, verify, cleanup, and free calls interact,
and who owns the memory involved, because this is all really confusing
from the user perspective.
2. Clarify how X509_STORE_CTX_init(3), X509_STORE_CTX_set_cert(3), and
X509_STORE_CTX_set_chain(3) partially override each other.
3. Move X509_STORE_CTX_set0_untrusted(3) to the proper place because
it is the same as X509_STORE_CTX_set_chain(3).
4. Add a few missing words and improve some wordings.

3 years agoHave PRT_protected_guid() return 0/-1 like everything else
krw [Thu, 22 Jul 2021 13:30:40 +0000 (13:30 +0000)]
Have PRT_protected_guid() return 0/-1 like everything else
reporting success/failure.

No functional change.

3 years agoTweak some err() verbiage.
krw [Thu, 22 Jul 2021 13:17:59 +0000 (13:17 +0000)]
Tweak some err() verbiage.

3 years agoIn revision 1.74 of netmpls/mpls_input.c we use rtisvalid(4) to check
mvs [Thu, 22 Jul 2021 11:07:17 +0000 (11:07 +0000)]
In revision 1.74 of netmpls/mpls_input.c we use rtisvalid(4) to check
the result returned by rtalloc(4) instead of a compare with NULL. Since
it's assumed this returned `rt' could be non NULL we should use
rtfree(4) in error path. rtfree(4) also allows NULL as input.

ok claudio@

3 years agoMake kqpoll_dequeue() usable with lazy removal of knotes
visa [Thu, 22 Jul 2021 07:22:43 +0000 (07:22 +0000)]
Make kqpoll_dequeue() usable with lazy removal of knotes

Adjust kqpoll_dequeue() so that it will clear only badfd knotes when
called from kqpoll_init(). This is needed by kqpoll's lazy removal
of knotes. Eager removal in kqpoll_dequeue() would defeat kqpoll's
attempt to reuse previously established knotes under workloads where
knote activation tends to occur already before next kqpoll scan.

Prompted by mpi@

3 years agoAfter netstart, dhcpleased, and resolved are running, spin up to 10
deraadt [Thu, 22 Jul 2021 01:53:45 +0000 (01:53 +0000)]
After netstart, dhcpleased, and resolved are running, spin up to 10
seconds waiting for a default route (v4 or v6) to exist, this
increases the chance of DNS lookups working earlier.  This is done
before pf is configured, sorry we have good reasons.  Static
configurations are unaffected.  dhclient previously did this kind of
delay, and this is the lightest touch we can come up with which gives
the same effect.
While here, also start relinking earlier.
ok benno florian sthen

3 years agoA couple of missed 'const'.
krw [Wed, 21 Jul 2021 20:26:30 +0000 (20:26 +0000)]
A couple of missed 'const'.

3 years agoDocument X509_STORE_CTX_get_chain(3).
schwarze [Wed, 21 Jul 2021 15:03:45 +0000 (15:03 +0000)]
Document X509_STORE_CTX_get_chain(3).

It is deprecated, but it is still called by various application programs,
so let's better mention it.

3 years agoAlso count crypto errors in ipsec_input_cb() like IPsec output in
bluhm [Wed, 21 Jul 2021 12:23:32 +0000 (12:23 +0000)]
Also count crypto errors in ipsec_input_cb() like IPsec output in
previous commit.

3 years agoUse a dedicated struct mbr to hold the GPT protective MBR,
krw [Wed, 21 Jul 2021 12:22:54 +0000 (12:22 +0000)]
Use a dedicated struct mbr to hold the GPT protective MBR,
either the one read from disk or the default one created
when initializing GPT.

Simplifies logic, eliminates MBR_init_GPT() and demotes
MBR_protective_mbr() to a helper function called from
GPT_read().

Nuke an unused variable in passing.

No intentional functional change.

3 years agoPropagate errors from crypto_invoke() and count them in IPsec. They
bluhm [Wed, 21 Jul 2021 11:11:41 +0000 (11:11 +0000)]
Propagate errors from crypto_invoke() and count them in IPsec.  They
should not happen, but always check error conditions.  tq is never
NULL, remove the check.  tdb->tdb_odrops++ is not MP safe, but will
be addressed separately in ipsec_output_cb().
OK mvs@

3 years agosync
sthen [Wed, 21 Jul 2021 09:18:32 +0000 (09:18 +0000)]
sync

3 years agoRemove DTLS processed_rcds queue.
jsing [Wed, 21 Jul 2021 08:42:14 +0000 (08:42 +0000)]
Remove DTLS processed_rcds queue.

When DTLS handshake records are received from the next epoch, we will
potentially queue them on the unprocessed_rcds queue - this is usually
a Finished message that has been received without the ChangeCipherSuite
(CCS) message (which may have been dropped or reordered).

After the epoch increments (due to the CCS being received), the current
code processes all records on the unprocessed queue and immediate queues
them on the processed queue, which dtls1_get_record() then pulls from.
This form of processing only adds more complexity and another queue.

Instead, once the epoch increments, pull a single record from the
unprocessed queue and process it, allowing the contents to be consumed
by the caller. We repeat this process until the unprocessed queue is
empty, at which point we go back to consuming messages from the wire.

ok inoguchi@ tb@

3 years agoDo not add height twice when calculating popup_mouse_top, from M Kelly.
nicm [Wed, 21 Jul 2021 08:09:43 +0000 (08:09 +0000)]
Do not add height twice when calculating popup_mouse_top, from M Kelly.

3 years agoDo not close popups on resize, instead adjust them to fit, from Anindya
nicm [Wed, 21 Jul 2021 08:06:36 +0000 (08:06 +0000)]
Do not close popups on resize, instead adjust them to fit, from Anindya
Mukherjee.

3 years agoSilently discard invalid DTLS records.
jsing [Wed, 21 Jul 2021 07:51:12 +0000 (07:51 +0000)]
Silently discard invalid DTLS records.

Per RFC 6347 section 4.1.2.1, DTLS should silently discard invalid records,
including those that have a bad MAC. When converting to the new record
layer, we inadvertantly switched to standard TLS behaviour, where an
invalid record is fatal. This restores the previous behaviour.

Issue noted by inoguchi@

ok inoguchi@

3 years agoUse exclusive lock under /dev/, silence expected errors in installer
kn [Wed, 21 Jul 2021 03:53:50 +0000 (03:53 +0000)]
Use exclusive lock under /dev/, silence expected errors in installer

resolvd(8), slaacd(8) and dhcpleased(8) are different from other daemons
in that there must only be a single instance.

resolvd already does this, adjust slaacd and dhcpleased accordingly while
moving the lockfile paths under /dev/ such that they work early on boot and
don't run into races should /var be (un)mounted between daemon starts.

Locking is especially required in the installer where all three daemons are
started every time the "(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? "
prompt is entered, i.e. restarting installation or dropping into a shell
and back into the prompt again would start multiple instances.

To avoid expected lockfile error messages in between installer prompts,
discard standard error when starting the autoconf daemons;  none of them
has other potential failure cases in installer mode before daemon(3)izing.

Input sthen deraadt
OK deraadt

3 years agodrm/amdkfd: fix sysfs kobj leak
jsg [Wed, 21 Jul 2021 01:03:49 +0000 (01:03 +0000)]
drm/amdkfd: fix sysfs kobj leak

From Philip Yang
b3205768cd1a3a9869500ec27e129f8a71d2152a in linux 5.10.y/5.10.52
dcdb4d904b4bd3078fe8d4d24b1658560d6078ef in mainline linux

3 years agodrm/dp_mst: Add missing drm parameters to recently added call to drm_dbg_kms()
jsg [Wed, 21 Jul 2021 01:01:21 +0000 (01:01 +0000)]
drm/dp_mst: Add missing drm parameters to recently added call to drm_dbg_kms()

From Jose Souza
cae871baa4f30608dc2084ca8ddc8f7e49913721 in linux 5.10.y/5.10.52
24ff3dc18b99c4b912ab1746e803ddb3be5ced4c in mainline linux

3 years agodrm/dp_mst: Avoid to mess up payload table by ports in stale topology
jsg [Wed, 21 Jul 2021 00:59:32 +0000 (00:59 +0000)]
drm/dp_mst: Avoid to mess up payload table by ports in stale topology

From Wayne Lin
16fb4e9c39b9543efd0c3dbc3dbb8865d090646a in linux 5.10.y/5.10.52
3769e4c0af5b82c8ea21d037013cb9564dfaa51f in mainline linux

3 years agodrm/dp_mst: Do not set proposed vcpi directly
jsg [Wed, 21 Jul 2021 00:57:36 +0000 (00:57 +0000)]
drm/dp_mst: Do not set proposed vcpi directly

From Wayne Lin
3462bc8b1a1f1b507804d33d118402235e8a1fab in linux 5.10.y/5.10.52
35d3e8cb35e75450f87f87e3d314e2d418b6954b in mainline linux

3 years agodrm/i915/gt: Fix -EDEADLK handling regression
jsg [Wed, 21 Jul 2021 00:53:30 +0000 (00:53 +0000)]
drm/i915/gt: Fix -EDEADLK handling regression

From Ville Syrjala
0728df8048060e9bdedb9dd38c62782ee97184ba in linux 5.10.y/5.10.52
2feeb52859fc1ab94cd35b61ada3a6ac4ff24243 in mainline linux

3 years agodrm/i915/gtt: drop the page table optimisation
jsg [Wed, 21 Jul 2021 00:50:05 +0000 (00:50 +0000)]
drm/i915/gtt: drop the page table optimisation

From Matthew Auld
81dd2d60f677bbab622c52711a711f0f43d37458 in linux 5.10.y/5.10.52
0abb33bfca0fb74df76aac03e90ce685016ef7be in mainline linux

3 years agoadd AMD 17h/6xh Root Complex
jcs [Tue, 20 Jul 2021 18:33:59 +0000 (18:33 +0000)]
add AMD 17h/6xh Root Complex

ok brynet

3 years agoSplit X509_NAME_hash(3) out of d2i_X509_NAME(3) and document
schwarze [Tue, 20 Jul 2021 17:31:32 +0000 (17:31 +0000)]
Split X509_NAME_hash(3) out of d2i_X509_NAME(3) and document
X509_issuer_name_hash(3), X509_subject_name_hash(3), and the _old variants.

Even though this is only tangentially related to decoding and encoding,
including a single function in d2i_X509_NAME(3) was probably OK,
but let's not bog down that page with six functions that are likely
to become obsolete at some point - even though right now, they are
still being used both internally and by external software.

3 years agoTurn pipex(4) session statistics to per-CPU counters. This makes pipex(4)
mvs [Tue, 20 Jul 2021 16:44:55 +0000 (16:44 +0000)]
Turn pipex(4) session statistics to per-CPU counters. This makes pipex(4)
more compliant to bluhm@'s work on traffic forwarding parallelization.

ok yasuoka@ bluhm@

3 years agoThe current workaround to disable parallel IPsec did not work.
bluhm [Tue, 20 Jul 2021 16:32:28 +0000 (16:32 +0000)]
The current workaround to disable parallel IPsec did not work.
Variable nettaskqs must not change at runtime.  Interface input
queues choose the thread during init with ifiq_softnet = net_tq().
So it cannot be modified after pfkeyv2_send() sets the first SA in
kernel.  Also changing the calculation in net_tq() may call task_del()
with a different taskq than task_add().
Instead of restricting the index to the first softnet task, use an
exclusive lock.  For now just move the comment.  We can later decide
if a write net lock or kernel lock is better.
OK mvs@

3 years agoAdd the 7265-17 image back into the list of firmware used by iwm(4).
stsp [Tue, 20 Jul 2021 16:01:52 +0000 (16:01 +0000)]
Add the 7265-17 image back into the list of firmware used by iwm(4).

3 years agoDo not attempt to load 7265D iwm(4) firmware on all 7265 devices.
stsp [Tue, 20 Jul 2021 16:00:47 +0000 (16:00 +0000)]
Do not attempt to load 7265D iwm(4) firmware on all 7265 devices.

There are several variants of 7265 devices, all of which share a PCI ID.
7265D devices can be told apart by looking at the hardware revision number.
Non-D 7265 devices won't load 7265D firmware. Load the 7265-17 image instead.

Problem reported and fix tested on a non-D 7265 by Tilo Stritzky.
Tested on a 7265D by myself.

3 years agoUse installboot -p such that the right partition will be newfs'ed.
kettenis [Tue, 20 Jul 2021 15:25:48 +0000 (15:25 +0000)]
Use installboot -p such that the right partition will be newfs'ed.

ok krw@, deraadt@

3 years agoAdd -p option to "prepare" (newfs) a filesystem that will be used for
kettenis [Tue, 20 Jul 2021 14:51:56 +0000 (14:51 +0000)]
Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader.  This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@

3 years agoMake iwm_init() call iwm_stop() if we fail to move into SCAN state.
stsp [Tue, 20 Jul 2021 14:44:37 +0000 (14:44 +0000)]
Make iwm_init() call iwm_stop() if we fail to move into SCAN state.

Generally, iwm_init() must either succeed or reset everything. In the case
I observed, the missing call to iwm_stop() left us with a non-zero refcount
for the newstate task which failed to perform the INIT -> SCAN transition.
The next ioctl request from userspace would then trigger a KASSERT in
iwm_init() which checks for old tasks that haven't run to completion.

This problem won't happen under normal conditions. It will happen if
the firmware crashes in response to a bad scan command, for instance.
I ran into this while working on support for newer iwx(4) firmware.

3 years agoMake iwx_init() call iwx_stop() if we fail to move into SCAN state.
stsp [Tue, 20 Jul 2021 14:44:09 +0000 (14:44 +0000)]
Make iwx_init() call iwx_stop() if we fail to move into SCAN state.

Generally, iwx_init() must either succeed or reset everything. In the case
I observed, the missing call to iwx_stop() left us with a non-zero refcount
for the newstate task which failed to perform the INIT -> SCAN transition.
The next ioctl request from userspace would then trigger a KASSERT in
iwx_init() which checks for old tasks that haven't run to completion.

This problem won't happen under normal conditions. It will happen if
the firmware crashes in response to a bad scan command, for instance.
I ran into this while working on support for newer iwx(4) firmware.

3 years agosync
deraadt [Tue, 20 Jul 2021 13:36:42 +0000 (13:36 +0000)]
sync

3 years agoAlso add missing -V to usage
claudio [Tue, 20 Jul 2021 12:08:53 +0000 (12:08 +0000)]
Also add missing -V to usage

3 years agoAdd -V to usage. Reported by Pier Carlo Chiodi.
claudio [Tue, 20 Jul 2021 12:07:46 +0000 (12:07 +0000)]
Add -V to usage. Reported by Pier Carlo Chiodi.

3 years agoCheck pointer variable if it is NULL in ca.c
inoguchi [Tue, 20 Jul 2021 12:04:53 +0000 (12:04 +0000)]
Check pointer variable if it is NULL in ca.c

missed with r1.32

3 years agoSimplify DHCP lease file parer after switch to dhcpleased
kn [Tue, 20 Jul 2021 11:20:09 +0000 (11:20 +0000)]
Simplify DHCP lease file parer after switch to dhcpleased

dhcpleased(8)'s lease files are much simpler than dhclient.leases(5):
- exactly one lease per file (not many)
- only option lines (not statement, declaration, etc.)
- every option/value is separated by a single ": " (no optional leading
  "option ")
- values are not quoted or escaped (like dhclient does)

lease_value() is hard to read, mostly because it strips optional double
quotes around option values as was required with dhclient.

dhclient VIS_ALL's values if they contain backticks, backslashes and
other characters, otherwise it VIS_SAFE's (and optionally quotes them).

dhcpleased VIS_SAFE's all value strings equally.

All install.sub users of lease_value() quote its output so they should
be safe without any special unescaping as previously done.

OK florian

3 years agoRemove bogus use of CPU_MAXID and get cpu_info only once.
visa [Tue, 20 Jul 2021 07:53:39 +0000 (07:53 +0000)]
Remove bogus use of CPU_MAXID and get cpu_info only once.

3 years agoRemove unneeded __sync_* library functions from the kernel.
visa [Tue, 20 Jul 2021 07:51:08 +0000 (07:51 +0000)]
Remove unneeded __sync_* library functions from the kernel.

These library functions were added as stopgaps because GCC 4.2.1
lacks the corresponding __sync_* builtins on mips64. However,
the builtins are now provided by Clang.

3 years agoFix trailing whitespace in a few places.
mlarkin [Tue, 20 Jul 2021 00:41:54 +0000 (00:41 +0000)]
Fix trailing whitespace in a few places.

No code change.

3 years agoTweak one comment and nuke a bunch of pointless ones.
krw [Mon, 19 Jul 2021 23:24:54 +0000 (23:24 +0000)]
Tweak one comment and nuke a bunch of pointless ones.

3 years agoAbstract reading the built-in MBR or MBR file into
krw [Mon, 19 Jul 2021 19:46:20 +0000 (19:46 +0000)]
Abstract reading the built-in MBR or MBR file into
a separate function.

No functional change.

3 years agoMBR_protective_mbr() can take a const struct mbr *.
krw [Mon, 19 Jul 2021 19:30:35 +0000 (19:30 +0000)]
MBR_protective_mbr() can take a const struct mbr *.

No functional change.

3 years agoAn MBR knows (mbr_lba_self) where it is supposed to go, no
krw [Mon, 19 Jul 2021 19:23:50 +0000 (19:23 +0000)]
An MBR knows (mbr_lba_self) where it is supposed to go, no
need to pass the value to MBR_write().

Let MBR_write() do the translation from struct mbr to the
struct dos_mbr that will be written to the disk. Thus
eliminating unnecessary struct dos_mbr variables and the
parsing thereof.

No intentional functional change.

3 years agoFix an alignment fault observed on an octeon machine while pppoe(4) was
stsp [Mon, 19 Jul 2021 19:00:58 +0000 (19:00 +0000)]
Fix an alignment fault observed on an octeon machine while pppoe(4) was
attempting to negotiate a large MTU.

Copy the peer's max payload size from the discovery packet with memcpy()
instead of using a pointer to this value's offset in the packet buffer.

tweak and ok visa@
additional testing and ok sthen@

3 years agoMarkup optional ICMP/ICMP6 codes as such
kn [Mon, 19 Jul 2021 16:23:56 +0000 (16:23 +0000)]
Markup optional ICMP/ICMP6 codes as such

Only icmp(4)/icmp6(4) types are required for `icmp-type'/`icmp6-type' rules
while codes are optional.

From Martin Vahlensieck < openbsd at academicsolutions dot ch >, thanks!

3 years agoRemove `ids' from `ipsec_ids_tree' while following ipsp_ids_insert()
mvs [Mon, 19 Jul 2021 14:49:55 +0000 (14:49 +0000)]
Remove `ids' from `ipsec_ids_tree' while following ipsp_ids_insert()
error path. This fixes use-after-free issue. Also fix debug message
mistype pointed by bluhm@ in error path.

ok millert@ bluhm@

3 years agoRevert incorrect tweaks to disk geometry calculations and
krw [Mon, 19 Jul 2021 14:30:08 +0000 (14:30 +0000)]
Revert incorrect tweaks to disk geometry calculations and
non '-b' MBR disk initialization.

Detected by bluhm@'s ever vigilant regress testing.

3 years agodocument X509_CRL_print(3) and X509_CRL_print_fp(3)
schwarze [Mon, 19 Jul 2021 13:16:43 +0000 (13:16 +0000)]
document X509_CRL_print(3) and X509_CRL_print_fp(3)

3 years agodrm/i915/display: Do not zero past infoframes.vsc
jsg [Mon, 19 Jul 2021 10:51:58 +0000 (10:51 +0000)]
drm/i915/display: Do not zero past infoframes.vsc

From Kees Cook
3f9c2a058e61b8df9fef196ad6180fbf9932ed80 in linux 5.10.y/5.10.51
07b72960d2b4a087ff2445e286159e69742069cc in mainline linux

3 years agodrm/amd/display: Reject non-zero src_y and src_x for video planes
jsg [Mon, 19 Jul 2021 10:49:37 +0000 (10:49 +0000)]
drm/amd/display: Reject non-zero src_y and src_x for video planes

From Harry Wentland
c6016936171a7b179b2c478ceb7fbd092ee4f9f8 in linux 5.10.y/5.10.51
c6c6a712199ab355ce333fa5764a59506bb107c1 in mainline linux

3 years agodrm/amd/display: fix incorrrect valid irq check
jsg [Mon, 19 Jul 2021 10:47:20 +0000 (10:47 +0000)]
drm/amd/display: fix incorrrect valid irq check

From Guchun Chen
b13574fa83ac55a9c3aa7f075ef5db62b444f7b5 in linux 5.10.y/5.10.51
e38ca7e422791a4d1c01e56dbf7f9982db0ed365 in mainline linux

3 years agodrm/dp: Handle zeroed port counts in drm_dp_read_downstream_info()
jsg [Mon, 19 Jul 2021 10:45:08 +0000 (10:45 +0000)]
drm/dp: Handle zeroed port counts in drm_dp_read_downstream_info()

From Lyude Paul
2998599fb16cd99b0384d2517bbd409a233a9695 in linux 5.10.y/5.10.51
205bb69a90363541a634a662a599fddb95956524 in mainline linux

3 years agodrm/radeon: Call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64
jsg [Mon, 19 Jul 2021 10:42:27 +0000 (10:42 +0000)]
drm/radeon: Call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64

From Tiezhu Yang
0d50d93d05d6571347f3ab9d28d0b80e5d142d81 in linux 5.10.y/5.10.51
c1bfd74bfef77bcefc88d12eaf8996c0dfd51331 in mainline linux

3 years agodrm/radeon: Add the missed drm_gem_object_put() in radeon_user_framebuffer_create()
jsg [Mon, 19 Jul 2021 10:39:54 +0000 (10:39 +0000)]
drm/radeon: Add the missed drm_gem_object_put() in radeon_user_framebuffer_create()

From Jing Xiangfeng
7aa28f2f67421d7ba9957275bc211a7782238f31 in linux 5.10.y/5.10.51
9ba85914c36c8fed9bf3e8b69c0782908c1247b7 in mainline linux

3 years agodrm/amdgpu: enable sdma0 tmz for Raven/Renoir(V2)
jsg [Mon, 19 Jul 2021 10:37:21 +0000 (10:37 +0000)]
drm/amdgpu: enable sdma0 tmz for Raven/Renoir(V2)

From Aaron Liu
2674ffcad0aef41425e1a4a40d3508caed989a1a in linux 5.10.y/5.10.51
e2329e74a615cc58b25c42b7aa1477a5e3f6a435 in mainline linux

3 years agodrm/amdgpu: Update NV SIMD-per-CU to 2
jsg [Mon, 19 Jul 2021 10:35:16 +0000 (10:35 +0000)]
drm/amdgpu: Update NV SIMD-per-CU to 2

From Joseph Greathouse
8f933b27cbf1cd176f0a73ddeae19fae5e9bc189 in linux 5.10.y/5.10.51
aa6158112645aae514982ad8d56df64428fcf203 in mainline linux

3 years agodrm/amdkfd: Walk through list with dqm lock hold
jsg [Mon, 19 Jul 2021 10:33:03 +0000 (10:33 +0000)]
drm/amdkfd: Walk through list with dqm lock hold

From xinhui pan
4cd713e48c272a80af935424afaa607ea125aed4 in linux 5.10.y/5.10.51
56f221b6389e7ab99c30bbf01c71998ae92fc584 in mainline linux

3 years agodrm/amdgpu: fix bad address translation for sienna_cichlid
jsg [Mon, 19 Jul 2021 10:30:39 +0000 (10:30 +0000)]
drm/amdgpu: fix bad address translation for sienna_cichlid

From Stanley.Yang
a2122e07920456e5d43f32e61d52be59634ddcab in linux 5.10.y/5.10.51
6ec598cc9dfbf40433e94a2ed1a622e3ef80268b in mainline linux

3 years agodrm/amdkfd: Fix circular lock in nocpsch path
jsg [Mon, 19 Jul 2021 10:27:52 +0000 (10:27 +0000)]
drm/amdkfd: Fix circular lock in nocpsch path

From Amber Lin
0e72b151e394106ad3e3d5bebd1118952970047a in linux 5.10.y/5.10.51
a7b2451d31cfa2e8aeccf3b35612ce33f02371fc in mainline linux

3 years agodrm/amdkfd: fix circular locking on get_wave_state
jsg [Mon, 19 Jul 2021 10:26:13 +0000 (10:26 +0000)]
drm/amdkfd: fix circular locking on get_wave_state

From Jonathan Kim
cd29db48bb65e53efe4b05c75e575c5f1af5ddaf in linux 5.10.y/5.10.51
63f6e01237257e7226efc5087f3f0b525d320f54 in mainline linux

3 years agodrm/amd/display: Verify Gamma & Degamma LUT sizes in amdgpu_dm_atomic_check
jsg [Mon, 19 Jul 2021 10:24:06 +0000 (10:24 +0000)]
drm/amd/display: Verify Gamma & Degamma LUT sizes in amdgpu_dm_atomic_check

From Mark Yacoub
a5f8862967c453aff5b32883d1b6be8e2009e4f0 in linux 5.10.y/5.10.51
03fc4cf45d30533d54f0f4ebc02aacfa12f52ce2 in mainline linux

3 years agodrm/amdkfd: use allowed domain for vmbo validation
jsg [Mon, 19 Jul 2021 10:21:09 +0000 (10:21 +0000)]
drm/amdkfd: use allowed domain for vmbo validation

From Nirmoy Das
378c156f9dd0f0e758513c38e33311ae3e5540b2 in linux 5.10.y/5.10.51
bc05716d4fdd065013633602c5960a2bf1511b9c in mainline linux

3 years agodrm/amd/display: Fix off-by-one error in DML
jsg [Mon, 19 Jul 2021 10:19:12 +0000 (10:19 +0000)]
drm/amd/display: Fix off-by-one error in DML

From Wesley Chalmers
c71de31b2e0f4ef71cc69ba841aeac12519b3607 in linux 5.10.y/5.10.51
e4e3678260e9734f6f41b4325aac0b171833a618 in mainline linux

3 years agodrm/amd/display: Set DISPCLK_MAX_ERRDET_CYCLES to 7
jsg [Mon, 19 Jul 2021 10:17:06 +0000 (10:17 +0000)]
drm/amd/display: Set DISPCLK_MAX_ERRDET_CYCLES to 7

From Wesley Chalmers
afa06442d23d32e95e3336cf8ff366bdd8d590ee in linux 5.10.y/5.10.51
3577e1678772ce3ede92af3a75b44a4b76f9b4ad in mainline linux

3 years agodrm/amd/display: Release MST resources on switch from MST to SST
jsg [Mon, 19 Jul 2021 10:15:04 +0000 (10:15 +0000)]
drm/amd/display: Release MST resources on switch from MST to SST

From Vladimir Stempen
02f444321b3a0f3f94e34329f8aafa814c45b8e4 in linux 5.10.y/5.10.51
3f8518b60c10aa96f3efa38a967a0b4eb9211ac0 in mainline linux

3 years agodrm/amd/display: Update scaling settings on modeset
jsg [Mon, 19 Jul 2021 10:12:33 +0000 (10:12 +0000)]
drm/amd/display: Update scaling settings on modeset

From Roman Li
01d6a693196595d356f0f5e42ab155c293470676 in linux 5.10.y/5.10.51
c521fc316d12fb9ea7b7680e301d673bceda922e in mainline linux

3 years agodrm/amd/display: Fix DCN 3.01 DSCCLK validation
jsg [Mon, 19 Jul 2021 10:10:26 +0000 (10:10 +0000)]
drm/amd/display: Fix DCN 3.01 DSCCLK validation

From Nikola Cornij
57c63b47d6f188b44d93d1602bd24d8d9a9131f6 in linux 5.10.y/5.10.51
346cf627fb27c0fea63a041cedbaa4f31784e504 in mainline linux

3 years agodrm/amdgpu: remove unsafe optimization to drop preamble ib
jsg [Mon, 19 Jul 2021 10:08:03 +0000 (10:08 +0000)]
drm/amdgpu: remove unsafe optimization to drop preamble ib

From Jiansong Chen
8fa6473a61ecc9972ad543d8ba1d927d442d1f67 in linux 5.10.y/5.10.51
7d9c70d23550eb86a1bec1954ccaa8d6ec3a3328 in mainline linux

3 years agodrm/amd/display: Avoid HDCP over-read and corruption
jsg [Mon, 19 Jul 2021 10:05:24 +0000 (10:05 +0000)]
drm/amd/display: Avoid HDCP over-read and corruption

From Kees Cook
c5b518f4b98dbb2bc31b6a55e6aaa1e0e2948f2e in linux 5.10.y/5.10.51
06888d571b513cbfc0b41949948def6cb81021b2 in mainline linux

3 years agodrm/sched: Avoid data corruptions
jsg [Mon, 19 Jul 2021 10:03:08 +0000 (10:03 +0000)]
drm/sched: Avoid data corruptions

From Andrey Grodzovsky
0687411e2a8858262de2fc4a1d576016fd77292e in linux 5.10.y/5.10.51
0b10ab80695d61422337ede6ff496552d8ace99d in mainline linux

3 years agodrm/scheduler: Fix hang when sched_entity released
jsg [Mon, 19 Jul 2021 10:01:10 +0000 (10:01 +0000)]
drm/scheduler: Fix hang when sched_entity released

From Andrey Grodzovsky
5ed8c298b2e140c640af8813a490fb4d77165e97 in linux 5.10.y/5.10.51
c61cdbdbffc169dc7f1e6fe94dfffaf574fe672a in mainline linux

3 years agodrm/amd/display: fix use_max_lb flag for 420 pixel formats
jsg [Mon, 19 Jul 2021 09:58:16 +0000 (09:58 +0000)]
drm/amd/display: fix use_max_lb flag for 420 pixel formats

From Dmytro Laktyushkin
3ca86d44b9023cd96c893d6dd90aacbca90e4d74 in linux 5.10.y/5.10.51
8809a7a4afe90ad9ffb42f72154d27e7c47551ae in mainline linux

3 years agodrm/amd/amdgpu/sriov disable all ip hw status by default
jsg [Mon, 19 Jul 2021 09:55:11 +0000 (09:55 +0000)]
drm/amd/amdgpu/sriov disable all ip hw status by default

From Jack Zhang
b025bc07c94770ab5ca68a8b2ead12628c2a0698 in linux 5.10.y/5.10.51
95ea3dbc4e9548d35ab6fbf67675cef8c293e2f5 in mainline linux

3 years agodrm/amd/display: fix HDCP reset sequence on reinitialize
jsg [Mon, 19 Jul 2021 09:51:46 +0000 (09:51 +0000)]
drm/amd/display: fix HDCP reset sequence on reinitialize

From Brandon Syu
fb7479d64d77a3bb0ee992f9e450cf52d56c6b2c in linux 5.10.y/5.10.51
99c248c41c2199bd34232ce8e729d18c4b343b64 in mainline linux

3 years agosync kfd_ioctl.h with linux 5.10.y
jsg [Mon, 19 Jul 2021 09:22:32 +0000 (09:22 +0000)]
sync kfd_ioctl.h with linux 5.10.y

3 years agoUse SUDO when setting up hostkey.
dtucker [Mon, 19 Jul 2021 08:48:33 +0000 (08:48 +0000)]
Use SUDO when setting up hostkey.

3 years agoMop up dtls1_get_ccs_header() and struct ccs_header_st.
jsing [Mon, 19 Jul 2021 08:42:24 +0000 (08:42 +0000)]
Mop up dtls1_get_ccs_header() and struct ccs_header_st.

All this code does is read one byte from memory with an unknown length,
potentially being a one byte overread... and then nothing is actually done
with the value.

ok tb@

3 years agoInline DTLS1_CCS_HEADER_LENGTH rather than having a single use variable.
jsing [Mon, 19 Jul 2021 08:39:28 +0000 (08:39 +0000)]
Inline DTLS1_CCS_HEADER_LENGTH rather than having a single use variable.

ok tb@

3 years agoIncrease time margin for rekey tests. Should help reliability on very
dtucker [Mon, 19 Jul 2021 05:08:54 +0000 (05:08 +0000)]
Increase time margin for rekey tests.  Should help reliability on very
heavily loaded hosts.