openbsd
3 years agossltest.c does not need param.h
tb [Wed, 13 Oct 2021 17:02:10 +0000 (17:02 +0000)]
ssltest.c does not need param.h

From Jonas Termansen

3 years agoRemove __dead from usage() to reduce the diff needed to build LibreSSL
tb [Wed, 13 Oct 2021 17:00:35 +0000 (17:00 +0000)]
Remove __dead from usage() to reduce the diff needed to build LibreSSL
on sortix.

Prompted by a diff by Jonas Termansen

3 years agoisakmpd: remove #ifdefs for ancient OPENSSL_VERSIONs.
tb [Wed, 13 Oct 2021 16:57:43 +0000 (16:57 +0000)]
isakmpd: remove #ifdefs for ancient OPENSSL_VERSIONs.

No-one is going to build this with OpenSSL 0.9.7 or earlier, so we
can remove this code.

ok bluhm sthen (as part of a larger diff)

3 years agoisakmpd: remove libcrypto.c
tb [Wed, 13 Oct 2021 16:56:30 +0000 (16:56 +0000)]
isakmpd: remove libcrypto.c

All this does is a call to OpenSSL_add_all_algorithms(), which is
no longer needed since libbcrypto initializes itself.

ok bluhm sthen (part of a larger diff)

3 years agoProvide realpath(1)
kn [Wed, 13 Oct 2021 15:04:53 +0000 (15:04 +0000)]
Provide realpath(1)

A tiny realpath(3) wrapper to make a porter's life easier.

Feedback kettenis deraadt cheloha sthen
OK cheloha martijn deraadt

3 years agoThe function ipip_output() was registered as .xf_output() xform
bluhm [Wed, 13 Oct 2021 14:36:31 +0000 (14:36 +0000)]
The function ipip_output() was registered as .xf_output() xform
function.  But was is never called via this pointer.  It would have
immediatley crashed as mp is always NULL when called via .xf_output().
Do not set .xf_output to ipip_output.  This allows to pass only the
parameters which are actually needed and the control flow is clearer.
OK mpi@

3 years agoNuke builtin_mbr.
krw [Wed, 13 Oct 2021 13:18:57 +0000 (13:18 +0000)]
Nuke builtin_mbr.

Those architectures needing either MBR boot code (amd64, i386,
landisk) or special boot partitions (macppc, loongson) have long
used /usr/mdec/mbr to provide that information.

Other architectures should not blindly write i386/amd64 boot code
into the MBR.

Fail quickly if the desired default MBR file is missing.

Prompted by deraadt@, tweak from kettenis@.

3 years agoThe kernel crypto framework sometimes returned an error, sometimes
bluhm [Wed, 13 Oct 2021 13:08:58 +0000 (13:08 +0000)]
The kernel crypto framework sometimes returned an error, sometimes
the callback was called, and sometimes both.  So the caller of that
API could not release resources correctly.
A bunch of errors can or should not happen, replace them with an
assert.  Remove redundant checks.  crypto_invoke() should not return
the error, but pass it via callback.
Some old hardware drivers keep part of their inconsistency as I
cannot test them.
OK mpi@

3 years agoAdd popup-style and popup-border-style options, from Alexis Hildebrandt
nicm [Wed, 13 Oct 2021 09:28:36 +0000 (09:28 +0000)]
Add popup-style and popup-border-style options, from Alexis Hildebrandt
in GitHub issue 2927.

3 years agoFix regress test after changing the way bgpsec pubkeys are shown and processed.
claudio [Wed, 13 Oct 2021 06:56:07 +0000 (06:56 +0000)]
Fix regress test after changing the way bgpsec pubkeys are shown and processed.
Reported by anton@

3 years agoRelax test regex, read or write error is possible.
bluhm [Tue, 12 Oct 2021 22:44:48 +0000 (22:44 +0000)]
Relax test regex, read or write error is possible.

3 years agoRemove misleading uvm reference counting that isn't actually used.
kettenis [Tue, 12 Oct 2021 18:22:04 +0000 (18:22 +0000)]
Remove misleading uvm reference counting that isn't actually used.
Make sure uvm_obj_init() is only called once.  Call uvm_obj_destroy()
when we release the GEM object that wraps an uvm object for which we
called uvm_obj_init().

ok mpi@, jsg@

