Re: CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
On Fri, May 06, 2022 at 07:00:17AM +0200, Anton Lindqvist wrote:
> On Wed, May 04, 2022 at 10:58:43PM -0600, Theo de Raadt wrote:
> > These complaints about trivial regress failures, generally just
> > output strings, are getting a bit tiring.
> > You can fix it in about 1 minute, right?
> 
> I generally try to fix trivial things like this one but I don't always
> have the time. If people find this more annoying than helpful I will
> stop.

I think it's valuable that you do this. Something broke. Ideally, the
one who broke it fixes it. If you don't have time to figure out a fix,
it's perfectly fine to send a mail to the responsible person. However, I
think the initial report doesn't necessarily need to be public.



Re: CVS: cvs.openbsd.org: src

2022-05-05 Thread Anton Lindqvist
On Wed, May 04, 2022 at 10:58:43PM -0600, Theo de Raadt wrote:
> These complaints about trivial regress failures, generally just
> output strings, are getting a bit tiring.
> You can fix it in about 1 minute, right?

I generally try to fix trivial things like this one but I don't always
have the time. If people find this more annoying than helpful I will
stop.



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo de Raadt
CVSROOT:/cvs
Module name:src
Changes by: dera...@cvs.openbsd.org 2022/05/05 20:54:17

Modified files:
distrib/sets/lists/comp: mi 

Log message:
sync



CVS: cvs.openbsd.org: src

2022-05-05 Thread Scott Soule Cheloha
CVSROOT:/cvs
Module name:src
Changes by: chel...@cvs.openbsd.org 2022/05/05 16:36:36

Modified files:
usr.bin/kstat  : kstat.c 

Log message:
kstat(1): implement wait with setitimer(2) instead of nanosleep(2)

kstat(1)'s wait period drifts because nanosleep(2) uses a relative
timeout.  If we use setitimer(2)/sigsuspend(2) the period does not
drift.

While here, bump the upper bound for wait up to UINT_MAX and switch to
the normal strtonum(3) error message format.

With input from kn@.

Tweaked by bluhm@ to block SIGALRM with sigprocmask(2) while we're
outside of sigsuspend(2).

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

Earlier version ok millert@.

ok bluhm@



CVS: cvs.openbsd.org: src

2022-05-05 Thread Florian Obser
CVSROOT:/cvs
Module name:src
Changes by: flor...@cvs.openbsd.org 2022/05/05 14:07:23

Modified files:
distrib/miniroot: install.sub 

Log message:
Fix watchdog in the installer.

We only had one watchdog running that triggered after 30 minutes. If
an unattended upgrade (e.g. started by sysupgrade(8)) took longer than
this in total, the machine would reboot half way through an upgrade.
The intention was that the watchdog would be reset after each set
download and after each set installation. But this never worked
correctly because the actual upgrade ran in a sub-shell and WDPID was
not visible.
To fix this we first need to export WDPID to make it visible in the
sub-shell. Then reset_watchdog was guarded by $UU && reset_watchdog,
but UU wasn't visible either. But we can't export it because we would
enter a loop. We can just use the fact that WDPID is not empty to
restart the watchdog.
Lastly the watchdog process would keep stderr and stdout open. This
made the tee(1) hang that is collecting the autoupgrade log that is
mailed to root.
As a simplification, we don't need to run the watchdog as a
co-process, we don't want to communicate with it, we can just run it
in the background.
Problem reported by stsp
With & OK deraadt
OK millert



CVS: cvs.openbsd.org: src

2022-05-05 Thread Florian Obser
CVSROOT:/cvs
Module name:src
Changes by: flor...@cvs.openbsd.org 2022/05/05 13:51:35

Modified files:
usr.sbin/acme-client: chngproc.c main.c 

Log message:
Check that the challenge token which is turned into a filename is
base64url encoded.
We have only the challenge directory unveil(2)'ed so funny business
like ../ will not work, but we shouldn't generate garbage filenames
that someone else might trip over either.
Pointed out and diff by Ali Farzanrad (ali_farzanrad AT riseup.net)
OK beck



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 13:48:06

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Simplify: freezero() is NULL safe; assign + test in one go, as usual.

