openbsd
2 years agoRetire F_RTLABEL it was not used for anything.
claudio [Tue, 7 Jun 2022 15:57:47 +0000 (15:57 +0000)]
Retire F_RTLABEL it was not used for anything.
Also cleanup some redundant if statements.
OK tb@

2 years agomerge unbound 1.16.0
sthen [Tue, 7 Jun 2022 15:42:53 +0000 (15:42 +0000)]
merge unbound 1.16.0

2 years agoupdate to unbound 1.16.0, discussed with florian@, test from Renaud Allard
sthen [Tue, 7 Jun 2022 15:39:58 +0000 (15:39 +0000)]
update to unbound 1.16.0, discussed with florian@, test from Renaud Allard

2 years agoRemove uvm_km_valloc_prefer_wait(9) and uvm_km_free_wakeup(9) now that
kettenis [Tue, 7 Jun 2022 12:07:45 +0000 (12:07 +0000)]
Remove uvm_km_valloc_prefer_wait(9) and uvm_km_free_wakeup(9) now that
nothing uses these functions anymore.

ok mpi@

2 years agoRemove redundant check for free pages. The pmemrange code that is called
kettenis [Tue, 7 Jun 2022 12:02:52 +0000 (12:02 +0000)]
Remove redundant check for free pages.  The pmemrange code that is called
by uvm_pglistalloc(9) does a similar check already.

ok mpi@

2 years agoExpand arguments to some commands where it makes sense, GitHub issue
nicm [Tue, 7 Jun 2022 10:02:19 +0000 (10:02 +0000)]
Expand arguments to some commands where it makes sense, GitHub issue
3204 from Anindya Mukherjee.

2 years agoSplit the excessively generic diagnostic message "invalid escape sequence"
schwarze [Tue, 7 Jun 2022 09:51:03 +0000 (09:51 +0000)]
Split the excessively generic diagnostic message "invalid escape sequence"
into the more specific messages "invalid escape argument delimiter"
and "invalid escape sequence argument".

2 years agoPurge duplicate error reporting from the .tr request parser:
schwarze [Tue, 7 Jun 2022 09:41:22 +0000 (09:41 +0000)]
Purge duplicate error reporting from the .tr request parser:
the error was already reported earlier when roff_expand()
called roff_escape().

2 years agoFix path validation of AS numbers
tb [Tue, 7 Jun 2022 08:50:07 +0000 (08:50 +0000)]
Fix path validation of AS numbers

If a certificate along the chain does not have an AS numbers extension,
this is a failure condition according to RFC 3779, section 3.3.

ok job

2 years agostfclock(4)
kettenis [Mon, 6 Jun 2022 22:28:57 +0000 (22:28 +0000)]
stfclock(4)

2 years agobump pbuild's datasize-cur from 2G to 3G on i386, this or close to it
sthen [Mon, 6 Jun 2022 20:53:22 +0000 (20:53 +0000)]
bump pbuild's datasize-cur from 2G to 3G on i386, this or close to it
is needed to build some important ports.  ok tb@

2 years agoTo better match groff parsing, reject digits and some mathematical
schwarze [Mon, 6 Jun 2022 19:22:54 +0000 (19:22 +0000)]
To better match groff parsing, reject digits and some mathematical
operators as argument delimiters for some escape sequences that take
numerical arguments, in the same way as it had already been done for \h.

Argument delimiter parsing for escape sequences taking numerical arguments
is not perfect yet.  In particular, when a character representing a
scaling unit is abused as the argument delimiter, parsing for that
character becomes context-dependent, and it is no longer possible to
find the end of the escape sequence without calling the full numerical
expression parser, which i refrain from attempting in this commit.

For now, continuing to misparse insane constructions like \Bc1c+1cc
(which is valid in groff and resolves to "1" because 1c+1c = two
centimeters is a valid numerical expression and 'c' is also a valid
delimiter) is a small price to pay for keeping complexity at bay
and for not losing focus in the ongoing series of refinements.

2 years agoUse SSL3_CK_VALUE_MASK instead of hardcoded 0xffff and remove some
tb [Mon, 6 Jun 2022 16:12:30 +0000 (16:12 +0000)]
Use SSL3_CK_VALUE_MASK instead of hardcoded 0xffff and remove some
SSLv2 remnants.

