openbsd
2 years agoAdd dummy implementation for rt_timer_init(). Kernel sources are
bluhm [Tue, 19 Apr 2022 22:16:24 +0000 (22:16 +0000)]
Add dummy implementation for rt_timer_init().  Kernel sources are
build for regress and need that function now.

2 years agozap extra line break and extra empty line
tb [Tue, 19 Apr 2022 20:06:48 +0000 (20:06 +0000)]
zap extra line break and extra empty line

2 years agoForgot a file for previous commit.
krw [Tue, 19 Apr 2022 20:02:56 +0000 (20:02 +0000)]
Forgot a file for previous commit.

No functional change.

2 years agoUse a pool instead of malloc for struct rttimer_queue. As routing
bluhm [Tue, 19 Apr 2022 19:19:31 +0000 (19:19 +0000)]
Use a pool instead of malloc for struct rttimer_queue.  As routing
runs without kernel lock, use IPL_MPFLOOR protection for its pools.
OK mvs@ claudio@

2 years agoDo not use a hidden global for the EVP_ENCODE_CTX to save a calloc() call.
claudio [Tue, 19 Apr 2022 19:01:19 +0000 (19:01 +0000)]
Do not use a hidden global for the EVP_ENCODE_CTX to save a calloc() call.
Make this work concurrently by allocating and freeing the EVP_ENCODE_CTX
for every call to base64_decode(). This is not a hot path so the impact
is negligible.
OK tb@

2 years agoAvoid leaking crldp in mft_parse() if one of the crlfile checks fails.
tb [Tue, 19 Apr 2022 18:52:36 +0000 (18:52 +0000)]
Avoid leaking crldp in mft_parse() if one of the crlfile checks fails.

ok claudio

2 years agoBring GPT_print_partition() into line with other functions being passed
krw [Tue, 19 Apr 2022 17:53:15 +0000 (17:53 +0000)]
Bring GPT_print_partition() into line with other functions being passed
an index to the gp[] array by calling said parameter 'pn' and making it
const unsigned int.

No functional change.

2 years agoMove declaration of DEBUG-only variable inside #ifdef DEBUG.
krw [Tue, 19 Apr 2022 17:36:36 +0000 (17:36 +0000)]
Move declaration of DEBUG-only variable inside #ifdef DEBUG.

No functional change.

2 years agoEliminate superfluous intermediate variables 'pncnt' now that
krw [Tue, 19 Apr 2022 17:30:36 +0000 (17:30 +0000)]
Eliminate superfluous intermediate variables 'pncnt' now that
gh.gh_part_num does not need a letoh32().

No functional change.

2 years agoDrop unused KeyUpdate from debug printf
tb [Tue, 19 Apr 2022 17:01:43 +0000 (17:01 +0000)]
Drop unused KeyUpdate from debug printf

The handshake state machine does not handle key updates since that's a
post-handshake handshake message. This is code under #ifdef TLS13_DEBUG
and if it is ever to be reused in tls13_handshake_msg.c, that will have
to be revisited.

ok inoguchi jsing

2 years agoInstead of a MP unsafe global variable to initialize at first use,
bluhm [Tue, 19 Apr 2022 15:44:56 +0000 (15:44 +0000)]
Instead of a MP unsafe global variable to initialize at first use,
call rt_timer_init() from rtable_init().
OK mvs@ claudio@

2 years agoadd missing unlock before returning in uvn_detach()
semarie [Tue, 19 Apr 2022 15:30:52 +0000 (15:30 +0000)]
add missing unlock before returning in uvn_detach()

uvn_detach sets UVM_VNODE_RELKILL flag and wait for all async i/o to finish. but
uvm_vnp_terminate() could clear the flag and take over the vnode.

mpi@ noted that this code path is mostly dead code because there is no "async
I/O" (uvn_io() is always synchronous).

ok visa@ mpi@

2 years agodocument the actual problems that pkg_check-version can diagnose
espie [Tue, 19 Apr 2022 15:03:12 +0000 (15:03 +0000)]
document the actual problems that pkg_check-version can diagnose

2 years agoChange type of talsz and dependent code from size_t to int. Tal ids are
claudio [Tue, 19 Apr 2022 13:52:24 +0000 (13:52 +0000)]
Change type of talsz and dependent code from size_t to int. Tal ids are
already stored as int and and talsz is the limit for these ids.
OK tb@