ok jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 13:46:36

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Avoid malloc(0) in EVP_PKEY_CTX_set1_hkdf_key()

ok jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 13:44:23

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Securely wipe the entire HKDF_PKEY_CTX instead of only taking care of
a piece of the embedded info array.

ok jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Joel Sing
CVSROOT:/cvs
Module name:src
Changes by: js...@cvs.openbsd.org   2022/05/05 13:18:57

Modified files:
lib/libcrypto/asn1: asn1_lib.c asn1_locl.h asn1_old_lib.c 
tasn_dec.c 

Log message:
Use size_t for ASN.1 lengths.

Change asn1_get_length_cbs() and asn1_get_object_cbs() to handle and return
a length as a size_t rather than a uint32_t. This makes it simpler and less
error prone in the callers.

Suggested by and ok tb@



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 12:34:27

Modified files:
regress/lib/libcrypto/wycheproof: wycheproof.go 

Log message:
Switch wycheproof.go to using the EVP HKDF API.

Gotta love EVP... Instead of a single, obvious call to HKDF(), you now
need to call eight EVP functions with plenty of allocations and pointless
copying internally. If you want to suffer even more, you could consider
using the gorgeous string interface instead.



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 12:29:34

Modified files:
lib/libcrypto/hmac: hmac.c 

Log message:
Fix HMAC() with NULL key

If a NULL key is passed to HMAC_Init_ex(), it tries to reuse the
previous key. This makes no sense inside HMAC() since the HMAC_CTX
has no key set yet. This is hit by HKDF() with NULL salt() via the
EVP API and results in a few Wycheproof test failures. If key is
NULL, use a zero length dummy key.

This was not hit from wycheproof.go since we pass a []byte with a
single NUL from Go.

Matches OpenSSL if key is NULL and key_len is 0. If key_len != 0,
OpenSSL will still fail by passing a NULL key which makes no sense,
so set key_len to 0 instead.

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2022/05/05 10:44:22

Modified files:
sys/net: pf.c 
sys/netinet: ip_divert.c ip_divert.h 
sys/netinet6   : ip6_divert.c ip6_divert.h 

Log message:
Clean up divert_packet().  Function does not return error, make it
void.  Introduce mutex and refcounting for inp like in the other
PCB functions.
OK sashan@



CVS: cvs.openbsd.org: src

2022-05-05 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2022/05/05 10:12:42

Modified files:
sbin/kbd   : kbd_wscons.c 

Log message:
Add error handling if setting the keyboard encoding fails.  After
open of all /dev/wskbd* devices failed, report the error from the
first one.  Also wrap long lines.
OK mpi@



CVS: cvs.openbsd.org: src

2022-05-05 Thread Jeremy Evans
CVSROOT:/cvs
Module name:src
Changes by: jer...@cvs.openbsd.org  2022/05/05 09:45:05

Modified files:
share/man/man5 : ruby-module.5 

Log message:
Update documentation for switch of default ruby version to 3.1



CVS: cvs.openbsd.org: src

2022-05-05 Thread Dave Voutila
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2022/05/05 09:42:04

Modified files:
regress/usr.sbin/vmd/config: vmd-pass-memory-round.ok 

Log message:
we no longer announce rounding here



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 08:44:59

Modified files:
sbin/dhcpleased: engine.c 

Log message:
Switch the log_warnx() about trailing garbage to log_debug(). After a
maintenance window, my ISP started sending an unexpected 'ff' byte at
the very end which created noise in the log.  Apparently this came up
before.

>From and ok florian



CVS: cvs.openbsd.org: src

2022-05-05 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2022/05/05 07:57:41

Modified files:
sys/net: route.c route.h 
sys/netinet: ip_icmp.c ip_input.c ip_mroute.c ip_mroute.h 
 ip_var.h 
sys/netinet6   : icmp6.c ip6_input.c ip6_mroute.c ip6_mroute.h 
 ip6_var.h 

Log message:
Use static objects for struct rttimer_queue instead of dynamically
allocate them.