ok jsing

2 years agoTweak comment describing the SSL_SESSION ASN.1
tb [Mon, 6 Jun 2022 16:11:00 +0000 (16:11 +0000)]
Tweak comment describing the SSL_SESSION ASN.1

ok jsing

2 years agoMinor style cleanup in ssl_txt.c
tb [Mon, 6 Jun 2022 15:20:54 +0000 (15:20 +0000)]
Minor style cleanup in ssl_txt.c

Wrap long lines and fix a bug where the wrong struct member was checked
for NULL.

ok jsing

2 years agoEnable stfclock(4) and make xhci(4) attach to fdt.
kettenis [Mon, 6 Jun 2022 14:58:19 +0000 (14:58 +0000)]
Enable stfclock(4) and make xhci(4) attach to fdt.

2 years agoAdd stfclock(4), a driver for the clock controller found on the StarFive
kettenis [Mon, 6 Jun 2022 14:57:33 +0000 (14:57 +0000)]
Add stfclock(4), a driver for the clock controller found on the StarFive
JH7100 SoC.

ok jsg@

2 years agoSimplify solock() and sounlock(). There is no reason to return a value
claudio [Mon, 6 Jun 2022 14:45:41 +0000 (14:45 +0000)]
Simplify solock() and sounlock(). There is no reason to return a value
for the lock operation and to pass a value to the unlock operation.
sofree() still needs an extra flag to know if sounlock() should be called
or not. But sofree() is called less often and mostly without keeping the lock.
OK mpi@ mvs@

2 years agoRemove unused prototype.
kettenis [Mon, 6 Jun 2022 14:34:11 +0000 (14:34 +0000)]
Remove unused prototype.
Fix a whitespace issue.

2 years agoFix comment + spacing.
tb [Mon, 6 Jun 2022 13:46:37 +0000 (13:46 +0000)]
Fix comment + spacing.

Apparently 60 * 5 + 4 seconds is 5 minutes. Presumably this is the case
with sufficiently potent crack, which would explain a few things in here.

2 years agoRemove incorrect and ungrammattical comment
tb [Mon, 6 Jun 2022 13:18:34 +0000 (13:18 +0000)]
Remove incorrect and ungrammattical comment

The fallback to SHA-1 if SHA-256 is disabled fell victim to tedu many
moons ago when this file was still called s3_clnt.c and had no RCS ID.

2 years agoadjust two desired error messages after roff_escape.c rev. 1.11
schwarze [Mon, 6 Jun 2022 12:17:31 +0000 (12:17 +0000)]
adjust two desired error messages after roff_escape.c rev. 1.11
improved diagnostics for the \C escape sequence

2 years agoAllow arbitrary argument delimiters for \C, like groff does.
schwarze [Mon, 6 Jun 2022 12:09:18 +0000 (12:09 +0000)]
Allow arbitrary argument delimiters for \C, like groff does.
The restriction of only allowing ' as the delimiter was introduced
by kristaps@ on 2011/04/09 when he first supported \C.
For most other escape sequences, similar restrictions were relaxed
later on, but for the rarely used \C, it was apparently forgotten.

While here, reject empty character names: they are never valid.

2 years agoThe StarFive JH7100 SoC has peripherals that only support 32-bit DMA
kettenis [Mon, 6 Jun 2022 10:50:56 +0000 (10:50 +0000)]
The StarFive JH7100 SoC has peripherals that only support 32-bit DMA
(in particular the dwmmc(4) and dwge(4) devices; there may be more).

ok jsg@

2 years agoAdd support for the XHCI function that is part of the Cadence USB3 DRD
kettenis [Mon, 6 Jun 2022 09:46:07 +0000 (09:46 +0000)]
Add support for the XHCI function that is part of the Cadence USB3 DRD
controller.  There are various incarnations of the controller.  This diff
only adds support for the "V1"/"CDNS3" version as found on the StarFive
JH7100 SoC.  Further changes may be needed to support controllers integrated
on other SoCs.

