openbsd
3 years agoUpdate awk to October 12, 2021 version.
millert [Tue, 2 Nov 2021 15:29:41 +0000 (15:29 +0000)]
Update awk to October 12, 2021 version.
Fixes a decision bug with trailing stuff in lib.c:is_valid_number.
All other fixes were already present.

3 years agoAdd HISTORY section. OK schwarze@.
millert [Tue, 2 Nov 2021 15:12:09 +0000 (15:12 +0000)]
Add HISTORY section.  OK schwarze@.

3 years agoRecognize BCM43436, as seen on the Raspberry Pi Zero 2 W.
patrick [Tue, 2 Nov 2021 14:49:53 +0000 (14:49 +0000)]
Recognize BCM43436, as seen on the Raspberry Pi Zero 2 W.

ok jsg@

3 years agoAdd regress that calls SSL_set_tlsext_host_name() with a NULL host name.
jsing [Tue, 2 Nov 2021 14:39:09 +0000 (14:39 +0000)]
Add regress that calls SSL_set_tlsext_host_name() with a NULL host name.

3 years agoDo not take the strlen() of a NULL name. Defer the CBS_init() to later.
tb [Tue, 2 Nov 2021 13:59:29 +0000 (13:59 +0000)]
Do not take the strlen() of a NULL name. Defer the CBS_init() to later.
Found the hard way by sthen.

ok sthen

3 years agofatalx on unknown enum members in a couple of places, from Ben Boeckel.
nicm [Tue, 2 Nov 2021 10:57:04 +0000 (10:57 +0000)]
fatalx on unknown enum members in a couple of places, from Ben Boeckel.

3 years agoadd handling for parity and character size config.
dlg [Tue, 2 Nov 2021 09:52:40 +0000 (09:52 +0000)]
add handling for parity and character size config.

i wanted to talk modbus to a thing using a uchcom rs485 adapter,
but i needed even parity enabled to do that which the code didnt
support. this pulls in the necessary changes from netbsd uchcom.c
r1.26. it does not pull in the reset changes in 1.26 because netbsd
r1.28 reverts the reset code back to what we have now.

existing functionality tested by felix kronlage-dammers
ok patrick@

3 years agoigc(4)
patrick [Tue, 2 Nov 2021 08:39:23 +0000 (08:39 +0000)]
igc(4)

3 years agoEnable igc(4).
patrick [Tue, 2 Nov 2021 08:25:47 +0000 (08:25 +0000)]
Enable igc(4).

Tested by kevlo@

3 years agotr(1): plug leak in genclass()
cheloha [Tue, 2 Nov 2021 03:09:15 +0000 (03:09 +0000)]
tr(1): plug leak in genclass()

If we have already generated a given character class we don't need to
do it again.  We can also return some of the memory we allocated for
the class.  NCHARS is an upper bound, most character classes are
small.

This fixes a small leak in genclass().

While here, switch to an ANSI function definition.

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

ok millert@

3 years agoknf
deraadt [Tue, 2 Nov 2021 02:17:56 +0000 (02:17 +0000)]
knf

3 years agouniq(1): support arbitrarily long input lines
cheloha [Mon, 1 Nov 2021 23:20:35 +0000 (23:20 +0000)]
uniq(1): support arbitrarily long input lines

Switch from fgets(3) to getline(3) to support input lines of any
length.

Tested by sthen@, who uncovered a dumb bug that cut throughput in
half.  getline(3) is indeed slower than fgets(3), but not *twice* as
slow.

millert@ suggests that preallocating both line buffers might be
worthwhile.  I will need to do some additional testing to figure out
whether 8KB buffers (like we had for fgets(3)) are appropriate
starting lengths.  For now I am not preallocating either buffer.

ok millert@ sthen@

3 years agoMove the now internal X.509-related structs into x509_lcl.h.
tb [Mon, 1 Nov 2021 20:53:08 +0000 (20:53 +0000)]
Move the now internal X.509-related structs into x509_lcl.h.
Garbage collect the now unused LIBRESSL_CRYPTO_INTERNAL and
LIBRESSL_OPAQUE_X509. Include "x509_lcl.h" where needed and
fix a couple of unnecessary reacharounds.