2 years agoMake it a hard error when an unknown repoistory id is passed to
claudio [Tue, 19 Apr 2022 13:25:08 +0000 (13:25 +0000)]
Make it a hard error when an unknown repoistory id is passed to
parse_filepath(). If that happens something went very wrong and
it is better to fail hard then to limp along.
OK tb@

2 years agonext iteration: make the support dependent on TEST parameters
espie [Tue, 19 Apr 2022 12:51:32 +0000 (12:51 +0000)]
next iteration: make the support dependent on TEST parameters
-DTEST_CACHING: try the cache
-DTEST_CACHING_VERBOSE: make it say what it does
-DTEST_CACHING_RECHECK: don't trust the cache and compare the extracted
    value with the actual package contents (thus making it slower once again)

Quite a few more checks along the way, in general

2 years agoCosmetics, add missing space
claudio [Tue, 19 Apr 2022 11:07:33 +0000 (11:07 +0000)]
Cosmetics, add missing space

2 years agoAdjust on how CRL and MFT files are verified.
claudio [Tue, 19 Apr 2022 09:52:29 +0000 (09:52 +0000)]
Adjust on how CRL and MFT files are verified.

Verify the CRL referenced from the mft against the mft's fileAndHash info.
If the CRL matches then load it and use it to validate this mft. If the
mft validated OK add the now also valid CRL to the auth store for later use.

Before the newest CRL was always selected but that has negative consequences
because it is common practice to revoke the previous MFT's EE cert and with
that the cache is turned useless as soon as a new CRL is used. Also there
was a possibility that the CRL used for validation of the MFT was not the
one later used.

Both RFC6486 and draft-ietf-sidrops-6486bis are unclear about this part
of the validation process. We opted in favor of the chached MFT.

With and OK tb@

2 years agodocument the bits of the kstat struct that providers work with.
dlg [Tue, 19 Apr 2022 03:51:47 +0000 (03:51 +0000)]
document the bits of the kstat struct that providers work with.

the kstat api is a small part of implementing a kstat, most of it
depends on how you set up the kstat struct.

2 years agoregen
kevlo [Tue, 19 Apr 2022 03:26:52 +0000 (03:26 +0000)]
regen

2 years agoAdd a new RDC PHY.
kevlo [Tue, 19 Apr 2022 03:26:33 +0000 (03:26 +0000)]
Add a new RDC PHY.

From Andrius Varanavicius

2 years agoRestore original MDC speed control register value on vte_reset,
kevlo [Tue, 19 Apr 2022 03:25:46 +0000 (03:25 +0000)]
Restore original MDC speed control register value on vte_reset,
which is needed for at least Vortex86DX3 machines.

Patch from Andrius Varanavicius via bugs@

Special thanks to DMP for donating hardware which helped make this fix
possible.

2 years agoremove a comment saying we might want kstat_remove.
dlg [Tue, 19 Apr 2022 01:39:38 +0000 (01:39 +0000)]
remove a comment saying we might want kstat_remove.

we did want it, so it's there and documented.

2 years agoenable kstat(4) and kstat(1).
dlg [Tue, 19 Apr 2022 01:32:06 +0000 (01:32 +0000)]
enable kstat(4) and kstat(1).

kstat allows the kernel to expose arbitrary data for userland to
consume. currently this is used by some network card drivers to
expose hardware counters they provide, and a bit by the network
stack to show things like ifq counters.

ok bluhm@ deraadt@

2 years agoConvert the GPT header read from disk into a host-endian version,
krw [Mon, 18 Apr 2022 17:32:16 +0000 (17:32 +0000)]
Convert the GPT header read from disk into a host-endian version,
and then back to little-endian when writing to disk.

Reduces the number of invocations of the letoh*() and htole*()
functions by 90 or so. Also makes that code much easier to read.

No intentional functional change.

2 years agoregen
kevlo [Mon, 18 Apr 2022 05:51:08 +0000 (05:51 +0000)]
regen

2 years agoA few devices found on EBOX-3360-C2CF and EBOX-3300MX.
kevlo [Mon, 18 Apr 2022 05:50:29 +0000 (05:50 +0000)]
A few devices found on EBOX-3360-C2CF and EBOX-3300MX.

