openbsd
12 months agoAdd a regress test to make sure that agentx responses equal to
martijn [Sun, 29 Oct 2023 11:15:09 +0000 (11:15 +0000)]
Add a regress test to make sure that agentx responses equal to
searchrange.end are rejected.

12 months agosearchrange.end is non-inclusive. Adjust the tests for that.
martijn [Sun, 29 Oct 2023 11:12:57 +0000 (11:12 +0000)]
searchrange.end is non-inclusive. Adjust the tests for that.

OK tb@

12 months agoAdd a test to the end of agentx_varbind_finalize(), after completing the
martijn [Sun, 29 Oct 2023 11:10:07 +0000 (11:10 +0000)]
Add a test to the end of agentx_varbind_finalize(), after completing the
full OID, that checks if we're >= searchrange.end. If so, just make it
an endOfMIBView.

OK tb@

12 months agoOnly try to chown logfiles that exist to prevent spurious errors.
dtucker [Sun, 29 Oct 2023 06:22:07 +0000 (06:22 +0000)]
Only try to chown logfiles that exist to prevent spurious errors.

12 months agosubstr: fix buffer overflow with utf-8 strings
millert [Sat, 28 Oct 2023 22:38:22 +0000 (22:38 +0000)]
substr: fix buffer overflow with utf-8 strings

We need to use u8_strlen(), not strlen(), to compute the length.
Otherwise, there may be an out of bounds write when writing the NUL
terminator to set the length of the substring.
https://github.com/onetrueawk/awk/pull/205

12 months agoBack out change to make the default -std=gnu99 for now.
millert [Sat, 28 Oct 2023 00:25:18 +0000 (00:25 +0000)]
Back out change to make the default -std=gnu99 for now.

There has been some unexpected fallout.  Requested by deraadt@.

12 months agoForward TCP LRO disabling to parent devices.
jan [Fri, 27 Oct 2023 20:56:47 +0000 (20:56 +0000)]
Forward TCP LRO disabling to parent devices.

Also disable TCP LRO on bridged vlan(4) and default for bpe(4), nvgre(4) and
vxlan(4).

ok bluhm@

12 months agoMake out-of-swap checks more robust.
mpi [Fri, 27 Oct 2023 19:18:53 +0000 (19:18 +0000)]
Make out-of-swap checks more robust.

Consider that the swap space is full when 99% of it is filled with pages that
are no longer present in memory.  This prevents deadlocks when out-of-swap if
some swap ranges had I/O errors and have been marked as 'bad', or if some
pages are unreachable by the pagedaemon and still holding some slots.

Also introduce uvm_swapisfilled() to check if there are some free slots in
the swap.  Note that we consider the swap space completly filled if it is not
possible to write a full cluster.  This prevents deadlocks if a few slots are
never allocated.

ok miod@

12 months agoDo not decrement the swap counter if the anon is associated to a "bad" slot.
mpi [Fri, 27 Oct 2023 19:13:51 +0000 (19:13 +0000)]
Do not decrement the swap counter if the anon is associated to a "bad" slot.

When such anon is freed its content is obviously not living in swap.

ok miod@

12 months agoSimplify the handling of optparamlen and RFC9072 support.
claudio [Fri, 27 Oct 2023 14:22:43 +0000 (14:22 +0000)]
Simplify the handling of optparamlen and RFC9072 support.

Use the ibuf_size() of the optional params (opb) when writing the various
headers. Only use optparamlen to write the Opt Parm Len field of the OPEN
message. Since there the size could be forced to 255 in case of a RFC9072
exended header. Also use size_t for optparamlen since the new ibuf API
no longer depends on using the right sized type.
OK tb@

12 months agoIf an invalid varbindlist was returned by a backend we would call
martijn [Fri, 27 Oct 2023 10:32:11 +0000 (10:32 +0000)]
If an invalid varbindlist was returned by a backend we would call
appl_request_upstream_resolve() twice where the first call would already
return a reply and free the upstream request, leading to a use after
free.
Make appl_request_downstream_free() call appl_request_upstream_resolve()
unconditionally and remove the call from appl_response().

OK tb@

12 months agoAdd a test that would cause a use after free previously by sending a
martijn [Fri, 27 Oct 2023 10:26:20 +0000 (10:26 +0000)]
Add a test that would cause a use after free previously by sending a
protocol error-ed message and immediately followed up by a connection
close.

OK tb@