3 years agoIntroduce a dummy uvm_obj_destroy() interface. This function will be
kettenis [Tue, 12 Oct 2021 18:16:51 +0000 (18:16 +0000)]
Introduce a dummy uvm_obj_destroy() interface.  This function will be
used in the near future (by mpi@) to improve the locking for uvm objects.
Introducing this function now will me allow me to call it in the
appropriate place in the drm code.

ok mpi@, jsg@

3 years agoAdd (minimal) accounting for wired pages in userland pmaps.
kettenis [Tue, 12 Oct 2021 18:06:15 +0000 (18:06 +0000)]
Add (minimal) accounting for wired pages in userland pmaps.
This enables enforcing of RLIMIT_MEMLOCK on powerpc64.

ok mpi@

3 years agomake armv7 fit again after bootblock growth; discussed with jsg
deraadt [Tue, 12 Oct 2021 16:39:22 +0000 (16:39 +0000)]
make armv7 fit again after bootblock growth; discussed with jsg

3 years agoEmit SKI in the JSON output and improve flow in x509_get_pubkey()
job [Tue, 12 Oct 2021 15:16:45 +0000 (15:16 +0000)]
Emit SKI in the JSON output and improve flow in x509_get_pubkey()

OK claudio@

3 years agoDo not extend PT_DYNAMIC segment on mips64
visa [Tue, 12 Oct 2021 14:06:04 +0000 (14:06 +0000)]
Do not extend PT_DYNAMIC segment on mips64

The IRIX-specific extension of the PT_DYNAMIC segment is not needed
by the dynamic linker on OpenBSD/mips64. Disable it so that the .dynamic
section stays at the start of the PT_DYNAMIC segment even when .dynstr,
.dynsym or .hash precedes .dynamic in the ELF file. This enables
Binutils 2.17 tools, such as strip(1), rewrite executables and shared
libraries that have been produced by LLD.

OK kettenis@

3 years agoiwm(4): revert to use firmware v17 on Intel AC 7265.
landry [Tue, 12 Oct 2021 11:20:32 +0000 (11:20 +0000)]
iwm(4): revert to use firmware v17 on Intel AC 7265.

fixes instability issues seen on X1 carbon gen3 (hw rev 0x210) by
anton@, mpi@ and myself.
diff from stsp@
ok mpi@ stsp@

3 years agoMake our old BSSID available to iwx_newstate_task() when roaming.
stsp [Tue, 12 Oct 2021 10:46:57 +0000 (10:46 +0000)]
Make our old BSSID available to iwx_newstate_task() when roaming.

ic_bss->ni_bssid has already been overwritten once we enter
iwx_newstate_task() to perform the state transitions necessary
for roaming to our new access point (RUN->AUTH->ASSOC->RUN).

We do however use the BSSID in commands sent to firmware.
Cache our BSSID in struct iwx_node such that firmware commands
keep using the old BSSID while we are still tearing things down.
Switch to the new BSSID only once we start back up in iwx_auth().
This should be consistent from the firmware's point of view.

Same fix as committed for iwm(4) recently.

3 years agoExplicitly stop iwx(4) Rx block ack when roaming between access points.
stsp [Tue, 12 Oct 2021 10:45:21 +0000 (10:45 +0000)]
Explicitly stop iwx(4) Rx block ack when roaming between access points.

This is similar to a recent fix committed to iwm(4).
Unlike iwm(4) we do not need to disable Tx aggregation queues in iwx(4).
Attempting to do so would cause fatal firmware errors.

Tested by jmc@ and myself.

3 years agoRemove code which was needed to support old firmware images from iwx(4).
stsp [Tue, 12 Oct 2021 10:44:33 +0000 (10:44 +0000)]
Remove code which was needed to support old firmware images from iwx(4).

Tested with cc-a0-63 and QuZ-a0-hr-b0-63 firmware by myself.
Tested with Qu-c0-hr-b0-63 firmware by Fredrik Engberg.

3 years agoChange responder to prefer DH group from KE payload.
tobhe [Tue, 12 Oct 2021 10:01:59 +0000 (10:01 +0000)]
Change responder to prefer DH group from KE payload.
Without this change the responder would always prefer the first DH
group configured in its policy. This would lead to invalid KE
messages that cause an additional exchange which old
implementations do not support correctly. Now we ignore the order
of DH groups in the policy and prefer the group from the policy
that matches the KE payload.

from markus@
ok patrick@