ok jsg@

2 years agoFix spaces before tabs
tb [Mon, 6 Jun 2022 08:48:11 +0000 (08:48 +0000)]
Fix spaces before tabs

2 years agohave compute_checksum return a status, so that we don't report similar
espie [Mon, 6 Jun 2022 08:18:22 +0000 (08:18 +0000)]
have compute_checksum return a status, so that we don't report similar
errors several times (for instance, if a file doesn't exist, its checksum
is not going to match, obviously)

2 years agozap fairly old bug from refactoring: we already validated all the set plists,
espie [Mon, 6 Jun 2022 08:03:32 +0000 (08:03 +0000)]
zap fairly old bug from refactoring: we already validated all the set plists,
don't do it again (would skew the file system usage a bit).

Also: we don't need to check for firmware if we're not actively deleting.
normal updates won't touch them.

2 years agothis message is seriously outdated: the packing-lists have been read by
espie [Mon, 6 Jun 2022 07:57:21 +0000 (07:57 +0000)]
this message is seriously outdated: the packing-lists have been read by
the code that calls delete_handle already

2 years agoYet another iteration of the tied algorithm: some packages contain
espie [Mon, 6 Jun 2022 07:39:39 +0000 (07:39 +0000)]
Yet another iteration of the tied algorithm: some packages contain
several hundred copies of the same file (even thousands! I'm looking at you
sdcc), so matching through a list is O(n^2).

So hash the hashes on the actual file name so that we match directly if
the same name file didn't change, and use the first entry otherwise, since
the name won't match.

speeds up updating of texlive somewhat, and makes a huge difference for sdcc.

2 years agoalso zap signer if we zap digital-signature
espie [Mon, 6 Jun 2022 07:21:17 +0000 (07:21 +0000)]
also zap signer if we zap digital-signature

2 years agodrm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()
jsg [Mon, 6 Jun 2022 07:10:15 +0000 (07:10 +0000)]
drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()

From Gustavo A. R. Silva
195fffbf8291a84580762ac6e3101489954d0216 in linux 5.15.y/5.15.45
336feb502a715909a8136eb6a62a83d7268a353b in mainline linux

2 years agoexpand on the mismatches between the tarball and the packing-list
espie [Mon, 6 Jun 2022 06:57:35 +0000 (06:57 +0000)]
expand on the mismatches between the tarball and the packing-list

2 years agoMinor tweaks to psk modes regress
tb [Mon, 6 Jun 2022 06:11:04 +0000 (06:11 +0000)]
Minor tweaks to psk modes regress

2 years agoregen
jsg [Mon, 6 Jun 2022 03:59:38 +0000 (03:59 +0000)]
regen

2 years agodrm/amdgpu: add beige goby PCI ID
jsg [Mon, 6 Jun 2022 03:58:19 +0000 (03:58 +0000)]
drm/amdgpu: add beige goby PCI ID

From Alex Deucher
62e9bd20035b53ff6c679499c08546d96c6c60a7 in mainline linux

2 years agomove the calls to psk kex modes tests down to match order in ssl_tlsext.c
tb [Sun, 5 Jun 2022 20:37:24 +0000 (20:37 +0000)]
move the calls to psk kex modes tests down to match order in ssl_tlsext.c

2 years agoAdd regress coverage for PSK kex modes tlsext handlers.
tb [Sun, 5 Jun 2022 20:24:10 +0000 (20:24 +0000)]
Add regress coverage for PSK kex modes tlsext handlers.

2 years agoWith the improved escape sequence parser, it becomes easy to also improve
schwarze [Sun, 5 Jun 2022 13:42:49 +0000 (13:42 +0000)]
With the improved escape sequence parser, it becomes easy to also improve
diagnostics.  Distinguish "incomplete escape sequence", "invalid special
character", and "unknown special character" from the generic "invalid
escape sequence", also promoting them from WARNING to ERROR because
incomplete escape sequences are severe syntax violations and because
encountering an invalid or unknown special character makes it likely
that part of the document content intended by the authors gets lost.

2 years agoRevert accidentally committed check
tb [Sun, 5 Jun 2022 13:31:35 +0000 (13:31 +0000)]
Revert accidentally committed check