12 months agoUse event_add(), instead of calling appl_agentx_send() directly. If an
martijn [Fri, 27 Oct 2023 10:23:58 +0000 (10:23 +0000)]
Use event_add(), instead of calling appl_agentx_send() directly. If an
error occurs the connection will be freed and if the caller uses the
connection afterwards it will lead to a use after free.

OK tb@

12 months agoThe holdtime is added to the ibuf with ibuf_add_n16() so no need to
claudio [Fri, 27 Oct 2023 09:40:27 +0000 (09:40 +0000)]
The holdtime is added to the ibuf with ibuf_add_n16() so no need to
htons() the value before.
OK tb@

12 months agoInclude wait(2) status in error message, in the hopes of providing clues
anton [Fri, 27 Oct 2023 07:33:06 +0000 (07:33 +0000)]
Include wait(2) status in error message, in the hopes of providing clues
on why this occasionally fails.

12 months agosync
naddy [Thu, 26 Oct 2023 21:30:52 +0000 (21:30 +0000)]
sync

12 months agodo not create /usr/local/share/nls and subdirectories by default
naddy [Thu, 26 Oct 2023 19:28:30 +0000 (19:28 +0000)]
do not create /usr/local/share/nls and subdirectories by default

The share/nls/<locale> paths are unused.

ok miod@ deraadt@

12 months agomake use of bsd.regress.mk in extra and interop targets; ok dtucker@
anton [Thu, 26 Oct 2023 18:52:45 +0000 (18:52 +0000)]
make use of bsd.regress.mk in extra and interop targets; ok dtucker@

12 months agoFix a typo spotted by miod@.
millert [Thu, 26 Oct 2023 18:46:42 +0000 (18:46 +0000)]
Fix a typo spotted by miod@.

12 months agoA few micro-optimizations; ok asou@
otto [Thu, 26 Oct 2023 17:59:16 +0000 (17:59 +0000)]
A few micro-optimizations; ok asou@

12 months agoMake gnu99 the default for gcc 3.3.6 and 4.2.1, not gnu89.
millert [Thu, 26 Oct 2023 17:33:35 +0000 (17:33 +0000)]
Make gnu99 the default for gcc 3.3.6 and 4.2.1, not gnu89.
While these versions of gcc don't have full C99 support, it is
better than defaulting to C89 when building modern software.
OK deraadt@

12 months agothe dependency should have been moved down
deraadt [Thu, 26 Oct 2023 17:13:50 +0000 (17:13 +0000)]
the dependency should have been moved down

12 months agowhitespace cleanup my fingers couldn't avoid doing while i was re-reading
deraadt [Thu, 26 Oct 2023 16:26:01 +0000 (16:26 +0000)]
whitespace cleanup my fingers couldn't avoid doing while i was re-reading
the parsing code

12 months agodelete incorrect dependency
deraadt [Thu, 26 Oct 2023 14:34:15 +0000 (14:34 +0000)]
delete incorrect dependency

12 months agoinstall CDs now available. (these are EFI-only)
deraadt [Thu, 26 Oct 2023 14:29:13 +0000 (14:29 +0000)]
install CDs now available.  (these are EFI-only)

12 months agoconstruct EFI bootable cdXX.iso and instalXX.iso files
deraadt [Thu, 26 Oct 2023 14:27:01 +0000 (14:27 +0000)]
construct EFI bootable cdXX.iso and instalXX.iso files

12 months agoadd cd9660
jsg [Thu, 26 Oct 2023 14:13:37 +0000 (14:13 +0000)]
add cd9660

12 months agomake efi_getdisklabel_cd9660() handle a block size of 512 and simplify
jsg [Thu, 26 Oct 2023 14:08:48 +0000 (14:08 +0000)]
make efi_getdisklabel_cd9660() handle a block size of 512 and simplify
ok yasuoka@

12 months agoSkip conch interop tests when not enabled instead of fatal.
dtucker [Thu, 26 Oct 2023 12:44:07 +0000 (12:44 +0000)]
Skip conch interop tests when not enabled instead of fatal.

12 months agoTidy includes
tb [Thu, 26 Oct 2023 09:08:57 +0000 (09:08 +0000)]
Tidy includes

12 months agoHide X509_ALGOR_set_md() for LIBRESSL_INTERNAL
tb [Thu, 26 Oct 2023 08:01:56 +0000 (08:01 +0000)]
Hide X509_ALGOR_set_md() for LIBRESSL_INTERNAL