3 years agoMake sure all copies of MSCHAPv2 passphrase are zeroed after use.
tobhe [Tue, 12 Oct 2021 09:27:21 +0000 (09:27 +0000)]
Make sure all copies of MSCHAPv2 passphrase are zeroed after use.

ok patrick@

3 years agodo the matching as a last resort to handle .libs
espie [Tue, 12 Oct 2021 09:06:37 +0000 (09:06 +0000)]
do the matching as a last resort to handle .libs
fix the bug I introduced that bluhm@ et al noticed

3 years agoFix the deadlock between uvn_io() and uvn_flush() by restarting the fault.
mpi [Tue, 12 Oct 2021 07:38:22 +0000 (07:38 +0000)]
Fix the deadlock between uvn_io() and uvn_flush() by restarting the fault.

Do not allow a faulting thread to sleep on a contended vnode lock to prevent
lock ordering issues with upcoming per-uobj lock.

Also reduce the sleep value for VM_PAGER_AGAIN from 1sec to 5nsec to not add
visible slowdown when starting a multi-threaded application with threads that
fault on the same vnode (chromium, firefox, etc).

Tested by anton@, tb@, robert@ and gnezdo@

ok anton@, tb@

Reported-by: syzbot+e63407b35dff08dbee02@syzkaller.appspotmail.com
3 years agoRevert the fix for the deadlock between uvn_io() and uvn_flush().
mpi [Tue, 12 Oct 2021 07:37:42 +0000 (07:37 +0000)]
Revert the fix for the deadlock between uvn_io() and uvn_flush().

This fix (ab)use the vnode lock to serialize access to some fields of
the corresponding pages associated with UVM vnode object and this will
create new deadlocks with the introduction of a per-uobj lock.

ok anton@

3 years agoquote sudo and handle arguments
anton [Tue, 12 Oct 2021 05:42:39 +0000 (05:42 +0000)]
quote sudo and handle arguments

3 years agoFold bgpsec cert & traditional certs into same test
job [Mon, 11 Oct 2021 17:32:27 +0000 (17:32 +0000)]
Fold bgpsec cert & traditional certs into same test

3 years agoImprove BGpsec regress test
job [Mon, 11 Oct 2021 16:55:18 +0000 (16:55 +0000)]
Improve BGpsec regress test

3 years agoAdd support for BGPsec Router Certificates (RFC 8209)
job [Mon, 11 Oct 2021 16:50:03 +0000 (16:50 +0000)]
Add support for BGPsec Router Certificates (RFC 8209)

BGPsec router keys are extracted from RPKI certificates and
emitted via the JSON output in base64 encoded form.

OK tb@ claudio@

3 years agobase64_encode() should not add any newlines into the output. Because
claudio [Mon, 11 Oct 2021 16:06:36 +0000 (16:06 +0000)]
base64_encode() should not add any newlines into the output. Because
of this switch from EVP_EncodeUpdate() plus complexity to the much
simpler use of calling EVP_EncodeBlock() directly.
OK job@

3 years agodoes not need arpa/nameser.h
deraadt [Mon, 11 Oct 2021 14:32:26 +0000 (14:32 +0000)]
does not need arpa/nameser.h

3 years agoavoid arpa/nameser.h by improving the inet_pton/gethostbyaddr code to
deraadt [Mon, 11 Oct 2021 14:28:26 +0000 (14:28 +0000)]
avoid arpa/nameser.h by improving the inet_pton/gethostbyaddr code to
use struct in6_addr + struct in_addr instead of a char buffer.
ok millert

3 years agoMake positions hidden by overlays range-based rather than character-based,
nicm [Mon, 11 Oct 2021 13:27:50 +0000 (13:27 +0000)]
Make positions hidden by overlays range-based rather than character-based,
from Anindya Mukherjee.

3 years agoAdd -e flag to set environment for popup, from Alexis Hildebrandt in
nicm [Mon, 11 Oct 2021 10:55:30 +0000 (10:55 +0000)]
Add -e flag to set environment for popup, from Alexis Hildebrandt in
GitHub issue 2924.

3 years agoiwm(4) supports 40MHz channels now. Update man page CAVEATS accordingly.
stsp [Mon, 11 Oct 2021 09:39:29 +0000 (09:39 +0000)]
iwm(4) supports 40MHz channels now. Update man page CAVEATS accordingly.

3 years agoAdd support for 802.11n 40MHz channels to the iwm(4) driver.
stsp [Mon, 11 Oct 2021 09:03:22 +0000 (09:03 +0000)]
Add support for 802.11n 40MHz channels to the iwm(4) driver.