2 years agoRework how fib_priority is handled.
claudio [Sun, 5 Jun 2022 12:43:13 +0000 (12:43 +0000)]
Rework how fib_priority is handled.
Instead of passing it around all the time put the fib_priority into the
kroute state. It is only needed in send_rtmsg() in the end.
Additionally insert F_BGP_INSERTED routes with a special RTP_MINE priority.
This makes changing the fib_priority at runtime simpler because there
is no need to alter the kroute table anymore.
OK tb@ deraadt@

2 years agoSmall cleanup of error reporting:
schwarze [Sun, 5 Jun 2022 10:19:47 +0000 (10:19 +0000)]
Small cleanup of error reporting:
call mandoc_msg() only once at the end, not sometimes in the middle,
classify incomplete, non-expanding escape sequences as ESCAPE_ERROR,
and also reduce the number of return statemants;
no formatting change intended.

2 years agoenable interrupt coalescing.
dlg [Sun, 5 Jun 2022 02:54:18 +0000 (02:54 +0000)]
enable interrupt coalescing.

mvneta only supports coalescing tx completions by count, so this
uses the txmit value or half the ring as the threshold, whichever
is lower.

rx coalescing has a threshold on the number of packets, and a max
time it will wait before interrupting. however, it also has a
threshold for how many spare/empty descriptors there are on the
ring too. we use this latter threshold to have the chip interrupt
as soon as it uses the allocation that the rx ring moderation has
granted, and then first two to otherwise rate limit rx to about 4k
interrupts per second.

ok patrick@

2 years agouse the write lemtohXX functions for bits of the stats structure.
dlg [Sun, 5 Jun 2022 02:49:30 +0000 (02:49 +0000)]
use the write lemtohXX functions for bits of the stats structure.

unbreaks the build on bigendian archs.

found by deraadt@

2 years agoadd support for getting the frequency of the clocks mventa uses.
dlg [Sun, 5 Jun 2022 02:43:44 +0000 (02:43 +0000)]
add support for getting the frequency of the clocks mventa uses.

mvneta does interrupt coalescing based on time as counted by these
clocks, so being able to ask how fast they tick is useful.

lots of help and ok kettenis@

2 years agoMake iwm(4) handle 9k devices which do not support antenna B.
stsp [Sat, 4 Jun 2022 11:32:11 +0000 (11:32 +0000)]
Make iwm(4) handle 9k devices which do not support antenna B.

Problem reported by Chris Narkiewicz who owns such a device.
Johannes Berg provided helpful hints regarding the reason for
the firmware error seen by Chris.

2 years agodocument internal annotations a bit more, explain about the always-update
espie [Sat, 4 Jun 2022 10:12:38 +0000 (10:12 +0000)]
document internal annotations a bit more, explain about the always-update
changes, and be more specific about @digital-signature and @signer, since
we only use the one scheme now.

2 years agoThe parse stubs need to skip over the extension data.
tb [Sat, 4 Jun 2022 07:55:44 +0000 (07:55 +0000)]
The parse stubs need to skip over the extension data.

Found by anton with tlsfuzzer

ok anton

2 years agoWhen picking a buffer because one isn't specified by the user, ignore
nicm [Sat, 4 Jun 2022 07:42:07 +0000 (07:42 +0000)]
When picking a buffer because one isn't specified by the user, ignore
named buffers. GitHub issue 3212 from David le Blanc.

2 years agomatch on Gemini Lake HD Audio (0x3198)
jsg [Sat, 4 Jun 2022 03:13:40 +0000 (03:13 +0000)]
match on Gemini Lake HD Audio (0x3198)

on a Star Labs StarLite Mk IV laptop the audio device is subclass audio
not hd audio, so azalia does not match

reported and tested by Chris Narkiewicz
ok deraadt@

2 years agoKNF nit
tb [Sat, 4 Jun 2022 02:14:21 +0000 (02:14 +0000)]
KNF nit

2 years agoTweak a comment using review feedback from jsing
tb [Sat, 4 Jun 2022 01:14:43 +0000 (01:14 +0000)]
Tweak a comment using review feedback from jsing