2 years agoWhen kbd -l was executed as regular user, it failed silently. Try
bluhm [Sun, 17 Apr 2022 17:33:50 +0000 (17:33 +0000)]
When kbd -l was executed as regular user, it failed silently.  Try
to open all wskbd devices, but report the first error and exit if
none was successful.
OK deraadt@ espie@

2 years agosync
deraadt [Sun, 17 Apr 2022 04:53:33 +0000 (04:53 +0000)]
sync

2 years agoesm(4): constify sensor tables
naddy [Sat, 16 Apr 2022 19:32:54 +0000 (19:32 +0000)]
esm(4): constify sensor tables

2 years agoit(4): constify sensor tables
naddy [Sat, 16 Apr 2022 19:32:22 +0000 (19:32 +0000)]
it(4): constify sensor tables

2 years agoconstify SCSI adapter entry points
naddy [Sat, 16 Apr 2022 19:19:58 +0000 (19:19 +0000)]
constify SCSI adapter entry points

ok krw@

2 years agoupdate list of firmware files used by iwx(4)
stsp [Sat, 16 Apr 2022 16:22:46 +0000 (16:22 +0000)]
update list of firmware files used by iwx(4)

2 years agoMake device matching in iwx(4) more similar to Linux iwlwifi.
stsp [Sat, 16 Apr 2022 16:21:50 +0000 (16:21 +0000)]
Make device matching in iwx(4) more similar to Linux iwlwifi.

There are a few chips which cannot be recognized by PCI ID alone.
Reading device registers is also required to identify such devices.

iwx(4) should now detect AX201 devices requiring the following firmware
images:

iwx-Qu-b0-hr-b0-63
iwx-Qu-b0-jf-b0-63
iwx-Qu-c0-jf-b0-63
iwx-QuZ-a0-hr-b0-67
iwx-QuZ-a0-jf-b0-63

These are already installed in /etc/firmware but have so far been unused.

This is obviously going to cover a range of devices which have not actually
been tested yet. If you have such a device please test and report back.
Tested on previously working AX200/AX201 devices by jmc@ and myself.
Sven Wolf has successfully tested a newly supported device.

Based on an initial patch by Iraklis Karagkiozoglou, thanks!

2 years agoregen
stsp [Sat, 16 Apr 2022 16:13:15 +0000 (16:13 +0000)]
regen

2 years agoAdd more Intel wifi PCI device IDs. Some AX201, some AX210, some AX211.
stsp [Sat, 16 Apr 2022 16:12:56 +0000 (16:12 +0000)]
Add more Intel wifi PCI device IDs. Some AX201, some AX210, some AX211.

2 years agorefactor the code so that caching is setup in the repository that's
espie [Sat, 16 Apr 2022 09:32:40 +0000 (09:32 +0000)]
refactor the code so that caching is setup in the repository that's
linked to quirks during do_quirks.

then add a pre-cache that does run locate once on the full list of things
we want to update/install (assuming "regular" pkgsets, that is, where the
names are the ones we want).

Then the actual fetching of caching info will look in that pre-cache before
resorting to locate itself (or going straight to the wire).

The code isn't active yet, the XXX comment in
OpenBSD/PackageRepository/Installed.pm
says it all.

2 years agossh-keygen's -G/-T have been replaced with -M generate/screen.
dtucker [Sat, 16 Apr 2022 04:30:10 +0000 (04:30 +0000)]
ssh-keygen's -G/-T have been replaced with -M generate/screen.

2 years agolist the correct version number when usage of the sftp protocol became default
tj [Sat, 16 Apr 2022 00:22:31 +0000 (00:22 +0000)]
list the correct version number when usage of the sftp protocol became default
and fix a typo

from ed maste

2 years agoAllow more than one CRL URI in certificates
tb [Fri, 15 Apr 2022 12:59:44 +0000 (12:59 +0000)]
Allow more than one CRL URI in certificates

The spec (RFC 6487, 4.8.6) expresses a preference for a single rsync URI
but allows for other URIs in the CRL distributionPoint. This doesn't
currently happen in practice but could come at some point. So look for
the rsync URI and skip over others, which is more correct and might help
in the future.

Pointed out by & ok claudio

2 years agomake use of the fact that repositories are unique objects: we don't need
espie [Fri, 15 Apr 2022 10:54:00 +0000 (10:54 +0000)]
make use of the fact that repositories are unique objects: we don't need
string comparison, we can simply annotate the quirks repository as cached.