According to 11n MCS index tables our maximum data rate is now
300 Mbit/s at MCS 15, excluding protocol overhead. I have measured
up to 200Mbit/s of effective throughput on clean 5GHz channels.

The driver enables use of 40MHz channels automatically as long as the
access point announces support for such channels in its beacons.
In case 40MHz transmissions fail we ask firmware to retry with a
20MHz transmission.

There is no integration with ifconfig yet, so use of 40MHz is not yet
displayed there. In the meantime, tcpdump(8) can be used to check if
the current access point supports 40MHz:
tcpdump -n -i iwm0 -v -y IEEE802_11_RADIO -s 4096 type mgt and subtype beacon
Channel width is displayed in the HT operation information element, where
a 40MHz channels looks like this: htop=<40MHz chan X:Y ...>

Tested:
7260: florian, bcallah
7265: landry
8260: bket
8265: stsp, abieber, Matthias Schmidt, Josh Rickmar, empee on mastodon
9560: stsp

3 years agoMonitor 20/40 MHz channel width changes in beacons sent by our access point
stsp [Mon, 11 Oct 2021 09:02:01 +0000 (09:02 +0000)]
Monitor 20/40 MHz channel width changes in beacons sent by our access point
and notify drivers when the channel width has changed.

3 years agoAdd support for 40MHz channels to net80211 RA.
stsp [Mon, 11 Oct 2021 09:01:05 +0000 (09:01 +0000)]
Add support for 40MHz channels to net80211 RA.

For the moment we use either the 40MHz rate set or the 20 MHz one,
depending on whether our peer supports 40MHz channels.
If this turns out to be suboptimal we could probe the 40MHz and 20MHz
rate sets separately to detect which one works better.

The same applies to use of the short guard interval (SGI), which is
either always on or off at the moment. Again, probing for this could
be added later if needed.

3 years agoquote sudo and handle arguments
anton [Mon, 11 Oct 2021 05:46:42 +0000 (05:46 +0000)]
quote sudo and handle arguments

3 years agoInvoke ${SUDO} before env(1) and not the other way around. Otherwise,
anton [Mon, 11 Oct 2021 05:46:14 +0000 (05:46 +0000)]
Invoke ${SUDO} before env(1) and not the other way around. Otherwise,
the OBJDIR environment variable will not necesarily be preserved.

3 years agoReplace poor man's synchronization primitive (i.e. sleep) with a
anton [Mon, 11 Oct 2021 05:45:43 +0000 (05:45 +0000)]
Replace poor man's synchronization primitive (i.e. sleep) with a
wait-until-condition-is-true loop in the hopes of making these tests
less flaky.

ok benno@

3 years agoRemove unused variable
job [Sun, 10 Oct 2021 22:04:33 +0000 (22:04 +0000)]
Remove unused variable

3 years agoMake style consistent and remove an unused code path
job [Sun, 10 Oct 2021 21:57:43 +0000 (21:57 +0000)]
Make style consistent and remove an unused code path

OK tb@

3 years agoDon't advertise MSI support if we don't have an MSI interrupt controller.
kettenis [Sun, 10 Oct 2021 21:54:50 +0000 (21:54 +0000)]
Don't advertise MSI support if we don't have an MSI interrupt controller.

ok patrick@

3 years agoOnly check whether we have an MSI interrupt controller when we try to
kettenis [Sun, 10 Oct 2021 16:23:17 +0000 (16:23 +0000)]
Only check whether we have an MSI interrupt controller when we try to
establish an MSI or MSI-X interrupt.  Fixes establishing legacy INTx
interrupts on machines without a (usable) MSI interrupt controller.

ok patrick@

3 years agoApparently it is possible for firmware to indicate that SMCCC_VERSION is
kettenis [Sun, 10 Oct 2021 16:20:37 +0000 (16:20 +0000)]
Apparently it is possible for firmware to indicate that SMCCC_VERSION is
implemented but have that call return NOT_SUPPORTED.  Makes no sense,
but the SMCCC standard documents this and tells us to treat this as v1.0.
Change the code accordingly.  Turn a few checks that should always be true
into KASSERTs to keep the control flow simple.

ok patrick@

3 years agohead(1): validate all line count arguments
cheloha [Sun, 10 Oct 2021 15:57:25 +0000 (15:57 +0000)]
head(1): validate all line count arguments