2 years agoMemory leak when assigning a string to some of the built-in variables.
millert [Fri, 3 Jun 2022 19:46:09 +0000 (19:46 +0000)]
Memory leak when assigning a string to some of the built-in variables.
Allocated string erroneously marked DONTFREE.  From Miguel Pineiro Jr.

2 years agoThe fulfillment of an assignment operand had been truncating its
millert [Fri, 3 Jun 2022 19:42:27 +0000 (19:42 +0000)]
The fulfillment of an assignment operand had been truncating its
entry in ARGV (since circa 1989). From Miguel Pineiro Jr.

2 years agoFix a file management memory leak that appears to have been there
millert [Fri, 3 Jun 2022 19:40:56 +0000 (19:40 +0000)]
Fix a file management memory leak that appears to have been there
since the files array was first initialized with stdin, stdout, and
stderr (circa 1992).  From Miguel Pineiro Jr.

2 years agoAdd stubbed out handlers for the pre_shared_key extension
tb [Fri, 3 Jun 2022 13:31:49 +0000 (13:31 +0000)]
Add stubbed out handlers for the pre_shared_key extension

ok jsing

2 years agoImplement handlers for the psk_key_exchange_modes extensions.
tb [Fri, 3 Jun 2022 13:29:39 +0000 (13:29 +0000)]
Implement handlers for the psk_key_exchange_modes extensions.

ok jsing

2 years agoAdd a use_psk_dhe_ke flag to the TLSv1.3 handshake struct
tb [Fri, 3 Jun 2022 13:28:36 +0000 (13:28 +0000)]
Add a use_psk_dhe_ke flag to the TLSv1.3 handshake struct

This will be used to indicate client side support for DHE key
establishment.

ok jsing

2 years agoEnsure that a client who sent a PSK extension has also sent a PSK
tb [Fri, 3 Jun 2022 13:26:13 +0000 (13:26 +0000)]
Ensure that a client who sent a PSK extension has also sent a PSK
key exchange mode extension, as required by RFC 8446, 4.2.9.

ok jsing

2 years agoCheck tls_config_new() for NULL return
tb [Fri, 3 Jun 2022 13:23:16 +0000 (13:23 +0000)]
Check tls_config_new() for NULL return

This way we don't crash in tls_config_insecure_noverify_cert().

From Mateusz Piotrowski on bugs

ok claudio

2 years agoProvide #defines for the two currently registered PskKeyExchangeModes.
tb [Fri, 3 Jun 2022 13:11:04 +0000 (13:11 +0000)]
Provide #defines for the two currently registered PskKeyExchangeModes.

ok jsing

2 years agooops, update forgotten date in the footer
schwarze [Fri, 3 Jun 2022 12:01:42 +0000 (12:01 +0000)]
oops, update forgotten date in the footer

2 years agoDuring identifier parsing, handle undefined escape sequences
schwarze [Fri, 3 Jun 2022 11:50:25 +0000 (11:50 +0000)]
During identifier parsing, handle undefined escape sequences
in the same way as groff:
* \\ is always reduced to \
* \. is always reduced to .
* other undefined escape sequences are usually reduced to the escape name,
for example \G to G, except during the expansion of expanding escape
sequences having the standard argument form (in particular \* and \n),
in which case the backslash is preserved literally.

Yes, this is confusing indeed.
For example, the following have the same meaning:
* .ds \.   and   .ds .     which is not the same as   .ds \\.
* \*[\.]   and   \*[.]     which is not the same as   \*[\\.]
* .ds \G   and   .ds G     which is not the same as   .ds \\G
* \*[\G]   and   \*[\\G]   which is not the same as   \*[G]   <- sic!

To feel less dirty, have a leaning toothpick, if you are so inclined.

This patch also slightly improves the string shown by the "escaped
character not allowed in a name" error message.

2 years agoexpose hardware counters as kstats.
dlg [Fri, 3 Jun 2022 10:38:40 +0000 (10:38 +0000)]
expose hardware counters as kstats.

some of them are 16 bit, so check frequently.

now i can see what packets my apu1 is dropping in hardware.