12 months agoProvide prototype for X509_ALGOR_set_md()
tb [Thu, 26 Oct 2023 08:01:38 +0000 (08:01 +0000)]
Provide prototype for X509_ALGOR_set_md()

Once we remove X509_ALGOR_set_md() we can link this test statically and use
X509_ALGOR_set_evp_md() but for now make sure the documented workaround for
this garbage API works.

12 months agoRework the MD setting in the RSA ASN.1 method
tb [Thu, 26 Oct 2023 07:57:54 +0000 (07:57 +0000)]
Rework the MD setting in the RSA ASN.1 method

This streamlines the code to use safer idioms, do proper error checking
and be slightly less convoluted. Sprinkle a few references to RFC 8017
and explain better what we are doing and why. Clarify ownership and use
more consistent style.

This removes the last internal use of X509_ALGOR_set_md().

ok jsing

12 months agoFix unveil(2) in patch(1) with explicit patchfile.
bluhm [Wed, 25 Oct 2023 20:05:43 +0000 (20:05 +0000)]
Fix unveil(2) in patch(1) with explicit patchfile.

A backup file should be created in the directory of the original
file, but only the current directory was unveiled.  Then the patched
file was created in /tmp and did not replace the original patchfile
in place.  If a patchfile is passed in argv[0], unveil its directory
instead of current directory.

OK florian@ deraadt@ millert@

12 months agotypo; from katagawa gmail
deraadt [Wed, 25 Oct 2023 15:51:45 +0000 (15:51 +0000)]
typo; from katagawa gmail

12 months agovmd(8): stop toggling irq deassert for edge triggered devs.
dv [Wed, 25 Oct 2023 12:44:28 +0000 (12:44 +0000)]
vmd(8): stop toggling irq deassert for edge triggered devs.

For edge-triggered devices, there's no need to deassert an irq given
how vmd(8) emulates a pic.  Deassertion grabs a lock and can trigger
the ioctl for toggling pending interrupts causing a race condition.
This results in a storm of vm-exits and guest vcpu becoming
unresponsive.

The original sign of this issue is guest "pauses" when pasting text
into a serial console connection in something like xterm(1).

Tested by mbuhl@, cheloha@, sashan@, kn@, and mlarkin@.

"go for it", mlarkin@

12 months agookay, that one ought to work.
espie [Wed, 25 Oct 2023 11:14:42 +0000 (11:14 +0000)]
okay, that one ought to work.
Recognize + only right before =

12 months agoMake `vscsi_filtops' mpsafe. filt_vscsiread() checks `sc_ccb_i2t'
mvs [Wed, 25 Oct 2023 09:36:47 +0000 (09:36 +0000)]
Make `vscsi_filtops' mpsafe. filt_vscsiread() checks `sc_ccb_i2t'
protected by `sc_state_mtx' mutex(9), so use it to protect `sc_klist'
knotes list too.

ok claudio

12 months agossh conch interop tests requires a controlling terminal; ok dtucker@
anton [Wed, 25 Oct 2023 08:01:59 +0000 (08:01 +0000)]
ssh conch interop tests requires a controlling terminal; ok dtucker@

12 months agoImport regenerated moduli.
dtucker [Wed, 25 Oct 2023 05:38:08 +0000 (05:38 +0000)]
Import regenerated moduli.

12 months agosync
deraadt [Wed, 25 Oct 2023 00:21:02 +0000 (00:21 +0000)]
sync

12 months agoImplement the man(7) .MR macro, a 2023 GNU extension.
schwarze [Tue, 24 Oct 2023 20:30:49 +0000 (20:30 +0000)]
Implement the man(7) .MR macro, a 2023 GNU extension.
The syntax and semantics is almost identical to mdoc(7) .Xr.

This will be needed for reading the groff manual pages once our port
will be updated to 1.23, and the Linux Manual Pages Project is also
determined to start using it sooner or later.  I did not advocate for
this new macro, but since we want to remain able to read all manual
pages found in the wild, there is little choice but to support it.
At least it is easy to do, they basically copied .Xr.

12 months agoMake hrSWRunPath use argv[0], instead of p_comm. hrSWRunName is supposed
martijn [Tue, 24 Oct 2023 18:27:26 +0000 (18:27 +0000)]
Make hrSWRunPath use argv[0], instead of p_comm. hrSWRunName is supposed
to be a descriptive name, where hrSWRunPath should give the full path to
the binary. While argv[0] can contain any of a simple binary name, the
full path, or a custom name given by the application itself, it gives us
the option to retrieve both pieces of information. This is also the
same distinction made by netsnmp.