this does streamline the code somewhat

so simply activate warp-speed by uncommenting one line.

2 years agowe probably already have that info, but in any case, we don't need
espie [Fri, 15 Apr 2022 08:03:33 +0000 (08:03 +0000)]
we probably already have that info, but in any case, we don't need
the full plist for a signature.

shaves most of the remaining time with caching active

2 years agodelete an ancient paragraph suggesting the wrong reason to use close(2)
deraadt [Fri, 15 Apr 2022 03:04:52 +0000 (03:04 +0000)]
delete an ancient paragraph suggesting the wrong reason to use close(2)
(and we all laughed a little)

2 years agoThe XOR instruction affects the carry and zero flag. Move it before
bluhm [Thu, 14 Apr 2022 20:24:15 +0000 (20:24 +0000)]
The XOR instruction affects the carry and zero flag.  Move it before
the VM instructions so that SETNA propagates the error condition
of the latter.  Avoids "cpu0: failed to enter VMM mode" errors.
Fixes previous commit.
tested by Hrvoje; OK dv@

2 years agoddb: constify command tables
naddy [Thu, 14 Apr 2022 19:47:10 +0000 (19:47 +0000)]
ddb: constify command tables

ok jca@

2 years agoMove ((gh_part_size % d_secsize) == 0) validity check
krw [Thu, 14 Apr 2022 16:33:25 +0000 (16:33 +0000)]
Move ((gh_part_size % d_secsize) == 0) validity check
to get_header() with the rest of the header validity
checks.

No functional change.

2 years agoRelax address availability check for multicast binds.
claudio [Thu, 14 Apr 2022 14:10:22 +0000 (14:10 +0000)]
Relax address availability check for multicast binds.

While it makes sense to limit bind(2) of unicast addresses that overlap
each other to be all from the same UID (like 0.0.0.0:53 and 127.0.0.1:53)
it makes little sense for multicast. Multicast is delivered to all sockets
that match so there is no risk of someone stealing traffic from someone
else.  This should hopefully help with mDNS as reported by robert@
OK deraadt@ bluhm@

2 years agopf and pfsync are running without kernel lock, so the mutexes must
bluhm [Thu, 14 Apr 2022 11:39:44 +0000 (11:39 +0000)]
pf and pfsync are running without kernel lock, so the mutexes must
have at least mpfloor spl protection.  Fix witness issue found by
Hrvoje where pfsync holds mutex and interrupt grabs kernel lock.
OK sashan@

2 years agodrm/amdgpu: don't use BACO for reset in S3
jsg [Thu, 14 Apr 2022 08:55:23 +0000 (08:55 +0000)]
drm/amdgpu: don't use BACO for reset in S3

From Alex Deucher
b536cf3eb6f949f8bedae7b26713e7ffec13b89b in linux 5.15.y/5.15.34
ebc002e3ee78409c42156e62e4e27ad1d09c5a75 in mainline linux

2 years agodrm/amdkfd: Create file descriptor after client is added to smi_clients list
jsg [Thu, 14 Apr 2022 08:52:38 +0000 (08:52 +0000)]
drm/amdkfd: Create file descriptor after client is added to smi_clients list

From Lee Jones
3c8902bbf2ab5a15443f3daa73e8da18e7792172 in linux 5.15.y/5.15.34
e79a2398e1b2d47060474dca291542368183bc0f in mainline linux

2 years agodrm/amdgpu/vcn: Fix the register setting for vcn1
jsg [Thu, 14 Apr 2022 08:51:00 +0000 (08:51 +0000)]
drm/amdgpu/vcn: Fix the register setting for vcn1

From Emily Deng
6a5d209898a605c31c26dbd2b002529e37ff0c6e in linux 5.15.y/5.15.34
02fc996d5098f4c3f65bdf6cdb6b28e3f29ba789 in mainline linux

2 years agodrm/amdgpu/smu10: fix SoC/fclk units in auto mode
jsg [Thu, 14 Apr 2022 08:49:35 +0000 (08:49 +0000)]
drm/amdgpu/smu10: fix SoC/fclk units in auto mode

From Alex Deucher
155338be5d9078a569a723d8695b501ab369bdf9 in linux 5.15.y/5.15.34
2f25d8ce09b7ba5d769c132ba3d4eb84a941d2cb in mainline linux