ok jsing

3 years agoRemove backwards compat code.
kettenis [Mon, 1 Nov 2021 20:22:12 +0000 (20:22 +0000)]
Remove backwards compat code.

3 years agoCatch up with the Linux device tree bindings. Put the USB DARTs into bypass
kettenis [Mon, 1 Nov 2021 20:04:11 +0000 (20:04 +0000)]
Catch up with the Linux device tree bindings.  Put the USB DARTs into bypass
mode for now as we need to enter translations into both of them which is
hard to do now that they have separate device tree bindings.

3 years agoEnable spleen16x32 and spleen32x64 on riscv64 for GENERIC kernels.
fcambus [Mon, 1 Nov 2021 18:43:04 +0000 (18:43 +0000)]
Enable spleen16x32 and spleen32x64 on riscv64 for GENERIC kernels.

OK deraadt@

3 years agoawkgetline: do not access unitialized data on EOF
millert [Mon, 1 Nov 2021 18:28:24 +0000 (18:28 +0000)]
awkgetline: do not access unitialized data on EOF
getrec() returns 0 on EOF and leaves the contents of buf unchanged.
From https://github.com/onetrueawk/awk/pull/134

3 years agoRemove unused struct name
ratchov [Mon, 1 Nov 2021 18:23:09 +0000 (18:23 +0000)]
Remove unused struct name

3 years agoIn X509_STORE_CTX_get_obj_from_subject() rename X509_OBJECT from
tb [Mon, 1 Nov 2021 17:20:50 +0000 (17:20 +0000)]
In X509_STORE_CTX_get_obj_from_subject() rename X509_OBJECT from
the generic 'ret' to obj' in X509.

Requested by jsing

3 years agoFurther simplify cert and auth handling. Move common code into auth_insert
claudio [Mon, 1 Nov 2021 17:00:34 +0000 (17:00 +0000)]
Further simplify cert and auth handling. Move common code into auth_insert
and skip this distinction between invalid and failed certificates.
The difference between the to is getting more and more blurry.
OK tb@

3 years agoEnsure SSL_set_tlsext_host_name() is given a valid hostname.
jsing [Mon, 1 Nov 2021 16:45:56 +0000 (16:45 +0000)]
Ensure SSL_set_tlsext_host_name() is given a valid hostname.

ok inoguchi@ tb@

3 years agoRework SNI hostname regress to be table driven.
jsing [Mon, 1 Nov 2021 16:39:01 +0000 (16:39 +0000)]
Rework SNI hostname regress to be table driven.

Also adjust for the changes to tlsext_sni_is_valid_hostname() and include
tests for IPv4 and IPv6 literals.

ok beck@

3 years agoImprove SNI hostname validation.
jsing [Mon, 1 Nov 2021 16:37:17 +0000 (16:37 +0000)]
Improve SNI hostname validation.

For some time now we've validated the hostname provided to the server in
the SNI extension. Per RFC 6066, an IP literal is invalid as a hostname -
the current code rejects IPv6 literals, but allows IPv4 literals through.

Improve this check to explicitly detect both IPv4 and IPv6 literals. Some
software has been historically known to include IP literals in SNI, so
rather than rejecting this outright (and failing with a decode error),
pretend that the SNI extension does not exist (such that we do not break
some older clients).

ok inoguchi@ tb@

3 years agofix Dt and SEE ALSO;
jmc [Mon, 1 Nov 2021 15:23:57 +0000 (15:23 +0000)]
fix Dt and SEE ALSO;

3 years agoIgnore obj like in src
kn [Mon, 1 Nov 2021 14:44:10 +0000 (14:44 +0000)]
Ignore obj like in src

sys/ only checkouts are common, especiall in got(1) times, but they don't
include the global .gitignore which is annoying.

Duplicate it here.

OK sthen