ok claudio@

2 years agoDo not unintentionally turn off all mouse mode when button is also present.
nicm [Fri, 3 Jun 2022 08:09:16 +0000 (08:09 +0000)]
Do not unintentionally turn off all mouse mode when button is also present.

2 years agomove auth_openprincipals() and auth_openkeyfile() over to
djm [Fri, 3 Jun 2022 04:47:21 +0000 (04:47 +0000)]
move auth_openprincipals() and auth_openkeyfile() over to
auth2-pubkeyfile.c too; they make more sense there.

2 years agotest setenv in both client and server, test first-match-wins too
djm [Fri, 3 Jun 2022 04:31:54 +0000 (04:31 +0000)]
test setenv in both client and server, test first-match-wins too

2 years agoMake SetEnv directives first-match-wins in both sshd_config and
djm [Fri, 3 Jun 2022 04:30:46 +0000 (04:30 +0000)]
Make SetEnv directives first-match-wins in both sshd_config and
sshd_config; previously if the same name was reused then the last
would win (which is the opposite to how the config is supposed to
work).

While there, make the ssh_config parsing more like sshd_config.

bz3438, ok dtucker

2 years agoAdd missing *-sk types to ssh-keyscan manpage.
dtucker [Fri, 3 Jun 2022 04:00:15 +0000 (04:00 +0000)]
Add missing *-sk types to ssh-keyscan manpage.
From skazi0 via github PR#294.

2 years agoAdd period at end of "not known by any other names" message. github PR#320
dtucker [Fri, 3 Jun 2022 03:21:09 +0000 (03:21 +0000)]
Add period at end of "not known by any other names" message.  github PR#320
from jschauma, ok djm@

2 years agossh-keygen -A: do not generate DSA keys by default. Based on github PR#303
dtucker [Fri, 3 Jun 2022 03:17:42 +0000 (03:17 +0000)]
ssh-keygen -A: do not generate DSA keys by default.  Based on github PR#303
from jsegitz with man page text from jmc@, ok markus@ djm@

2 years agofix the definition of the MVNETA_PRXITTH Port RX Intr Threshold register
dlg [Fri, 3 Jun 2022 03:17:36 +0000 (03:17 +0000)]
fix the definition of the MVNETA_PRXITTH Port RX Intr Threshold register

2 years agoLet btrace(8) execute the END probe upon receiving a SIGTERM signal
jca [Thu, 2 Jun 2022 21:38:46 +0000 (21:38 +0000)]
Let btrace(8) execute the END probe upon receiving a SIGTERM signal

While SIGINT (already handled) makes sense for interactive use, handling
SIGTERM in the same manner is less surprising for scripting.  This lets
you do:

  btrace ... & some workload; kill $!

and get the expected output.

ok mpi@

2 years agoDo not attempt to use client in config file (it will be NULL), GitHub
nicm [Thu, 2 Jun 2022 21:19:32 +0000 (21:19 +0000)]
Do not attempt to use client in config file (it will be NULL), GitHub
issue 3206.

2 years agoWhen deleting or renaming a buffer and a buffer name is specified,
nicm [Thu, 2 Jun 2022 20:41:21 +0000 (20:41 +0000)]
When deleting or renaming a buffer and a buffer name is specified,
complain if the buffer doesn't exist instead of silently deleting or
renaming the most recent buffer. GitHub issue 3205.

2 years agoTake the size of allocation into account when checking the kernel reserve.
kettenis [Thu, 2 Jun 2022 18:00:53 +0000 (18:00 +0000)]
Take the size of allocation into account when checking the kernel reserve.

ok mpi@

2 years agoDon't treat the first arg as a 4.3BSD option string if it contains a '/'.
millert [Thu, 2 Jun 2022 15:35:55 +0000 (15:35 +0000)]
Don't treat the first arg as a 4.3BSD option string if it contains a '/'.
Also document that files-to-dump could be interpreted as a 4.3BSD option
if it doesn't contain a slash.  OK deraadt@