We need to validate all line count option arguments, not just the last
such argument found.

While here, switch to the default strtonum(3) error message format:

<argument-name> is <errstr>: <argument-string>

Thread: https://marc.info/?l=openbsd-tech&m=163383023212104&w=2

ok millert@

3 years agoNo need to assign dl.d_nsectors to disk.dk_sectors twice.
krw [Sun, 10 Oct 2021 15:34:21 +0000 (15:34 +0000)]
No need to assign dl.d_nsectors to disk.dk_sectors twice.

Two statements on one line may have seemed clever but now it's
just confusing.

No functional change.

3 years agoIn ksh(1) emacs search-history mode, emitting a NUL character causes
halex [Sat, 9 Oct 2021 21:38:00 +0000 (21:38 +0000)]
In ksh(1) emacs search-history mode, emitting a NUL character causes
invalid matches and unexpected behaviour.

Fix this by instead making a NUL character abort the search-history mode,
leaving the handling of said input to the "ordinary" command editing.

ok tb@

3 years agodelete unneccessary arpa/nameser.h includes
deraadt [Sat, 9 Oct 2021 18:43:49 +0000 (18:43 +0000)]
delete unneccessary arpa/nameser.h includes
ok millert

3 years agoMerge upstream bug fixes
tobias [Sat, 9 Oct 2021 15:27:18 +0000 (15:27 +0000)]
Merge upstream bug fixes

- Switch http to https for upstream URL
- Fix buffer sizes and lesskey parser functions
- Fix integer overflow in bracket match function
- Fix prompt hiding feature (CTRL + P)

ok deraadt, millert

3 years agoplacing the same vnd underneath a vnd (with VNDIOCSET) is a lock violation,
deraadt [Sat, 9 Oct 2021 14:47:02 +0000 (14:47 +0000)]
placing the same vnd underneath a vnd (with VNDIOCSET) is a lock violation,
but other circumstances are also bad, so let's block all vnd on top of vnd.
While here, fix some toctou multiple-copyin of the path, and restructure
the ioctl defer all softc updates to the end.
ok mpi

3 years agoDocument that CASignatureAlgorithms, ExposeAuthInfo and PubkeyAuthOptions
dtucker [Sat, 9 Oct 2021 10:52:42 +0000 (10:52 +0000)]
Document that CASignatureAlgorithms, ExposeAuthInfo and PubkeyAuthOptions
can be used in a Match block.  Patch from eehakkin via github PR#277.

3 years agoNo need to enable bus mastering, it's already done for us.
jmatthew [Sat, 9 Oct 2021 08:38:13 +0000 (08:38 +0000)]
No need to enable bus mastering, it's already done for us.

from Brad

3 years agogrow media for additional firmwares
deraadt [Sat, 9 Oct 2021 01:01:07 +0000 (01:01 +0000)]
grow media for additional firmwares

3 years agoremove extra .El;
jmc [Fri, 8 Oct 2021 14:14:31 +0000 (14:14 +0000)]
remove extra .El;

3 years agogroup the SO_PEERCRED text more logically and mark it read only;
jmc [Fri, 8 Oct 2021 14:12:58 +0000 (14:12 +0000)]
group the SO_PEERCRED text more logically and mark it read only;
diff from chohag jtan com

ok claudio

3 years agoFix typo s/excepts/expects/
sdk [Fri, 8 Oct 2021 13:52:28 +0000 (13:52 +0000)]
Fix typo s/excepts/expects/
ok by solene@ and jmc@

diff sent by hagen@sdf.org, thanks

3 years agoRevert my previous commit to ieee80211_node.c (CVS commit Hne35XgzezGa9zmv).
stsp [Fri, 8 Oct 2021 09:22:10 +0000 (09:22 +0000)]
Revert my previous commit to ieee80211_node.c (CVS commit Hne35XgzezGa9zmv).

Sending frames from ieee80211_node_join_bss() won't work as expected.
I missed that IEEE80211_SEND_MGMT() calls if_start() immediately after
queueing the management frame. This means the probe request is being
sent in a state where, while ic_bss represents our new AP, the driver
did not yet have a chance to move the device over to our new AP.

The auth request for the new AP is sent from ieee80211_newstate() which
runs after the driver has reconfigured the device. If want to send a
probe request to the new AP then we would need to send it at that point,
before the auth frame gets sent.