2 years agodrm/amdgpu/display: change pipe policy for DCN 2.1
jsg [Thu, 14 Apr 2022 08:47:59 +0000 (08:47 +0000)]
drm/amdgpu/display: change pipe policy for DCN 2.1

From Benjamin Marty
0115e4f2f6bc984bc8fdba41ada55f586dc28502 in linux 5.15.y/5.15.34
879791ad8bf3dc5453061cad74776a617b6e3319 in mainline linux

2 years agoamd/display: set backlight only if required
jsg [Thu, 14 Apr 2022 08:46:31 +0000 (08:46 +0000)]
amd/display: set backlight only if required

From Shirish S
a551e6629247dc84f8cea5d494542c532ea69161 in linux 5.15.y/5.15.34
4052287a75eb3fc0f487fcc5f768a38bede455c8 in mainline linux

2 years agodrm/amdgpu: fix off by one in amdgpu_gfx_kiq_acquire()
jsg [Thu, 14 Apr 2022 08:44:29 +0000 (08:44 +0000)]
drm/amdgpu: fix off by one in amdgpu_gfx_kiq_acquire()

From Dan Carpenter
5ba9d78a72948325ecdb4dca2a31a46bc9169574 in linux 5.15.y/5.15.34
1647b54ed55d4d48c7199d439f8834626576cbe9 in mainline linux

2 years agodrm/amdkfd: make CRAT table missing message informational only
jsg [Thu, 14 Apr 2022 08:42:44 +0000 (08:42 +0000)]
drm/amdkfd: make CRAT table missing message informational only

From Alex Deucher
f325d3e1dcc85fc3cd984f30fd443ab2f3b42631 in linux 5.15.y/5.15.34
9dff13f9edf755a15f6507874185a3290c1ae8bb in mainline linux

2 years agodrm/amdgpu: Fix recursive locking warning
jsg [Thu, 14 Apr 2022 08:40:39 +0000 (08:40 +0000)]
drm/amdgpu: Fix recursive locking warning

From Rajneesh Bhardwaj
0a922366d6d9b2532344b3763a54090ab9b50f59 in linux 5.15.y/5.15.34
447c7997b62a5115ba4da846dcdee4fc12298a6a in mainline linux

2 years agodrm/amdkfd: Don't take process mutex for svm ioctls
jsg [Thu, 14 Apr 2022 08:38:48 +0000 (08:38 +0000)]
drm/amdkfd: Don't take process mutex for svm ioctls

From Philip Yang
e84b0438010d3359ae4830ba44108150f4839a92 in linux 5.15.y/5.15.34
ac7c48c0cce00d03b3c95fddcccb0a45257e33e3 in mainline linux

2 years agodrm/amd/display: Use PSR version selected during set_psr_caps
jsg [Thu, 14 Apr 2022 08:37:17 +0000 (08:37 +0000)]
drm/amd/display: Use PSR version selected during set_psr_caps

From Nicholas Kazlauskas
6040c99cb1a18c8da3f84e5051db12b6353a2576 in linux 5.15.y/5.15.34
b80ddeb29d9df449f875f0b6f5de08d7537c02b8 in mainline linux

2 years agodrm/amd/display: Fix memory leak
jsg [Thu, 14 Apr 2022 08:35:27 +0000 (08:35 +0000)]
drm/amd/display: Fix memory leak

From Yongzhi Liu
7e10369c72db7a0e2f77b2e306aadc07aef6b07a in linux 5.15.y/5.15.34
5d5c6dba2b43e28845d7d7ed32a36802329a5f52 in mainline linux

2 years agodrm/amd/amdgpu/amdgpu_cs: fix refcount leak of a dma_fence obj
jsg [Thu, 14 Apr 2022 08:33:54 +0000 (08:33 +0000)]
drm/amd/amdgpu/amdgpu_cs: fix refcount leak of a dma_fence obj

From Xin Xiong
3edd8646cb7c11b57c90e026bda6f21076223f5b in linux 5.15.y/5.15.34
dfced44f122c500004a48ecc8db516bb6a295a1b in mainline linux

2 years agodrm/amd/display: Add signal type check when verify stream backends same
jsg [Thu, 14 Apr 2022 08:32:15 +0000 (08:32 +0000)]
drm/amd/display: Add signal type check when verify stream backends same