2 years agoSince \. is not a character escape sequence, re-classify it from the
schwarze [Thu, 2 Jun 2022 14:49:25 +0000 (14:49 +0000)]
Since \. is not a character escape sequence, re-classify it from the
wrong parsing class ESCAPE_SPECIAL to the better-suited parsing class
ESCAPE_UNDEF, exactly like it is already done for the similar \\,
which isn't a character escape sequence either.

No formatting change is intended just yet, but this will matter for
upcoming improvements in the parser for roff(7) macro, string, and
register names.

See the node "5.23.2 Copy Mode" in "info groff" regarding
what \\ and \. really mean.

2 years agoUse consistent spacing around assignments
tb [Thu, 2 Jun 2022 12:08:41 +0000 (12:08 +0000)]
Use consistent spacing around assignments

2 years agoOnly constraints and verify need static linking in here.
tb [Thu, 2 Jun 2022 11:48:36 +0000 (11:48 +0000)]
Only constraints and verify need static linking in here.

2 years agoAvoid the layering violation of re-parsing for \E in roff_expand().
schwarze [Thu, 2 Jun 2022 11:28:16 +0000 (11:28 +0000)]
Avoid the layering violation of re-parsing for \E in roff_expand().
To that end, add another argument to roff_escape()
returning the index of the escape name.
This also makes the code in roff_escape() a bit more uniform
in so far as it no longer needs the "char esc_name" local variable
but now does everything with indices into buf[].
No functional change.

2 years agoAdjust lowest allowed routing priority to be bigger than RTP_LOCAL.
claudio [Thu, 2 Jun 2022 11:12:47 +0000 (11:12 +0000)]
Adjust lowest allowed routing priority to be bigger than RTP_LOCAL.
RTP_LOCAL is internally used by the kernel and is not available for
userland. The minimal usable routing prio is 2.
OK tb@

2 years agoUse a common idiom to check if the user supplied routing priority is
claudio [Thu, 2 Jun 2022 11:05:15 +0000 (11:05 +0000)]
Use a common idiom to check if the user supplied routing priority is
in range. Also rephrase the error message.
OK tb@

2 years agoCleanup ktable_exists() usage and its warning message.
claudio [Thu, 2 Jun 2022 09:29:34 +0000 (09:29 +0000)]
Cleanup ktable_exists() usage and its warning message.

Check the return value in all cases and use a common idiom for this check.
OK tb@

2 years agoAdjust some warning messages to be a bit more accurate. ktable_update()
claudio [Thu, 2 Jun 2022 08:46:25 +0000 (08:46 +0000)]
Adjust some warning messages to be a bit more accurate. ktable_update()
actually loads a routing table and not really an rdomain.

2 years agoWhen running sysupgrade on -stable move to the next release, not
florian [Thu, 2 Jun 2022 07:44:18 +0000 (07:44 +0000)]
When running sysupgrade on -stable move to the next release, not
-current.
Found the hard way by & OK sthen

2 years agoImplement and enable IPv4, TCP, and UDP checksum offloading for igc.
mbuhl [Thu, 2 Jun 2022 07:41:17 +0000 (07:41 +0000)]
Implement and enable IPv4, TCP, and UDP checksum offloading for igc.

ok kevlo@

2 years agoStop hiding a few assertions behind the opt-in LOCKF_DIAGNOSTIC option.
anton [Thu, 2 Jun 2022 05:32:28 +0000 (05:32 +0000)]
Stop hiding a few assertions behind the opt-in LOCKF_DIAGNOSTIC option.
This code has already been exercised quite extensively by syzkaller and
got decent test coverage.

2 years agoenable aq(4) on arm64 now that it works reasonably well
jmatthew [Thu, 2 Jun 2022 03:09:39 +0000 (03:09 +0000)]
enable aq(4) on arm64 now that it works reasonably well

2 years agoFix a buffer overrun in the roff(7) escape sequence parser that could
schwarze [Wed, 1 Jun 2022 23:20:19 +0000 (23:20 +0000)]
Fix a buffer overrun in the roff(7) escape sequence parser that could
be triggered by macro arguments ending in double backslashes, for
example if people wrote .Sq "\\" instead of the correct .Sq "\e".