3 years agoStop binding audio devices exposed by sndiod to physical devices
ratchov [Mon, 1 Nov 2021 14:43:24 +0000 (14:43 +0000)]
Stop binding audio devices exposed by sndiod to physical devices

This a shift towards a new model: clients connect to logical devices
(created with -s option) then the server routes data to/from the
underlying physical device (registered with -f option). The binding
may be changed at run-time with the server.device control exposed by
sndioctl(1).

As audio devices exposed by sndiod(8) are not bound to fixed physical
devices anymore, the physical audio device number component of
sndio(7) descriptors was removed.

fixes, help from and ok denis, edd

3 years agoAdd CRC-16 implementation. From NetBSD.
kettenis [Mon, 1 Nov 2021 13:53:59 +0000 (13:53 +0000)]
Add CRC-16 implementation.  From NetBSD.

ok krw@, deraadt@

3 years agosync
deraadt [Mon, 1 Nov 2021 12:51:13 +0000 (12:51 +0000)]
sync

3 years agoRestore some NULL checks lost in r1.132, add a couple more to deal with WEP key
krw [Mon, 1 Nov 2021 12:08:46 +0000 (12:08 +0000)]
Restore some NULL checks lost in r1.132, add a couple more to deal with WEP key
installation happening w/o a node, and don't attempt to set WEP keys that don't
exist.

Should fix the '(null node)' panics reported by James Hastings.

ok stsp@

3 years agoAdd a cursor-colour option, from Alexis Hildebrandt in GitHub issue
nicm [Mon, 1 Nov 2021 09:34:49 +0000 (09:34 +0000)]
Add a cursor-colour option, from Alexis Hildebrandt in GitHub issue
2959.

3 years agoaplhidev(4), aplkbd(4) and aplms(4)
kettenis [Mon, 1 Nov 2021 09:21:24 +0000 (09:21 +0000)]
aplhidev(4), aplkbd(4) and aplms(4)

3 years agoIn ipsec_common_input_cb() pass mbuf pointer to pf_test() so that
bluhm [Mon, 1 Nov 2021 09:19:10 +0000 (09:19 +0000)]
In ipsec_common_input_cb() pass mbuf pointer to pf_test() so that
all callers get an update if the mbuf changes.
OK tobhe@

3 years agoCleanup struct auth a bit. The tal description is also stored in the cert
claudio [Mon, 1 Nov 2021 09:12:18 +0000 (09:12 +0000)]
Cleanup struct auth a bit. The tal description is also stored in the cert
and the filename is only used in tracewarn which is not that helpful.
OK tb@

3 years agoAdd support for the keyboard/touchpad on Apple M1 laptops.
kettenis [Mon, 1 Nov 2021 09:02:46 +0000 (09:02 +0000)]
Add support for the keyboard/touchpad on Apple M1 laptops.

ok patrick@

3 years agoRework x509attribute regress test in such a way that it doesn't need
tb [Mon, 1 Nov 2021 08:28:31 +0000 (08:28 +0000)]
Rework x509attribute regress test in such a way that it doesn't need
to reach into opaque structs.

3 years agoUnifdef LIBRESSL_NEW_API. Now that the library is bumped, this is
tb [Mon, 1 Nov 2021 08:14:36 +0000 (08:14 +0000)]
Unifdef LIBRESSL_NEW_API. Now that the library is bumped, this is
no longer needed.

ok jsing

3 years agopf.conf.5: improve reply-to documentation
landry [Mon, 1 Nov 2021 07:51:51 +0000 (07:51 +0000)]
pf.conf.5: improve reply-to documentation

reply-to uses addresses, not interfaces anymore since
https://marc.info/?l=openbsd-cvs&m=161213948819452&w=2

make it clearer that reply-to allows for symmetric routing enforcement,
eg replying via a specific gateway when having multiple paths.

wording from sthen@, vastly improving my initial suggestion.
ok jmc@ dlg@

3 years agoFix a comparison, from Ben Boeckel, and a crash when opening completion
nicm [Mon, 1 Nov 2021 07:48:04 +0000 (07:48 +0000)]
Fix a comparison, from Ben Boeckel, and a crash when opening completion
menu, from Anindya Mukherjee.