From Dale Zhao
c4b64a80554e57a68b594f2920988f4bc39768d9 in linux 5.15.y/5.15.34
047db281c026de5971cedb5bb486aa29bd16a39d in mainline linux

2 years agodrm: Add orientation quirk for GPD Win Max
jsg [Thu, 14 Apr 2022 08:30:38 +0000 (08:30 +0000)]
drm: Add orientation quirk for GPD Win Max

From Anisse Astier
b3ca02c1ee93b9a998cf26e1734986ba570422c4 in linux 5.15.y/5.15.34
0b464ca3e0dd3cec65f28bc6d396d82f19080f69 in mainline linux

2 years agoFix clearphist alias, from Jacqueline Jolicoeur via jmc@.
nicm [Thu, 14 Apr 2022 06:59:29 +0000 (06:59 +0000)]
Fix clearphist alias, from Jacqueline Jolicoeur via jmc@.

2 years agoCorrect a gh_part_csum calculation used in debug output.
krw [Wed, 13 Apr 2022 22:29:30 +0000 (22:29 +0000)]
Correct a gh_part_csum calculation used in debug output.

Always calculate the GPT partition entries checksum over
gh_part_num * gh_part_size bytes, not the maximal size of the
internal partition entries array.

No functional change.

2 years agoFix typo in last commit.
millert [Wed, 13 Apr 2022 22:17:33 +0000 (22:17 +0000)]
Fix typo in last commit.

2 years agoscaffolding from using the locate db that's now in quirks to avoid
espie [Wed, 13 Apr 2022 21:22:40 +0000 (21:22 +0000)]
scaffolding from using the locate db that's now in quirks to avoid
asking the network about updateinfo (not active yet, you need to uncomment
some lines)

2 years agotrack ::Sample and ::Extra across an UpdateSet so that we may eventually
espie [Wed, 13 Apr 2022 21:20:23 +0000 (21:20 +0000)]
track ::Sample and ::Extra across an UpdateSet so that we may eventually
give out more accurate diagnostic (soon !)

2 years agoadd Paths to the quirks locate db and the locate binary proper
espie [Wed, 13 Apr 2022 21:19:16 +0000 (21:19 +0000)]
add Paths to the quirks locate db and the locate binary proper

2 years agoIKED_LIFETIME_BYTES is > 2GB, and potentially used in strange place,
deraadt [Wed, 13 Apr 2022 20:54:55 +0000 (20:54 +0000)]
IKED_LIFETIME_BYTES is > 2GB, and potentially used in strange place,
it should really be marked ULL
ok bluhm tobhe

2 years agoTo prevent infinite recursion while expanding eqn(7) definitions,
schwarze [Wed, 13 Apr 2022 20:19:18 +0000 (20:19 +0000)]
To prevent infinite recursion while expanding eqn(7) definitions,
we must not reset the recursion counter when moving beyond the end
of the *previous* expansion, but we may only do so when moving
beyond the rightmost position reached by *any* expansion in the
current equation.  This matters because definitions can nest;
consider:

  .EQ
  define inner "content"
  define outer "inner outer"
  outer
  .EN

This endless loop was found by tb@ using afl(1).

Incidentally, GNU eqn(1) also performs an infinite loop in this
situation and then crashes when memory runs out, but that's not an
excuse for nasty behaviour of mandoc(1).

While here, consistently print the expanded content even when the
expansion is finally truncated.  While that is not likely to help
end-users, it may help authors of eqn(7) code to understand what's
going on.  Besides, it sends a very clear signal that something is
amiss, which was easy to miss in the past unless people
enabled -W error or used -T lint.

2 years agowe're not 2000 anymore, direct the user to using binary packages, the ports
espie [Wed, 13 Apr 2022 18:00:34 +0000 (18:00 +0000)]
we're not 2000 anymore, direct the user to using binary packages, the ports
tree should be about on par with release(8)

okay schwarze@, sthen@

2 years agoftok: avoid left shift of a signed in by 24 places
millert [Wed, 13 Apr 2022 16:23:53 +0000 (16:23 +0000)]
ftok: avoid left shift of a signed in by 24 places
Fix "left shift of 255 by 24 places cannot be represented in type 'int'"
error from UBSAN.  Adapted from a FreeBSD diff via tb@.  OK tb@ deraadt@