This also keeps the default command column from top(1) and snmptop in
sync, and now allows for identical output in the column between `top -C`
and `snmptop -Cpa`

OK tb@

12 months agoAdd support for HOST-RESOURCES-MIB:hrSWRunPerfTable by adding
martijn [Tue, 24 Oct 2023 18:16:05 +0000 (18:16 +0000)]
Add support for HOST-RESOURCES-MIB:hrSWRunPerfTable by adding
hrSWRunPerfCPU and hrSWRunPerfMem. This allows snmptop to work with
snmpd(8). Math copied from top(1).

OK tb@

12 months agoadd fallback IPv6 address for ftplist1.openbsd.org; ok phessler@
naddy [Tue, 24 Oct 2023 18:03:53 +0000 (18:03 +0000)]
add fallback IPv6 address for ftplist1.openbsd.org; ok phessler@

12 months agoAdd a new regression framework for snmpd.
martijn [Tue, 24 Oct 2023 14:34:40 +0000 (14:34 +0000)]
Add a new regression framework for snmpd.

There are still many test cases left to write, so leave snmpd.sh in place
to test for cases not yet implemented by the new code.

12 months agoFC3416 section 4.2.1 (and others) tells us that if an error occurs the
martijn [Tue, 24 Oct 2023 14:21:58 +0000 (14:21 +0000)]
FC3416 section 4.2.1 (and others) tells us that if an error occurs the
varbindlist in the response must be identical to the original request.

OK tb@

12 months agoCertain error codes are only intended for certain request-types. Add an
martijn [Tue, 24 Oct 2023 14:19:44 +0000 (14:19 +0000)]
Certain error codes are only intended for certain request-types. Add an
appl_error_valid() function to test for this.

OK tb@

12 months agoIf a backend registers as an instance it must never return OIDs below
martijn [Tue, 24 Oct 2023 14:17:20 +0000 (14:17 +0000)]
If a backend registers as an instance it must never return OIDs below
their registration. Add a test for this in appl_varbind_valid().

OK and minor nit tb@

12 months agoset ab_range explicitly to 1 for appl_agentx_session instead of relying
martijn [Tue, 24 Oct 2023 14:11:14 +0000 (14:11 +0000)]
set ab_range explicitly to 1 for appl_agentx_session instead of relying
on malloc random garbage.

OK tb@

12 months agoWhen returning an endOfMibView we must always set it on the requested OID.
martijn [Tue, 24 Oct 2023 14:06:00 +0000 (14:06 +0000)]
When returning an endOfMibView we must always set it on the requested OID.

OK tb@

12 months agoRequire callers to use ibuf_fd_get() to extract the passed fd from an ibuf.
claudio [Tue, 24 Oct 2023 14:05:23 +0000 (14:05 +0000)]
Require callers to use ibuf_fd_get() to extract the passed fd from an ibuf.

In imsg_free() close any fd that was not claimed automatically to prevent
filedescriptor leaks. In ibuf_dequeue() remvoe code which is now part of
imsg_free().
OK tb@

12 months agoWhen opening 2 sessions on an agentx connection and registering 2
martijn [Tue, 24 Oct 2023 14:02:52 +0000 (14:02 +0000)]
When opening 2 sessions on an agentx connection and registering 2
overlapping regions on the different sessions, e.g. by differing in
priority and we close the underlying connection with an outstanding
request to the dominant region we will call appl_agentx_free(), which
sequentially closes all sessions. If the session with the outstanding
request is closed before the second session the request is retried
before said session is cleaned up and it will try to send it over a
conn_ax which at that point has been set to NULL, resulting in a
SIGSEGV.

Simply return early and let this second request be cancelled by the
cleanup of the second session.

OK tb@

12 months agoRemove bold8x16 font.
fcambus [Tue, 24 Oct 2023 13:52:49 +0000 (13:52 +0000)]
Remove bold8x16 font.

Since we have imported the IBM encoded version of "Spleen 8x16" as a
replacement, there is no reason to keep it anymore.

OK miod@

12 months agoFix appl_unregister() when called with range_subid set to !0.
martijn [Tue, 24 Oct 2023 13:50:47 +0000 (13:50 +0000)]
Fix appl_unregister() when called with range_subid set to !0.

OK tb@