3 years agocurproc can't be NULL here. So simplify code accordingly.
claudio [Fri, 8 Oct 2021 08:34:09 +0000 (08:34 +0000)]
curproc can't be NULL here. So simplify code accordingly.
OK mpi@

3 years agoAdd tags for command aliases
kn [Fri, 8 Oct 2021 06:37:39 +0000 (06:37 +0000)]
Add tags for command aliases

Make ":tnew" work, i.e. bring the reader to the definition of the full
"new-window" command aliased as "new" just like ":tnew-window" would.

OK nicm

3 years agohonor objdir
anton [Thu, 7 Oct 2021 15:20:35 +0000 (15:20 +0000)]
honor objdir

3 years agoPrint the name of the symbol that can't be resolved when using
jcs [Thu, 7 Oct 2021 14:47:32 +0000 (14:47 +0000)]
Print the name of the symbol that can't be resolved when using
LD_DEBUG

ok mpi, kn

3 years agoremove quirks for ALC887 because they were only causing trouble on my
robert [Thu, 7 Oct 2021 14:11:32 +0000 (14:11 +0000)]
remove quirks for ALC887 because they were only causing trouble on my
machine at least; let's see how others are; ok ratchov@

3 years agoUse correct index variable.
kettenis [Thu, 7 Oct 2021 13:34:20 +0000 (13:34 +0000)]
Use correct index variable.

pointed out by patrick@ (with the help of clang)
ok patrick@

3 years agoRemove unused TLB routines.
visa [Thu, 7 Oct 2021 13:08:17 +0000 (13:08 +0000)]
Remove unused TLB routines.

3 years agoMake sure BGPsec router certs don't have a SIA
job [Thu, 7 Oct 2021 12:59:29 +0000 (12:59 +0000)]
Make sure BGPsec router certs don't have a SIA

OK claudio@

3 years agoRemove struct members that were used by the R4000 EoP workaround.
visa [Thu, 7 Oct 2021 12:40:16 +0000 (12:40 +0000)]
Remove struct members that were used by the R4000 EoP workaround.

3 years agoUse tabs instead of spaces.
visa [Thu, 7 Oct 2021 12:32:10 +0000 (12:32 +0000)]
Use tabs instead of spaces.

3 years agoRemove a stale comment.
visa [Thu, 7 Oct 2021 12:31:03 +0000 (12:31 +0000)]
Remove a stale comment.

3 years agoSend a probe request to our new AP when we are about to roam to it.
stsp [Thu, 7 Oct 2021 12:26:09 +0000 (12:26 +0000)]
Send a probe request to our new AP when we are about to roam to it.

Tested by fkr on iwx ax200/ax201 and myself on iwm 8265.
Also tested by florian and bket as part of a larger diff.

ok mpi@

3 years agoCall normalize_dn() on the newly added namespace so that later compares
claudio [Thu, 7 Oct 2021 11:35:30 +0000 (11:35 +0000)]
Call normalize_dn() on the newly added namespace so that later compares
with normalized basedns work. Seems all other DN attributes in parse.y
pass through normalize_dn() so this seems to be the last one missing out.
With this configs using capitalized namespace DN like o=OpenBSD,c=CA
will actually work.
OK kn@ gsoares@

3 years agoChange host() error check to the more simple for of != 1.
claudio [Thu, 7 Oct 2021 11:32:36 +0000 (11:32 +0000)]
Change host() error check to the more simple for of != 1.
Host() return 1 on success and 0 or -1 on failure.
OK kn@ gsoares@

3 years agoClarify error message
job [Thu, 7 Oct 2021 11:18:54 +0000 (11:18 +0000)]
Clarify error message

OK benno@

3 years agoReplace the ugly openssl11 hack for the missing ASN1_time_parse() and
claudio [Thu, 7 Oct 2021 10:34:39 +0000 (10:34 +0000)]
Replace the ugly openssl11 hack for the missing ASN1_time_parse() and
ASN1_time_tm_cmp() functions with another hack that is considerably
more horrible but also less intrusive.

3 years agoRemove the assertion that `curproc' must be SONPROC if found on the sleepqueue.
mpi [Thu, 7 Oct 2021 08:51:00 +0000 (08:51 +0000)]
Remove the assertion that `curproc' must be SONPROC if found on the sleepqueue.