3 years agouse hw_power to implement power_supply_is_system_supplied()
jsg [Mon, 1 Nov 2021 03:29:53 +0000 (03:29 +0000)]
use hw_power to implement power_supply_is_system_supplied()

3 years agotr(1): backslash(): fix octal escape parsing
cheloha [Sun, 31 Oct 2021 21:34:16 +0000 (21:34 +0000)]
tr(1): backslash(): fix octal escape parsing

There are two bugs in backslash():

1. 8 and 9 are not octal digits.  If we see '8' or '9' we should
   terminate the octal escape.

2. We return octal escape values larger than UCHAR_MAX even though
   tr(1) is (currently) a byte-oriented program and values larger
   than UCHAR_MAX make no sense.

So, fix them both.  In particular, (a) stop parsing if we see
characters outside of '0'-'7' and (b) escaped octal values larger than
UCHAR_MAX are a terminal error.

While here, some cleanup:

- Check for empty escapes at the top of the function.  This simplifies
  later cases.

- Use the for-loop conditional to terminate octal escape parsing after
  three characters.

- Use an ANSI-style function definition.

We can fix the switch-statement indentation later, in a larger KNF
patch.

ok millert@

3 years agoAlso remove pcap files during make clean.
bluhm [Sun, 31 Oct 2021 18:24:08 +0000 (18:24 +0000)]
Also remove pcap files during make clean.

3 years agoEnable RFC 3779 code.
tb [Sun, 31 Oct 2021 18:22:42 +0000 (18:22 +0000)]
Enable RFC 3779 code.

From job. Discussed at length with beck, claudio, job during h2k21

3 years agoMake it more visible that not only rc_reload() can be disabled.
ajacoutot [Sun, 31 Oct 2021 17:58:28 +0000 (17:58 +0000)]
Make it more visible that not only rc_reload() can be disabled.

3 years agoaplspi(4)
kettenis [Sun, 31 Oct 2021 17:47:06 +0000 (17:47 +0000)]
aplspi(4)

3 years agoShuffle things around to have FUNCS_ONLY higher in the script so consummers
ajacoutot [Sun, 31 Oct 2021 17:46:23 +0000 (17:46 +0000)]
Shuffle things around to have FUNCS_ONLY higher in the script so consummers
source only what they really needs.
Only expose the following which are used by /etc/rc, netstart and rcctl:
_rc_parse_conf
_rc_check_name
_rc_err
_rc_do
_rc_quirk

ok sthen@

3 years agodocument that fileno(3) returns -1 for some kinds of FILE * objects;
schwarze [Sun, 31 Oct 2021 16:56:47 +0000 (16:56 +0000)]
document that fileno(3) returns -1 for some kinds of FILE * objects;
triggerd by but simpler than a similar patch sent in
by Simon Branch <simonmbranch at gmail dot com>;
OK millert@ jmc@

3 years agoMake this test compile again after the damage done in libcrypto
tb [Sun, 31 Oct 2021 16:56:17 +0000 (16:56 +0000)]
Make this test compile again after the damage done in libcrypto

3 years agoHide struct internals under LIBRESSL_CRYPTO_INTERNAL so that other
tb [Sun, 31 Oct 2021 16:51:16 +0000 (16:51 +0000)]
Hide struct internals under LIBRESSL_CRYPTO_INTERNAL so that other
parts of LibreSSL can no longer reach into them.

discussed with beck, jsing

3 years agoVarious minor adjustments to make openssl(1) compile with opaque
tb [Sun, 31 Oct 2021 16:47:27 +0000 (16:47 +0000)]
Various minor adjustments to make openssl(1) compile with opaque
structs in X509.

3 years agosync
deraadt [Sun, 31 Oct 2021 16:45:06 +0000 (16:45 +0000)]
sync

3 years agoNow that X509_OBJECT is opaque, we need to allocate it on the heap
tb [Sun, 31 Oct 2021 16:45:04 +0000 (16:45 +0000)]
Now that X509_OBJECT is opaque, we need to allocate it on the heap
instead of having it on the stack. Adjust code accordingly.