12 months agoFix appl_register() when called with range_subid set to !0.
martijn [Tue, 24 Oct 2023 13:46:11 +0000 (13:46 +0000)]
Fix appl_register() when called with range_subid set to !0.

OK tb@

12 months agoRFC2741 section 6.2.2 says that reasonByManager can only be used by the
martijn [Tue, 24 Oct 2023 13:41:16 +0000 (13:41 +0000)]
RFC2741 section 6.2.2 says that reasonByManager can only be used by the
agentx master. Treat this reason as a parseerror.

OK tb@

12 months agoappl_agentx_free() closes any open sessions before freeing everything up.
martijn [Tue, 24 Oct 2023 13:37:02 +0000 (13:37 +0000)]
appl_agentx_free() closes any open sessions before freeing everything up.
Up until now all sessions were closed with reasonShutdown, which is not
accurate for every situation. Give it an additional reason argument that
propagates to appl_agentx_forceclose().

OK tb@

12 months agorevert Subst.pm r1.24 again, it breaks package creation
naddy [Tue, 24 Oct 2023 13:28:43 +0000 (13:28 +0000)]
revert Subst.pm r1.24 again, it breaks package creation

'+' is a widely used character in LIBxxx_VERSION, e.g. LIBFLAC++_VERSION.
Making it illegal breaks numerous packages.

12 months agoAlways check if the context is available inside appl_agentx_recv().
martijn [Tue, 24 Oct 2023 13:28:11 +0000 (13:28 +0000)]
Always check if the context is available inside appl_agentx_recv().
Not every PDU goes through application.c.

OK tb@

12 months agoNormally context switches happen in mi_switch() but there are 3 cases
claudio [Tue, 24 Oct 2023 13:20:09 +0000 (13:20 +0000)]
Normally context switches happen in mi_switch() but there are 3 cases
where a switch happens outside. Cleanup these code paths and make the
machine independent.

- when a process forks (fork, tfork, kthread), the new proc needs to
  somehow be scheduled for the first time. This is done by proc_trampoline.
  Since proc_trampoline is machine dependent assembler code change
  the MP specific proc_trampoline_mp() to proc_trampoline_mi() and make
  sure it is now always called.
- cpu_hatch: when booting APs the code needs to jump to the first proc
  running on that CPU. This should be the idle thread for that CPU.
- sched_exit: when a proc exits it needs to switch away from itself and
  then instruct the reaper to clean up the rest. This is done by switching
  to the idle loop.

Since the last two cases require a context switch to the idle proc factor
out the common code to sched_toidle() and use it in those places.

Tested by many on all archs.
OK miod@ mpi@ cheloha@

12 months agoAdd chacha aliases for OpenSSL compatibility
tb [Tue, 24 Oct 2023 13:09:54 +0000 (13:09 +0000)]
Add chacha aliases for OpenSSL compatibility

OpenSSL has the 20 in the long and short names, so add aliases to the
existing names to make things work. In particular, EVP_get_cipherbyname()
will now return EVP_chacha20() for both 'ChaCha20' and 'chacha20'.

Found by Facundo Tuesca when trying to add LibreSSL support for ChaCha20 in
https://github.com/pyca/cryptography/pull/9209

ok jsing

12 months agoVerify if supplied AgentX PDU header flags are valid for given PDU type
martijn [Tue, 24 Oct 2023 12:57:40 +0000 (12:57 +0000)]
Verify if supplied AgentX PDU header flags are valid for given PDU type
inside appl_agentx_recv().
While here clean up the logging a bit.

OK tb@

12 months agocall vttidy() in the exit path for the batch mode
op [Tue, 24 Oct 2023 10:26:02 +0000 (10:26 +0000)]
call vttidy() in the exit path for the batch mode

Diff by Mark Willson (mark [at] hydrus.org.uk), thank you!

12 months agorevert rev 1.19 'drm/radeon: Fix eDP for single-display iMac11,2'
jsg [Tue, 24 Oct 2023 10:12:09 +0000 (10:12 +0000)]
revert rev 1.19 'drm/radeon: Fix eDP for single-display iMac11,2'

mglocker@ reports this caused the screen to stay black on iMac11,2 when
radeondrm takes over

12 months agoMerge two equivalent if blocks.
mpi [Tue, 24 Oct 2023 10:00:22 +0000 (10:00 +0000)]
Merge two equivalent if blocks.

No functional change, ok tb@