2 years agoinet_net_pton_ipv6: avoid signed vs unsigned comparison
millert [Wed, 13 Apr 2022 16:20:11 +0000 (16:20 +0000)]
inet_net_pton_ipv6: avoid signed vs unsigned comparison
Use a temporary variable to store the number of bytes to be copied
(size_t) and also use it as the memcpy(3) length.  Previously we
copied "size" bytes instead of just the necessary number.
OK claudio@ tb@

2 years agoCorrect a gh_csum calculation used in debug output.
krw [Wed, 13 Apr 2022 15:32:33 +0000 (15:32 +0000)]
Correct a gh_csum calculation used in debug output.

Always calculate the GPT header checksum over gh_size bytes
(a.k.a. 92), not sizeof(struct gpt_header). Compilers in their
wisdom may pad the struct to a nice round size, e.g. 96 bytes.

No functional change.

2 years agoEliminate a couple of 'XXX' assumptions by calculating the actual
krw [Wed, 13 Apr 2022 15:07:25 +0000 (15:07 +0000)]
Eliminate a couple of 'XXX' assumptions by calculating the actual
number of sectors a given number of GPT partition entries
require.

No intentional functional change.

2 years agoDo not die on an assertion if an input file contains no section
schwarze [Wed, 13 Apr 2022 14:37:34 +0000 (14:37 +0000)]
Do not die on an assertion if an input file contains no section
whatsoever and ends with a broken next-line scope.  Obviously, this
cannot happen in a real manual page, but mandoc(1) should not die
even when fed absurd input.

This bug was independently reported by both jsg@ and tb@ who both
found it with afl(1).

2 years agoSurprisingly, groff supports multiple copy mode escapes at the
schwarze [Wed, 13 Apr 2022 13:11:33 +0000 (13:11 +0000)]
Surprisingly, groff supports multiple copy mode escapes at the
beginning of an escape sequence: \, \E, \EE, \EEE, and so on all do
the same outside copy mode, so let them do the same in mandoc(1), too.

This fixes an assertion failure triggered by \EE*X that tb@ found
with afl(1).  The first E was consumed by roff_expand(), but that
function failed to recognize the escape sequence as the expansion
of a user-defined string and handed it over to mandoc_escape(),
which consumed the second E and then died on an assertion because
it is not prepared to handle user-defined strings.  Fix this by
letting *both* functions handly arbitrary numbers of 'E's correctly.

2 years agoDocument sntrup761x25519 key exchange.
tobhe [Wed, 13 Apr 2022 11:06:15 +0000 (11:06 +0000)]
Document sntrup761x25519 key exchange.

2 years agoUse a simpler "formula" to decide a default kern.maxthread value;
sthen [Wed, 13 Apr 2022 10:08:10 +0000 (10:08 +0000)]
Use a simpler "formula" to decide a default kern.maxthread value;
just 2*NPROCESS rather than NPROCESS+8*MAXUSERS. Results in a slightly
higher maxthread value - the previous value was fairly likely to be
exceeded on a system running a couple of heavily threaded processes.

>                             previous        new
> MAXUSERS    NPROCESS        maxthread       (2*NPROCESS)
> 80          1310            1950            2620
> 64          1054            1566            2108
> 32          542             798             1084

ok kettenis@

2 years agoddb: simplify machine command handling
naddy [Tue, 12 Apr 2022 19:44:31 +0000 (19:44 +0000)]
ddb: simplify machine command handling

Define a consistently named db_machine_command_table[] across all
archs that implement the MD "machine" command, and hook this into
the main command table instead of patching it at runtime.

ok mpi@ jca@

2 years agoconstify USB host controller method tables and root hub descriptors
naddy [Tue, 12 Apr 2022 19:41:11 +0000 (19:41 +0000)]
constify USB host controller method tables and root hub descriptors

ok mglocker@

2 years agoMake this more readable.
ajacoutot [Tue, 12 Apr 2022 14:54:32 +0000 (14:54 +0000)]
Make this more readable.
Document gi-docgen which is coming to gnome.port.mk soon.

2 years agoDo not convert the int value twice from little to host endian.
claudio [Tue, 12 Apr 2022 14:51:04 +0000 (14:51 +0000)]
Do not convert the int value twice from little to host endian.
io_read_int() already does the conversion so don't double up in
io_read_ulong(). Fixes openrsync on sparc64.
OK miod@ deraadt@