3 years agosync
tb [Sun, 31 Oct 2021 16:43:56 +0000 (16:43 +0000)]
sync

3 years agobump major after struct size change
tb [Sun, 31 Oct 2021 16:42:32 +0000 (16:42 +0000)]
bump major after struct size change

3 years agoBump BER_MAX_OID_LEN to 128
tb [Sun, 31 Oct 2021 16:42:08 +0000 (16:42 +0000)]
Bump BER_MAX_OID_LEN to 128

From martijn, discussed with claudio, ok sthen

3 years agoBump majors after struct visibility changes, symbol removal and symbol
tb [Sun, 31 Oct 2021 16:41:23 +0000 (16:41 +0000)]
Bump majors after struct visibility changes, symbol removal and symbol
addition.

3 years agoSimplify some code by using X509_STORE_CTX_get_obj_by_subject()
tb [Sun, 31 Oct 2021 16:39:32 +0000 (16:39 +0000)]
Simplify some code by using X509_STORE_CTX_get_obj_by_subject()

ok beck jsing

3 years agoUpdate Symbols.list to include API additions
tb [Sun, 31 Oct 2021 16:38:36 +0000 (16:38 +0000)]
Update Symbols.list to include API additions

3 years agoAdd aplspi(4), a driver for the SPI controller found on the Apple M1 SoC.
kettenis [Sun, 31 Oct 2021 16:38:12 +0000 (16:38 +0000)]
Add aplspi(4), a driver for the SPI controller found on the Apple M1 SoC.

ok patrick@

3 years agolibssl: stop reaching into the X509 struct and simplify some code by
tb [Sun, 31 Oct 2021 16:37:25 +0000 (16:37 +0000)]
libssl: stop reaching into the X509 struct and simplify some code by
using X509_get_key_usage().

ok beck jsing

3 years agoUpdate Symbols.list for new API and API removal/renaming
tb [Sun, 31 Oct 2021 16:33:16 +0000 (16:33 +0000)]
Update Symbols.list for new API and API removal/renaming

3 years agoExpose new API in headers and make X509 structs opaque.
tb [Sun, 31 Oct 2021 16:32:31 +0000 (16:32 +0000)]
Expose new API in headers and make X509 structs opaque.

3 years agoRemove the unused X509_OBJECTS struct.
tb [Sun, 31 Oct 2021 16:29:58 +0000 (16:29 +0000)]
Remove the unused X509_OBJECTS struct.

ok beck jsing

3 years agoRemove the unused X509_CERT_PAIR struct and the assicated API.
tb [Sun, 31 Oct 2021 16:28:50 +0000 (16:28 +0000)]
Remove the unused X509_CERT_PAIR struct and the assicated API.

ok beck jsing

3 years agoRemove the unused X509_CERT_FILE_CTX struct.
tb [Sun, 31 Oct 2021 16:26:08 +0000 (16:26 +0000)]
Remove the unused X509_CERT_FILE_CTX struct.

ok beck jsing

3 years agoPrepare to provide X509_STORE_CTX_get_obj_by_subject(), a wrapper
tb [Sun, 31 Oct 2021 16:23:45 +0000 (16:23 +0000)]
Prepare to provide X509_STORE_CTX_get_obj_by_subject(), a wrapper
around X509_STORE_get_by_subject() that eliminates the need of
allocating an object on the heap by hand.

ok beck inoguchi jsing

3 years agoSwitch various X509 API to use the new X509_LOOKUP_TYPE to match
tb [Sun, 31 Oct 2021 16:20:37 +0000 (16:20 +0000)]
Switch various X509 API to use the new X509_LOOKUP_TYPE to match
OpenSSL's signatures.

ok beck inoguchi jsing

3 years agoProvide the X509_LOOKUP_TYPE enum.
tb [Sun, 31 Oct 2021 16:17:14 +0000 (16:17 +0000)]
Provide the X509_LOOKUP_TYPE enum.
Remove the now unused X509_LU_{RETRY,FAIL,PKEY}.