12 months agoDelete any existing v4 address before setting a new one. This allows us
jmatthew [Tue, 24 Oct 2023 09:13:22 +0000 (09:13 +0000)]
Delete any existing v4 address before setting a new one.  This allows us
to keep a working default route when the address changes.

ok dlg@ kn@

12 months agoRFC2741 section 7.1.1 tells us that if a pdu can't be parsed we must
martijn [Tue, 24 Oct 2023 09:00:53 +0000 (09:00 +0000)]
RFC2741 section 7.1.1 tells us that if a pdu can't be parsed we must
return a parseerror. Make sure we can differentiate between parseerror and
openfailed.

OK tb@

12 months agoAccording to RFC2741 section 6.1.1 an agentx-response-pdu shouldn't have
martijn [Tue, 24 Oct 2023 08:54:52 +0000 (08:54 +0000)]
According to RFC2741 section 6.1.1 an agentx-response-pdu shouldn't have
the NON_DEFAULT_CONTEXT set. Remove the argument from ax_response().

OK tb@

12 months agoMake sure that unpacking of an AgentX OID doesn't contain more than 128
martijn [Tue, 24 Oct 2023 08:48:41 +0000 (08:48 +0000)]
Make sure that unpacking of an AgentX OID doesn't contain more than 128
elements.

OK tb@

12 months agoRemove filter-pf-addresses. This feature has been deprecated since 7.2 in
martijn [Tue, 24 Oct 2023 08:41:20 +0000 (08:41 +0000)]
Remove filter-pf-addresses. This feature has been deprecated since 7.2 in
favour of 'blocklist pfTblAddrTable'.

OK tb@

12 months agoRemove the statement that .TQ was "rarely used even in GNU manual pages".
schwarze [Mon, 23 Oct 2023 22:57:51 +0000 (22:57 +0000)]
Remove the statement that .TQ was "rarely used even in GNU manual pages".

It appears the Linux Manual Pages project started to quite aggressively
use .TQ ever for cases where it not only provides no value, but makes
formatting worse even when it formats as intended.  It's also a bad idea
to use it that aggressively because .TQ has particularly catastrophic
formatting behaviour on formatters (other than groff and mandoc) that do
not support it: It essentially has the effect of omitting the topic of
the discussion from the formatted version of the manual page, but in
such a way that it does not become apparent to the reader that anything
is missing.

But whether this is wise or stupid is their problem and none of our
business.  Either way, we should not call a thing "rarely used"
after that is no longer true.

Thanks to Alejandro Colomar <alx at kernel org org>
for making me aware that the statement is no longer true.

12 months agoDo not print "retrieving revision 1.13" while doing cvs diff.
bluhm [Mon, 23 Oct 2023 21:59:00 +0000 (21:59 +0000)]
Do not print "retrieving revision 1.13" while doing cvs diff.

Provide shorter diffs without unnecessary debugging output.
Note that this affects cvs installed on the server side.

OK deraadt@

12 months agosorry, somehow I did redo this line badly and didn't retest
espie [Mon, 23 Oct 2023 21:53:54 +0000 (21:53 +0000)]
sorry, somehow I did redo this line badly and didn't retest

12 months agocreate __OpenBSD__ versions that use futex() with the correct number
deraadt [Mon, 23 Oct 2023 20:40:24 +0000 (20:40 +0000)]
create __OpenBSD__ versions that use futex() with the correct number
of arguments and without using syscall().  the glibc people should be
ashamed of the mess they created.
ok miod

12 months agoonce again, i forgot to update the date in the footer
schwarze [Mon, 23 Oct 2023 20:15:36 +0000 (20:15 +0000)]
once again, i forgot to update the date in the footer

12 months agoSupport some escape sequences, in particular character escape sequences,
schwarze [Mon, 23 Oct 2023 20:07:18 +0000 (20:07 +0000)]
Support some escape sequences, in particular character escape sequences,
inside \w arguments, and skip most other escape sequences when measuring
the output length in this way because most escape sequences contribute
little or nothing to text width: for example, consider font escapes in
terminal output.

This implementation is very rudimentary.  In particular, it assumes that
every character has the same width.  No attempt is made to detect
double-width or zero-width Unicode characters or to take dependencies on
output devices or fonts into account.  These limitations are hard to
avoid because mandoc has to interpolate \w at the parsing stage when the
output device is not yet known.  I really do not want the content of the
syntax tree to depend on the output device.