Currently there are 6 rttimer_queues and not many more will follow. So
change rt_timer_queue_create() to rt_timer_queue_init() which now takes
a struct rttimer_queue * as argument which will be initialized.
Since this changes the gloabl vars from pointer to struct adjust other
callers as well.
OK bluhm@



CVS: cvs.openbsd.org: src

2022-05-05 Thread Frederic Cambus
CVSROOT:/cvs
Module name:src
Changes by: fcam...@cvs.openbsd.org 2022/05/05 06:29:14

Modified files:
sys/dev/pci: pcidevs.h pcidevs_data.h 

Log message:
regen



CVS: cvs.openbsd.org: src

2022-05-05 Thread Frederic Cambus
CVSROOT:/cvs
Module name:src
Changes by: fcam...@cvs.openbsd.org 2022/05/05 06:26:06

Modified files:
sys/dev/pci: pcidevs 

Log message:
Add ID for the AMD Sensor Fusion Hub found on my Ryzen-based ZBOX CA621.

OK jsg@



Re: CVS: cvs.openbsd.org: src

2022-05-05 Thread Dave Voutila


Anton Lindqvist  writes:

> On Tue, May 03, 2022 at 03:39:19PM -0600, Dave Voutila wrote:
>> CVSROOT: /cvs
>> Module name: src
>> Changes by:  d...@cvs.openbsd.org2022/05/03 15:39:19
>>
>> Modified files:
>>  usr.sbin/vmd   : parse.y vm.c vmd.h
>>  usr.sbin/vmctl : main.c vmctl.c vmctl.h
>>  sys/arch/amd64/amd64: vmm.c
>>  sys/arch/amd64/include: vmmvar.h
>>
>> Log message:
>> vmm/vmd/vmctl: standardize memory units to bytes
>>
>> At different points in the vm lifecycle vmm(4), vmctl(8), and vmd(8)
>> refer to a vm's memory range sizes in either bytes or megabytes.
>> This is needlessly complex.
>>
>> Switch to using bytes everywhere and adjust types and constants
>> accordingly. While this makes it possible to specify vm's with
>> memory in fractions of megabytes, the logic requiring whole
>> megabyte values remains.
>>
>> Feedback from deraadt@, mlarkin@, and Matthew Martin.
>>
>> ok mlarkin@
>
> This broke regress.
>
>> usr.sbin/vmd:
> Exit: 1
> Duration: 00:00:03
> Log: 253-usr.sbin-vmd.log
>
>  run-pass-memory-round 
> /usr/sbin/vmd -n -f
> /home/src/regress/usr.sbin/vmd/config/vmd-pass-memory-round.conf 2>&1
> | diff -u
> /home/src/regress/usr.sbin/vmd/config/vmd-pass-memory-round.ok
> /dev/stdin
> --- /home/src/regress/usr.sbin/vmd/config/vmd-pass-memory-round.okWed Oct 
> 11 14:01:20 2017
> +++ /dev/stdinThu May  5 06:04:37 2022
> @@ -1,2 +1,2 @@
> -size rounded to 1023 megabytes
> +memory size rounded to 1023M
>  configuration OK
> *** Error 1 in config (Makefile:15 'run-pass-memory-round')
> FAILED
>
>  run-fail-too-few-ram 
> /usr/sbin/vmd -n -f
> /home/src/regress/usr.sbin/vmd/config/vmd-fail-too-few-ram.conf 2>&1 |
> cut -d : -f 2,3,4 | diff -u
> /home/src/regress/usr.sbin/vmd/config/vmd-fail-too-few-ram.ok
> /dev/stdin
> --- /home/src/regress/usr.sbin/vmd/config/vmd-fail-too-few-ram.ok Wed Oct 
> 11 14:01:20 2017
> +++ /dev/stdinThu May  5 06:04:38 2022
> @@ -1,2 +1,2 @@
> -size must be at least one megabyte
> +memory size must be at least 1MB
>  4: failed to parse size: 1048575
> *** Error 1 in config (Makefile:22 'run-fail-too-few-ram')
> FAILED
>

This is fixed now though.