ok beck inoguchi jsing

3 years agoFurther improve load_file(). Always set an errno on errors and make sure
claudio [Sun, 31 Oct 2021 16:00:14 +0000 (16:00 +0000)]
Further improve load_file(). Always set an errno on errors and make sure
the errno is not clobbered in the error path. Check result from load_file()
and issue a warning and skip the file in queue_add_tal().
OK benno@ beck@

3 years agoWhen converting the TAL parser to use load_file and pass the file via
claudio [Sun, 31 Oct 2021 15:58:13 +0000 (15:58 +0000)]
When converting the TAL parser to use load_file and pass the file via
data/datasz element to the parser process I forgot to remove the old
buf argument that abused descr for that. Because of this rpki-client
can crash.
Found by benno@, OK benno@ beck@

3 years agoPrepare definitions X509_STORE_set_verify{,_cb}_func() that work with
tb [Sun, 31 Oct 2021 15:55:45 +0000 (15:55 +0000)]
Prepare definitions X509_STORE_set_verify{,_cb}_func() that work with
opaque structs.

ok beck inoguchi jsing

3 years agoPrepare to make various structs in x509_vfy.h opaque.
tb [Sun, 31 Oct 2021 15:54:08 +0000 (15:54 +0000)]
Prepare to make various structs in x509_vfy.h opaque.

ok beck inoguchi jsing

3 years agoDisable both TCP/UDP checksum offloading and VLAN HW tag offloading for now,
patrick [Sun, 31 Oct 2021 15:25:10 +0000 (15:25 +0000)]
Disable both TCP/UDP checksum offloading and VLAN HW tag offloading for now,
as we currently configure neither in the transmit code path.

Found by sf@

3 years agoImplement transmit and transmit completion path.
patrick [Sun, 31 Oct 2021 15:22:40 +0000 (15:22 +0000)]
Implement transmit and transmit completion path.

3 years agoExtend the SPI bus API a bit. The config structure gets an sc_cs_delay
kettenis [Sun, 31 Oct 2021 15:12:00 +0000 (15:12 +0000)]
Extend the SPI bus API a bit.  The config structure gets an sc_cs_delay
member to allow us to specify a delay between assert the CS# signal and
starting the clock.  And the transfer function gains a flags argument,
which can be used to specify a new SPI_KEEP_CS flag to keep CS# asserted
after the transfer.  This allows us to do another transfer immediately
afterwards without de-asserting CS# which is necessary for sending
commands to the upcoming Apple M1 keyboard/touchpad driver.

ok patrick@

3 years agoMove the fill and the tail pointer change to a later point, to make sure
patrick [Sun, 31 Oct 2021 15:02:25 +0000 (15:02 +0000)]
Move the fill and the tail pointer change to a later point, to make sure
that the RDT is written, and that it is written not too early.  Doing it
before writing IGC_RXDCTL definitely doesn't work.

The tail pointer needs to be set to the next empty slot, so it has to be
"last desc filled + 1".

Make sure sure that the rss mapping does not happen in the middle of the
RX checksum block, and that it happens only if nqueues > 1.  Also disable
storing bad packets.

With this, igc(4) receives packets just fine.

ok kevlo@

3 years agoAdd igc(4), a driver for the Intel 2.5Gb Ethernet controllers.
patrick [Sun, 31 Oct 2021 14:52:57 +0000 (14:52 +0000)]
Add igc(4), a driver for the Intel 2.5Gb Ethernet controllers.

Ported by kevlo@
ok jmatthew@

3 years agoregen
patrick [Sun, 31 Oct 2021 14:41:53 +0000 (14:41 +0000)]
regen

3 years agoAdd another PCI id for Intel 2.5Gb adapters.
patrick [Sun, 31 Oct 2021 14:41:00 +0000 (14:41 +0000)]
Add another PCI id for Intel 2.5Gb adapters.

3 years agoMake athn(4) attach to the Sony UWA-BR100. Patch by martingot@protonmail
stsp [Sun, 31 Oct 2021 12:24:02 +0000 (12:24 +0000)]
Make athn(4) attach to the Sony UWA-BR100. Patch by martingot@protonmail