Feature requested by Paul <Eggert at cs dot ucla dot edu>, who also
submitted a patch, but i chose to commit this very different patch
with almost the same functionality.
His input was still very valuable because complete support for \w is
out of the question, and consequently, the main task is identifying
subsets of the feature that are needed for real-world manual pages
and can be supported without uprooting the whole forest.

12 months agoRevert Subst.pm r1.22. It broke ordinary pkg_add usage
tb [Mon, 23 Oct 2023 19:45:28 +0000 (19:45 +0000)]
Revert Subst.pm r1.22. It broke ordinary pkg_add usage

12 months agoUse xoff instead of *olen in the shift_right() call. xoff is the right
claudio [Mon, 23 Oct 2023 13:07:44 +0000 (13:07 +0000)]
Use xoff instead of *olen in the shift_right() call. xoff is the right
value here since *olen is (conditionally) set a few lines later to the
same value as xoff.

Should fix the CodeQL warnings because *olen is dereferenced without
proper NULL check.

OK tb@

12 months agoUse private key that is allowed by sshd defaults in conch interop tests.
anton [Mon, 23 Oct 2023 11:30:49 +0000 (11:30 +0000)]
Use private key that is allowed by sshd defaults in conch interop tests.

ok dtucker@

12 months agoPrevent wg(4) stuck on peer destruction.
mvs [Mon, 23 Oct 2023 10:22:05 +0000 (10:22 +0000)]
Prevent wg(4) stuck on peer destruction.

While interface going down and output stopped, packets could rest in
`if_snd' queue. So the (!ifq_empty(&sc->sc_if.if_snd)) condition will
always be true and wg_peer_destroy() will sleep until interface became
up and stuck packets transmitted.

Check IFF_RUNNING flag within (!ifq_empty(&sc->sc_if.if_snd)) loop in
wg_peer_destroy(). If the flag is not set that means interface is down,
so drain the `if_snd' queue manually to prevent wg_peer_destroy() stuck.

Problem reported and fix tested by Kirill Miazine.

ok bluhm@

12 months agouse more natural (and new) += with REGRESSION_TESTING
espie [Mon, 23 Oct 2023 08:38:58 +0000 (08:38 +0000)]
use more natural (and new) += with REGRESSION_TESTING

12 months agosplit on spaces as well, to take advantage of +=
espie [Mon, 23 Oct 2023 08:38:14 +0000 (08:38 +0000)]
split on spaces as well, to take advantage of +=

12 months agoadd some limited capability to -DVAR+=value
espie [Mon, 23 Oct 2023 08:37:45 +0000 (08:37 +0000)]
add some limited capability to -DVAR+=value
to be used with REGRESSION_TESTING, where it's somewhat inconvenient to
know the full list in advance.

12 months agoUnzoom window at start of destroy so it doesn't happen later (when
nicm [Mon, 23 Oct 2023 08:12:00 +0000 (08:12 +0000)]
Unzoom window at start of destroy so it doesn't happen later (when
destroying panes) after the layout has been freed, GitHub issue 3717.

12 months agoFix radiusd(8) to fixup MPPE-{Send,Recv}-Key and Tunnel-Password
yasuoka [Mon, 23 Oct 2023 00:58:32 +0000 (00:58 +0000)]
Fix radiusd(8) to fixup MPPE-{Send,Recv}-Key and Tunnel-Password
attributes of the response properly.

12 months agobt(5), btrace(8): execute END probe and print non-empty maps upon exit()
cheloha [Sun, 22 Oct 2023 19:30:35 +0000 (19:30 +0000)]
bt(5), btrace(8): execute END probe and print non-empty maps upon exit()

BPFTrace's exit() statement executes the END probe (if any) and prints
the contents of all non-empty maps before terminating the interpreter.

Implement this in btrace(8) with a halting check after each statement.
If a statement causes the program to halt, the condition bubbles up to
the top-level evaluation loop and causes rules_teardown() to run
immediately.

btrace(8) still performs a full rules_setup() if exit() is called
during the BEGIN probe, though the top-level evaluation loop is never
run.

One edge-like case: an exit() from the END probe is treated as an
early return; END is not executed multiple times.

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

ok mpi@

12 months agonew regression test for roff.c rev. 1.270:
schwarze [Sun, 22 Oct 2023 16:54:19 +0000 (16:54 +0000)]
new regression test for roff.c rev. 1.270:
infinite recursion in macro argument expansion