If `curproc' finds itself on the sleepqueue inside wakeup(9) it is obviously
being executed.  Such wakeup(9) currently happens inside the critical section
of the SCHED_LOCK(), generally before cpu_switchto().  However `p_stat' is
changed many operations before cpu_switchto() and the KASSERT() isn't helpful
at catching real bugs.

One example of this is a call to rwsleep() that calls wakeup() via rw_exit()
before sleep_finish(), contented futex(2) triggers that a lot.

Another example are dt(4)'s scheduler TRACEPOINT() in setrunqueue() and
mi_switch().

Suggested by and ok kettenis@

3 years agoRework X509 verification a bit. Remove the store and instead pass in
claudio [Thu, 7 Oct 2021 08:36:17 +0000 (08:36 +0000)]
Rework X509 verification a bit. Remove the store and instead pass in
the chain for certificates via X509_STORE_CTX_set0_trusted_stack().
To make this work alter build_chains() to also return the root TA.
Factor out get_crl() from build_crls() and use it to fetch the crl
when validating roas. The crl now sets its expire time in struct crl
and this can be used to set the expire time of a ROA entry.
This simplifies proc_parser_roa() a fair bit and results in less calls
to mktime() (which is a surprisingly complex function).
OK tb@

3 years agoAdd x509_get_expire() to extract the not-after time from a certificate
claudio [Thu, 7 Oct 2021 08:30:39 +0000 (08:30 +0000)]
Add x509_get_expire() to extract the not-after time from a certificate
as a epoch time_t. Store the expire time for certs, crls will follow after.
OK tb@

3 years agomktime() may not properly set errno on error. Just use errx() instead.
claudio [Thu, 7 Oct 2021 08:28:45 +0000 (08:28 +0000)]
mktime() may not properly set errno on error. Just use errx() instead.
Noticed by benno@, OK tb@

3 years agotrapsignal() can be called without KERNEL_LOCK, adjust code accordingly.
claudio [Thu, 7 Oct 2021 08:21:22 +0000 (08:21 +0000)]
trapsignal() can be called without KERNEL_LOCK, adjust code accordingly.
OK mpi@

3 years agoMake our old BSSID available to iwm_newstate() when roaming.
stsp [Thu, 7 Oct 2021 08:15:04 +0000 (08:15 +0000)]
Make our old BSSID available to iwm_newstate() when roaming.

ic_bss->ni_bssid has already been overwritten once we enter
iwm_newstate() to perform the state transitions necessary for
roaming to our new access point (RUN->AUTH->ASSOC->RUN).

We do however use the BSSID in commands sent to firmware.
Cache our BSSID in struct iwm_node such that firmware commands
keep using the old BSSID while we are still tearing things down.
Switch to the new BSSID only once we start back up in iwm_auth().
This should be consistent from the firmware's point of view.

ok mpi@

3 years agoAdd a missing El, from Alexis Hildebrandt in GitHub issue 2918.
nicm [Thu, 7 Oct 2021 07:53:31 +0000 (07:53 +0000)]
Add a missing El, from Alexis Hildebrandt in GitHub issue 2918.

3 years agoHandle splitw -I correctly when used from an attached client, GitHub
nicm [Thu, 7 Oct 2021 07:52:13 +0000 (07:52 +0000)]
Handle splitw -I correctly when used from an attached client, GitHub
issue 2917.

3 years agodrm/i915/request: fix early tracepoints
jsg [Thu, 7 Oct 2021 03:44:00 +0000 (03:44 +0000)]
drm/i915/request: fix early tracepoints

From Matthew Auld
d35d95e8b9da638d27bce9552262e0c486138343 in linux 5.10.y/5.10.71
c83ff0186401169eb27ce5057d820b7a863455c3 in mainline linux

3 years agodrm/amdgpu: correct initial cp_hqd_quantum for gfx9
jsg [Thu, 7 Oct 2021 03:42:00 +0000 (03:42 +0000)]
drm/amdgpu: correct initial cp_hqd_quantum for gfx9

From Hawking Zhang
9f382e1edf90ae03be43dbd4976c2a332cd7ce2d in linux 5.10.y/5.10.71
9f52c25f59b504a29dda42d83ac1e24d2af535d4 in mainline linux

3 years agodrm/amd/display: Pass PCI deviceid into DC
jsg [Thu, 7 Oct 2021 03:39:35 +0000 (03:39 +0000)]
drm/amd/display: Pass PCI deviceid into DC