3 years agoregen
stsp [Sun, 31 Oct 2021 12:23:17 +0000 (12:23 +0000)]
regen

3 years agoAdd USB device ID for the Sony UWA-BR100. Patch by martingot@protonmail
stsp [Sun, 31 Oct 2021 12:22:48 +0000 (12:22 +0000)]
Add USB device ID for the Sony UWA-BR100. Patch by martingot@protonmail

3 years agoRaise SPL to IPL_NET in run_next_scan() to avoid splassert failures.
stsp [Sun, 31 Oct 2021 12:17:54 +0000 (12:17 +0000)]
Raise SPL to IPL_NET in run_next_scan() to avoid splassert failures.

Problem found and fix tested by krw@.
ok krw@

3 years agoPrepare regress for opaque structs in x509*.h
tb [Sun, 31 Oct 2021 08:27:15 +0000 (08:27 +0000)]
Prepare regress for opaque structs in x509*.h

3 years agoAdd explicit CBS_contains_zero_byte() check in CBS_strdup().
jsing [Sun, 31 Oct 2021 06:48:54 +0000 (06:48 +0000)]
Add explicit CBS_contains_zero_byte() check in CBS_strdup().

If the CBS data contains a zero byte, then CBS_strdup() is only going to
return part of the data - add an explicit CBS_contains_zero_byte() and
treat such data as an error case.

ok tb@

3 years agosync
deraadt [Sun, 31 Oct 2021 01:15:31 +0000 (01:15 +0000)]
sync

3 years agoChange hw.perfpolicy=auto by default, at startup. If the system has AC
deraadt [Sat, 30 Oct 2021 23:24:46 +0000 (23:24 +0000)]
Change hw.perfpolicy=auto by default, at startup.  If the system has AC
power connected (default is yes when no driver differentiates) then default
to 100% performance. On battery, use the existing auto algorithm (which is
admittedly somewhat unrefined).
This change overrides the system/BIOS speed and puts OpenBSD in control.
As this happens very early during boot, besides speedups in all usage usage
patterns, some surprises: unhibernate and sysupgrade times are cut in half.
note: on a few architectures, the setperf fn pointer is changed late, and
thus the auto algorithm stops timeing out.  kettenis and i will look for
a solution.
in snaps for more than a week.
ok kettenis

3 years agoKill the dead code from unp_drop().
mvs [Sat, 30 Oct 2021 16:35:31 +0000 (16:35 +0000)]
Kill the dead code from unp_drop().

The unp_drop() was removed from the 'PRU_ABORT' path in the previous
commit. Now it only remains in the unp_detach() where disconnects the
connected datagram sockets linked to the `unp_link' list. Such sockets
always have the associated file descriptor and never had been linked to
the `so_q0' or `so_q' of listening socket so their `so_head' is always
NULL.

ok millert@ sashan@ mpi@

3 years agoFix the UNIX domain sockets leak in soclose().
mvs [Sat, 30 Oct 2021 16:24:18 +0000 (16:24 +0000)]
Fix the UNIX domain sockets leak in soclose().

Each listening socket has two queues, the `so_q0' where partial connected
sockets linked and the `so_q' where connected but not yet accept(2)ed
sockets linked. Such sockets has no file descriptor allocated, so they
have no access from the userland. When the socket linked to `so_q0' or
`so_q' it has it's `so_head' pointed to the listening socket. The userland
receive sockets from `so_q' by accept(2) which allocates the file
descriptor to the socket.

When userland close(2) listening socket, soclose() should release the
sockets linked to `so_q0' and `so_q' because it's the only place where
they are referenced. It removes the socket from the queue by soqremque().
Since socket is not in the queue it's `so_head' is NULL. Then the socket
passed to soabort() which should destroy it by (*pr_usrreq)() call with
'PRU_ABORT' request.