>  run-regress-vioscribble 
> rm -f scribble.{raw,qcow2}  vioscribble.d vioqcow2.d vioraw.d log.d
> /usr/sbin/vmctl create -s 4G scribble.raw
> vmctl: create imagefile operation failed: File too large
> *** Error 1 in diskfmt (Makefile:24 'setup')
> FAILED

This was fixed in a subsequent commit after it was reported by a user.

-dv



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 05:26:36

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Fix argument order in HKDF and HKDF_extract().



CVS: cvs.openbsd.org: src

2022-05-05 Thread Dave Voutila
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2022/05/05 05:19:18

Modified files:
regress/usr.sbin/vmd/config: vmd-fail-too-few-ram.ok 
 vmd-pass-memory-round.ok 

Log message:
unbreak vmd(8) regress, update string matches



CVS: cvs.openbsd.org: www

2022-05-05 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:www
Changes by: bl...@cvs.openbsd.org   2022/05/05 05:15:11

Modified files:
.  : errata71.html 

Log message:
Release ipsec errata.



CVS: cvs.openbsd.org: src

2022-05-05 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2022/05/05 04:04:24

Modified files:
usr.bin/wall   : wall.c 

Log message:
Fix line wrapping in wall(1).
from Anton Borowka; OK mbuhl@



CVS: cvs.openbsd.org: src

2022-05-05 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2022/05/05 03:45:15

Modified files:
sys/kern   : kern_time.c 

Log message:
Using mutex initializer for static variable does not compile with
witness.  Make ratecheck mutex global.
Reported-by: syzbot+9864ba1338526d0e8...@syzkaller.appspotmail.com



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:51:21

Modified files:
lib/libcrypto/evp: pmeth_lib.c 

Log message:
Add hkdf_pkey_meth to the standard_methods[]

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:50:35

Modified files:
lib/libcrypto  : Makefile 

Log message:
Link kdf/ to the build

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:48:50

Modified files:
lib/libcrypto/evp: evp.h 

Log message:
Provide EVP_PKEY_HKDF alias for NID_hkdf

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:48:05

Modified files:
lib/libcrypto/err: err.h 

Log message:
Provide KDFerr() and KDFerror() macros

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2022/05/05 02:43:37

Modified files:
sys/netinet: in.c 

Log message:
No longer consider IN_EXPERIMENTAL aka 240/4 as not forwardable.
We already allow 240/4 in and out so lets allow it through as well.
One of many steps to make 240/4 useable.
Diff by Seth David Schoen (schoen at loyalty.org)
OK bluhm@ djm@



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:42:27

Modified files:
lib/libcrypto/evp: evp_locl.h pmeth_lib.c 

Log message:
Provide versions of EVP_PKEY_CTX_{str,hex}2ctrl() for internal use.

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:24:14

Modified files:
lib/libcrypto/kdf: kdf.h kdf_err.c 

Log message:
Ditch #defines for tls1_prf and scrypt. Drop unused errors and massage
some const.

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:14:14

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Translate from OpenSSL's HKDF API to BoringSSL API.

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:10:39

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Remove function codes from errors, i.e., KDFerr(A, B) -> KDFerror(B)

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:07:24

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Fix typo in previous.



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:05:58

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Inline OPENSSL_memdup() using malloc() + memcpy()

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 02:03:11

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Translate OPENSSL_{cleanse,clear_free,free,zalloc}() to libc API.

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 01:57:33

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Adjust includes for LibreSSL

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 01:53:30

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Use C99 initializres for hkdf_pkey_meth

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 01:50:06

Modified files:
lib/libcrypto/kdf: hkdf_evp.c 

Log message:
Remove OpenSSL versions of HKDF*().

ok beck jsing



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 01:48:07

Modified files:
lib/libcrypto/kdf: kdf.h kdf_err.c 

Log message:
Fix includes of the removed kdferr.h



CVS: cvs.openbsd.org: src

2022-05-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/05/05 01:45:57

Modified files:
lib/libcrypto/objects: obj_mac.num objects.txt 

Log message:
Add NID for HKDF

ok beck jsing