From Charlene Liu
c331fad63b6d527193ae8b7c056b2f10fef53c81 in linux 5.10.y/5.10.71
d942856865c733ff60450de9691af796ad71d7bc in mainline linux

3 years agoThis regress uses vnd devices to create a softraid volume. Raid levels
bluhm [Wed, 6 Oct 2021 22:59:23 +0000 (22:59 +0000)]
This regress uses vnd devices to create a softraid volume.  Raid levels
RAID 0, RAID 1, RAID 5, CRYPTO, CONCAT, RAID 1 + CRYPTO are created.
The volume disk is then mounted and stressed a little bit.

3 years agoRemove Ruby 2.6 mentions
jeremy [Wed, 6 Oct 2021 21:14:39 +0000 (21:14 +0000)]
Remove Ruby 2.6 mentions

3 years agoChange sendsig() interface so that the MD code does not need to access
claudio [Wed, 6 Oct 2021 15:46:03 +0000 (15:46 +0000)]
Change sendsig() interface so that the MD code does not need to access
data from struct process anymore. This changes how siginfo and onstack
are accessed and make sendsig() more MP friendly.
With and OK semarie@ OK kettenis@

3 years agosync
deraadt [Wed, 6 Oct 2021 14:49:08 +0000 (14:49 +0000)]
sync

3 years agowe now pass that test
espie [Wed, 6 Oct 2021 14:24:17 +0000 (14:24 +0000)]
we now pass that test

3 years agofix for the XXX-warning warning... have the test be a bit more specific
espie [Wed, 6 Oct 2021 14:23:50 +0000 (14:23 +0000)]
fix for the XXX-warning warning... have the test be a bit more specific
for the really bizarre case where we would end up having several update
paths.

3 years agoAllow AUTH->AUTH state transitions in the iwm(4) and iwx(4) drivers again.
stsp [Wed, 6 Oct 2021 13:36:47 +0000 (13:36 +0000)]
Allow AUTH->AUTH state transitions in the iwm(4) and iwx(4) drivers again.

AUTH->AUTH state transitions happen if the access point uses band-steering.
This was originally implemented to fix interop with some Aruba APs, and
was probably broken by my recent CVS commit XeKkqPoaUCklmgtC ("prevent
attempts to transition towards the same state").

ok mpi@

3 years agoMake sure iwm(4) uses the HT frame format only for data frames.
stsp [Wed, 6 Oct 2021 13:35:55 +0000 (13:35 +0000)]
Make sure iwm(4) uses the HT frame format only for data frames.
Non-data frames are not supposed to use HT.

This change is for code correctness and does not fix any known issue.
And it applies only if the Tx rate has been fixed for testing purposes
with a command such as 'ifconfig iwm0 media HT-MCS13 mode 11n'.

ok mpi@

3 years agoAdd openbsd,dma-constraint property to /chosen node on armv7
visa [Wed, 6 Oct 2021 12:50:10 +0000 (12:50 +0000)]
Add openbsd,dma-constraint property to /chosen node on armv7

On the Zynq-7000, the DMA constraint has to be adjusted because many
bus masters are unable to access the lowest part of RAM.

OK patrick@ kettenis@

3 years agoGCC 4.2.1 does not support nullptr, use traditional NULL.
bluhm [Wed, 6 Oct 2021 12:43:14 +0000 (12:43 +0000)]
GCC 4.2.1 does not support nullptr, use traditional NULL.
Linker requires explicit libpthread.

3 years agoDo not reset cursor to default if it has never been changed, fixes
nicm [Wed, 6 Oct 2021 10:33:12 +0000 (10:33 +0000)]
Do not reset cursor to default if it has never been changed, fixes
problem reported by naddy.

3 years agoX509_STORE_CTX_init() allows the store to be NULL on init. Add checks
claudio [Wed, 6 Oct 2021 08:29:41 +0000 (08:29 +0000)]
X509_STORE_CTX_init() allows the store to be NULL on init. Add checks
for a NULL ctx->ctx in the lookup functions using X509_STORE_CTX.
This affects X509_STORE_get1_certs(), X509_STORE_get1_crls(),
X509_STORE_CTX_get1_issuer() and X509_STORE_get_by_subject().
With this X509_verify_cert() no longer crashes with a NULL store.
With and OK tb@

3 years agoRemove autoconfprivacy deprecation warning.
florian [Wed, 6 Oct 2021 06:14:08 +0000 (06:14 +0000)]
Remove autoconfprivacy deprecation warning.
OK deraadt