The bug was hard to find because it caused a segfault only very rarely,
according to my measurements with a probability of less than one permille.
I'm sorry that the first one to hit the bug was an arm64 release build
run by deraadt@.  Thanks to bluhm@ for providing access to an arm64
machine for debugging purposes.  In the end, the bug turned out to be
architecture-independent.

The reason for the bug was that i assumed an invariant that does not exist.
The function roff_parse_comment() is very careful to make sure that the
input buffer does not end in an escape character before passing it on,
so i assumed this is still true when reaching roff_expand() immediately
afterwards.  But roff_expand() can also be reached from roff_getarg(),
in which case there *can* be a lone escape character at the end of the
buffer in case copy mode processing found and converted a double
backslash.

Fix this by handling a trailing escape character correctly in the
function roff_escape().

The lesson here probably is to refrain from assuming an invariant
unless verifying that the invariant actually holds is reasonably
simple.  In some cases, in particular for invariants that are important
but not simple, it might also make sense to assert(3) rather than just
assume the invariant.  An assertion failure is so much better than a
buffer overrun...

2 years agochange amd64 pmap_convert to return void
dv [Wed, 1 Jun 2022 17:47:18 +0000 (17:47 +0000)]
change amd64 pmap_convert to return void

There are no other return options, so adjust function signature to
void. This also allows for cleaning up its usage in vmm(4) in the
vm pmap initialization logic.

ok mlarkin@

2 years agocallers to pf(4) must continue to run with packet as returned
sashan [Wed, 1 Jun 2022 17:34:13 +0000 (17:34 +0000)]
callers to pf(4) must continue to run with packet as returned
by firewall.

OK dlg@

2 years agoremove unused pmap_convert prototype from i386
dv [Wed, 1 Jun 2022 17:16:00 +0000 (17:16 +0000)]
remove unused pmap_convert prototype from i386

Leftover lint from early days of vmm(4).

ok mlarkin@

2 years agoIf escape-time is 0, force to 1 instead - not waiting at all is asking
nicm [Wed, 1 Jun 2022 15:43:22 +0000 (15:43 +0000)]
If escape-time is 0, force to 1 instead - not waiting at all is asking
for problems on some platforms.

2 years agoRemove a confusing comment that has been stale since e2k19 (r1.26).
tb [Wed, 1 Jun 2022 14:48:53 +0000 (14:48 +0000)]
Remove a confusing comment that has been stale since e2k19 (r1.26).

2 years agoAdd a regress test for the end of lock range ambiguity bug.
visa [Wed, 1 Jun 2022 14:21:50 +0000 (14:21 +0000)]
Add a regress test for the end of lock range ambiguity bug.

2 years agoFix ambiguity with lock range end
visa [Wed, 1 Jun 2022 14:18:43 +0000 (14:18 +0000)]
Fix ambiguity with lock range end

When the user requests a lock range that ends at LLONG_MAX, replace
the end point with the special EOF value -1. This avoids ambiguity
with lf_end in lf_split(). The ambiguity could result in a broken
data structure.

This change is visible to userspace in a corner case. When a lock range
has been requested with an end point at absolute position LLONG_MAX,
fcntl(F_GETLK) returns l_len == 0, instead of a positive value, for that
range. This seems consistent with FreeBSD and Linux.

OK anton@

Reported-by: syzbot+c93afea6c27a3fa3af39@syzkaller.appspotmail.com
2 years agoFix lock range start when l_whence == SEEK_END and l_len < 0.
visa [Wed, 1 Jun 2022 14:16:28 +0000 (14:16 +0000)]
Fix lock range start when l_whence == SEEK_END and l_len < 0.

OK anton@

2 years agoLimit the number of RSC checklist FileNameAndHash entries the same way
tb [Wed, 1 Jun 2022 10:59:21 +0000 (10:59 +0000)]
Limit the number of RSC checklist FileNameAndHash entries the same way
as mft FileAndHash entries are checked.

ok claudio job

2 years agoFix off-by-one in MAX_MANIFEST_ENTRIES check
tb [Wed, 1 Jun 2022 10:58:34 +0000 (10:58 +0000)]
Fix off-by-one in MAX_MANIFEST_ENTRIES check

ok claudio job