12 months agoWhile doing delayed expansion of escape sequences in macro arguments,
schwarze [Sun, 22 Oct 2023 16:01:58 +0000 (16:01 +0000)]
While doing delayed expansion of escape sequences in macro arguments,
correctly check for failure of the in-place expansion function.
If an argument not only does recursive delayed expansion
but infinitely recursive delayed expansion, this bug could
result in an ESCAPE_EXPAND assertion failure.

Thanks to Eric van Gyzen <vangyzen at FreeBSD> for finding this bug
by inspecting FreeBSD source code.

12 months agocorrect Va in previous;
jmc [Sun, 22 Oct 2023 14:04:52 +0000 (14:04 +0000)]
correct Va in previous;

12 months agoA few more tests
otto [Sun, 22 Oct 2023 12:20:07 +0000 (12:20 +0000)]
A few more tests

12 months agoWhen option D is active, store callers for all chunks; this avoids
otto [Sun, 22 Oct 2023 12:19:26 +0000 (12:19 +0000)]
When option D is active, store callers for all chunks; this avoids
the 0x0 call sites for leak reports. Also display more info on
detected write of free chunks: print the info about where the chunk
was allocated, and for the preceding chunk as well.
ok asou@

12 months agofix 40 MHz channel validation checks for the 2.4 GHz channel range
stsp [Sun, 22 Oct 2023 12:01:36 +0000 (12:01 +0000)]
fix 40 MHz channel validation checks for the 2.4 GHz channel range

Just like the 5 GHz channels, 2.4 GHz channels are spaced 5 MHz apart.
40 MHz wide channels hence span channels [N, N + 4] not [N, N + 1].
Adjust our secondary channel range checks accordingly.

12 months agoregression test for roff.c rev. 1.269:
schwarze [Sat, 21 Oct 2023 17:28:01 +0000 (17:28 +0000)]
regression test for roff.c rev. 1.269:
recursive delayed expansion of escape sequences in macro arguments

12 months agoWhen parsing a macro argument results in delayed escape sequence
schwarze [Sat, 21 Oct 2023 17:10:12 +0000 (17:10 +0000)]
When parsing a macro argument results in delayed escape sequence
expansion, re-check for all contained escape sequences whether they
need delayed expansion, not just for the particular escape sequences
that triggered delayed expansion in the first place.  This is needed
because delayed expansion can result in strings containing nested
escape sequences recursively needing delayed expansion, too.

This fixes an assertion failure in krb5_openlog(3), see:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266882

Thanks to Wolfram Schneider <wosch at FreeBSD> for reporting the bug
and to Baptiste Daroussin <bapt at FreeBSD> for forwarding the report.

12 months agodelete whitespaces that end up in output files
deraadt [Sat, 21 Oct 2023 14:09:15 +0000 (14:09 +0000)]
delete whitespaces that end up in output files

12 months agoRemove mention of alg_section. This never worked in LibreSSL.
tb [Sat, 21 Oct 2023 14:05:49 +0000 (14:05 +0000)]
Remove mention of alg_section. This never worked in LibreSSL.

12 months agostyle tweak: avoid double conjunction to make it read better
schwarze [Sat, 21 Oct 2023 13:53:43 +0000 (13:53 +0000)]
style tweak: avoid double conjunction to make it read better
OK tb@

12 months agoignore wide channel configs that do not appear in the 802.11ac spec
stsp [Sat, 21 Oct 2023 06:47:23 +0000 (06:47 +0000)]
ignore wide channel configs that do not appear in the 802.11ac spec

Wide channel configurations not listed in operating class tables of
the 802.11ac spec can trigger regulatory assertion failures in iwm(4)
firmware, and potentially other device firmware.
Ignore non-standard channels configs such that we downgrade to 40MHz
or even 20MHz to make such APs usable, albeit at lower speed.

Found by dlg@ with a mikrotik AP advertising channel configs that do
not appear as such in the spec:
  80 MHz: |104|108|112|116|
  40 MHz: |primary: 112|secondary above: 116|
Either of these triggered iwm0: 0x000014FD | ADVANCED_SYSASSERT

Fix tested by myself on iwx(4) AX200 and dlg@ on iwm(4) 7260.
Johannes Berg helped with deciphering the error code, thanks!

12 months agoensure that iwm(4) uses the 80Mhz primary channel index announced in beacons
stsp [Sat, 21 Oct 2023 06:41:26 +0000 (06:41 +0000)]
ensure that iwm(4) uses the 80Mhz primary channel index announced in beacons

same fix was applied to iwx(4) some time ago