In UNIX domain sockets layer the unp_drop() only disconnects passed socket
and doesn't destroy it because it's `so_head' is NULL. This socket has the
only access by the UNIX domain sockets garbage collector which leaves it
alive, so the socket is permanently leaked.

This leak was introduced in the revision 1.26 of sys/uipc_socket.c when
soqremque() was placed before soabort(). To fix this the unp_drop() was
replaced by unp_detach() and sofree() in the 'PRU_ABORT' path. unp_drop()
only sets the error and disconnects passed socket. We don't expose this
error and unp_detach() also disconnects the socket before destroy it's
protocol control block. sofree() destroys the rest.

The socket passed to soabort() has no vnode(9) associated, so unp_detach()
don't release `unp_lock'. Also this socket never had associated file
descriptor so it already has 'SS_NOFDREF' flag set.

This diff was also applied to 6.9 and 7.0 branches as errata.

3 years agonew manual page X509_CRL_METHOD_new(3)
schwarze [Sat, 30 Oct 2021 16:20:35 +0000 (16:20 +0000)]
new manual page X509_CRL_METHOD_new(3)
documenting five functions to customize CRL handling

3 years agoAdd GPIO functionality (including support for using GPIOs as interrupt pins).
kettenis [Sat, 30 Oct 2021 14:50:54 +0000 (14:50 +0000)]
Add GPIO functionality (including support for using GPIOs as interrupt pins).
Needed for upcoming Apple M1 laptop keyboard support.

ok patrick@

3 years agodocument (hopefully) near future directions
espie [Sat, 30 Oct 2021 13:44:34 +0000 (13:44 +0000)]
document (hopefully) near future directions

3 years agoFix build break caused by accidental keystroke during last commit
ratchov [Sat, 30 Oct 2021 12:48:11 +0000 (12:48 +0000)]
Fix build break caused by accidental keystroke during last commit

3 years agoDisestablish softintrs upon detach (missed in last commit)
ratchov [Sat, 30 Oct 2021 12:40:55 +0000 (12:40 +0000)]
Disestablish softintrs upon detach (missed in last commit)

During detach, we can't rely on softintrs to signal processes blocked
in read, write or poll, so we need to explicitely call wakeup
functions in the detach method, as other drivers do.

3 years agoDefer selwakeup() calls to a softintr
ratchov [Sat, 30 Oct 2021 12:26:26 +0000 (12:26 +0000)]
Defer selwakeup() calls to a softintr

selwakeup() needs to be protected by KERNEL_LOCK, but we're not
allowed to grab KERNEL_LOCK on interrupt context because midi runs at
IPL_AUDIO with the audio_lock held. Furthermore, doing so is a locking
order bug: syscall code-path grabs KERNEL_LOCK first while interrupt
code-path does the opposite when calling selwakeup().

ok visa

3 years agoRevert previous commit as it's causing panic when devices are detached
ratchov [Sat, 30 Oct 2021 11:56:19 +0000 (11:56 +0000)]
Revert previous commit as it's causing panic when devices are detached

ok sthen, anton

3 years agomatch on Intel 600 Series
jsg [Sat, 30 Oct 2021 03:27:35 +0000 (03:27 +0000)]
match on Intel 600 Series

3 years agoenable snooping on Intel 600 Series
jsg [Sat, 30 Oct 2021 03:24:59 +0000 (03:24 +0000)]
enable snooping on Intel 600 Series

3 years agoregen
jsg [Sat, 30 Oct 2021 03:22:44 +0000 (03:22 +0000)]
regen

3 years agoadd Intel 600 Series and Alder Lake S ids
jsg [Sat, 30 Oct 2021 03:22:08 +0000 (03:22 +0000)]
add Intel 600 Series and Alder Lake S ids

described in
648364-001 Intel 600 Series Chipset Family Platform Controller Hub Datasheet
655258-001 12th Generation Intel Core Processors Datasheet

3 years agoIf the test fails, do not hang forever. Abort with a 10 seconds
bluhm [Fri, 29 Oct 2021 20:15:03 +0000 (20:15 +0000)]
If the test fails, do not hang forever.  Abort with a 10 seconds
timeout.