2 years agostruct vnode: document the protection required for manipulating v_numoutput
semarie [Tue, 12 Apr 2022 14:34:11 +0000 (14:34 +0000)]
struct vnode: document the protection required for manipulating v_numoutput

correct sr_rw() and sr_ccb_rw() to properly manipulate v_numoutput under splbio.

ok visa@

2 years agofix bad space;
jmc [Tue, 12 Apr 2022 12:54:09 +0000 (12:54 +0000)]
fix bad space;

2 years agoExtend -f filemode to decode & print TAL details
job [Tue, 12 Apr 2022 11:05:50 +0000 (11:05 +0000)]
Extend -f filemode to decode & print TAL details

"fine" claudio@ tb@

2 years agoKNF for a brace and zap trailing blank line
tb [Tue, 12 Apr 2022 10:42:35 +0000 (10:42 +0000)]
KNF for a brace and zap trailing blank line

2 years agoAdd a colon to warning for consistency
tb [Tue, 12 Apr 2022 09:48:23 +0000 (09:48 +0000)]
Add a colon to warning for consistency

2 years agoShuffle sbgp_sia() a bit down to a place where it makes more sense
tb [Tue, 12 Apr 2022 09:32:23 +0000 (09:32 +0000)]
Shuffle sbgp_sia() a bit down to a place where it makes more sense

ok claudio

2 years agoAdjust regress for x509_location() change
tb [Tue, 12 Apr 2022 08:46:33 +0000 (08:46 +0000)]
Adjust regress for x509_location() change

2 years agoGeneralize sbgp_sia_location() to x509_location()
tb [Tue, 12 Apr 2022 08:45:34 +0000 (08:45 +0000)]
Generalize sbgp_sia_location() to x509_location()

AIA and CRL URIs can reuse the code in sbgp_sia_location and thus get the
same checks as the SIA locations. This eliminates some more duplication
and makes the checks more stringent in that embedded NULs and "./" are no
longer allowed.

ok claudio

2 years agoCorrect path for system known hosts file in description of
dtucker [Tue, 12 Apr 2022 05:09:49 +0000 (05:09 +0000)]
Correct path for system known hosts file in description of
IgnoreUserKnownHosts.  Patch from Martin Vahlensieck via tech@

2 years agoImprove test and clean targets
afresh1 [Tue, 12 Apr 2022 02:54:51 +0000 (02:54 +0000)]
Improve test and clean targets

They failed if there was nothing to clean.

The test target now depends on the all target so we have something
to run tests against.  They still don't like to pass in-tree,
but that is a separate issue.

Noticed by deraadt@, suggestions and improvements from geunther@ and bluhm@

2 years agoclear io_want/io_ready flags at start of poll() cycle;
djm [Mon, 11 Apr 2022 22:52:08 +0000 (22:52 +0000)]
clear io_want/io_ready flags at start of poll() cycle;
avoids plausible spin during rekeying if channel io_want flags are
reused across cycles. ok markus@ deraadt@

2 years agoFix leak of esnxf if esn ore noesn are configured explicitly.
tobhe [Mon, 11 Apr 2022 20:41:21 +0000 (20:41 +0000)]
Fix leak of esnxf if esn ore noesn are configured explicitly.

2 years agoRefactor on how the subprocesses are started.
claudio [Mon, 11 Apr 2022 18:59:23 +0000 (18:59 +0000)]
Refactor on how the subprocesses are started.

Move the unveil and pledges to the actuall subprocesses and put all the
common code to start these into process_start(). Reduces the lenght of
main() a fair bit.
OK tb@

2 years agoKeep `fdp' locked until we finish the second loop of unp_externalize().
mvs [Mon, 11 Apr 2022 18:18:17 +0000 (18:18 +0000)]
Keep `fdp' locked until we finish the second loop of unp_externalize().
This prevents descriptors from being closed concurrently on receiver side.

ok bluhm@ claudio@

2 years agoRemove trailing spaces.
mpi [Mon, 11 Apr 2022 16:43:49 +0000 (16:43 +0000)]
Remove trailing spaces.

2 years agogpio: Add missing device_unref() calls
visa [Mon, 11 Apr 2022 14:30:05 +0000 (14:30 +0000)]
gpio: Add missing device_unref() calls

device_lookup() returns a reference that the caller has to release.

OK jca@