CVS: cvs.openbsd.org: src

2024-02-09 Thread Jonathan Gray
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2024/02/10 00:10:13

Modified files:
sys/arch/sparc64/sparc64: machdep.c 

Log message:
fix off-by-one when printing fr_arg

found by "buffer overflow 'fp64->fr_arg' 6 <= 6" smatch error
ok miod@ claudio@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2024/02/09 23:10:41

Modified files:
sys/lib/libz   : deflate.c 

Log message:
libz: sync with base



CVS: cvs.openbsd.org: src

2024-02-09 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2024/02/09 23:10:04

Modified files:
lib/libz   : deflate.c gzguts.h gzlib.c gzread.c 

Log message:
libz: sync with upstream

- fix type of local variable in deflate_stored()
- more Windows compat shuffling
- wrap overlong line in gzread



CVS: cvs.openbsd.org: src

2024-02-09 Thread Dave Voutila
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2024/02/09 19:19:12

Modified files:
usr.sbin/vmd   : vionet.c 

Log message:
Fix locked address interfaces in vmd(8).

Before comparing the amount of bytes read to the size of a packet
struct, make sure the fd being read was actually the packet injection
pipe(2). Locked address interfaces force using the same copy-based
approach used for the internal dhcp service for "local" interfaces
but were accidentally being treated as reads from the pipe(2) and
not the tap.

This broke networking for any locked address interfaces in vmd(8).

Reported by and ok kn@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Dave Voutila
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2024/02/09 19:10:41

Modified files:
usr.sbin/vmd   : virtio.c 

Log message:
Set vmd virtio device fds to -1 on close after fork.

After the recent vmd(8) commit to clean up file descriptor lifecycles,
virtio disks with multiple file descriptors (QCOW2 images with at
least one base) would fail to initialize when booted with a network
device.

Use the new fd closing routine in the vm process for virtio devices
to close the device fds and set to -1, removing buggy copying and
closing of fds.

Additionally, close the vm/device sync and async channels when
closing a device's fds.

Issue reported by and ok kn@



CVS: cvs.openbsd.org: www

2024-02-09 Thread Miod Vallat
CVSROOT:/cvs
Module name:www
Changes by: m...@cvs.openbsd.org2024/02/09 15:09:38

Modified files:
.  : donations.html 

Log message:
Got more toys.



CVS: cvs.openbsd.org: src

2024-02-09 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2024/02/09 12:15:53

Modified files:
lib/libz   : gzguts.h 

Log message:
pull in another upstream tweak for windows



CVS: cvs.openbsd.org: src

2024-02-09 Thread Scott Soule Cheloha
CVSROOT:/cvs
Module name:src
Changes by: chel...@cvs.openbsd.org 2024/02/09 10:42:18

Modified files:
sys/dev/dt : dt_prov_profile.c dt_dev.c dtvar.h 
sys/kern   : kern_clock.c 

Log message:
dt(4): move interval/profile entry points to dedicated clockintr callback

To improve the utility of dt(4)'s interval and profile probes we need
to move the probe entry points from the fixed-frequency hardclock() to
a dedicated clock interrupt callback so that the probes can fire at
arbitrary frequencies.

- Remove entry points for interval/profile probes from hardclock().

- Merge dt_prov_profile_enter(), dt_prov_interval_enter(), and
dt_prov_profile_fire() into one function, dt_clock().  This is
the now-unified callback for interval/profile probes.  dt_clock()
will consume multiple events during a single execution if it is
delayed, but on platforms with high quality interrupt clocks this
should be rare.

- Each struct dt_pcb gets its own clockintr handle, dp_clockintr.

- In struct dt_pcb, replace dp_maxtick/dp_nticks with dp_nsecs,
the PCB's sampling period.  Aynchronous probes must initialize
dp_nsecs to a non-zero value during dtpv_alloc().

- In struct dt_pcb, replace dp_cpuid with dp_cpu so that
dt_ioctl_record_start() knows where to bind the PCB's
dp_clockintr.

- dt_ioctl_record_start() binds, staggers, and starts all
interval/profile PCBs on the given dt_softc.  Each dp_clockintr
is given a reference to its enclosing PCB so that dt_clock()
doesn't need to search for it.  The staggering sort-of simulates
the current behavior under hardclock().

- dt_ioctl_record_stop() unbinds all interval/profile PCBs.  The
CL_BARRIER ensures that dp_clockintr's PCB reference is not in
use by dt_clock() so that the PCB may be safely freed upon
return from dt_ioctl_record_stop().  Blocking while holding
dt_lock is not ideal, but in practice blocking in this spot is
rare and dt_clock() completes quickly on all but the oldest
hardware.  An extremely unlucky thread could block for every
interval/profile PCB on the softc, but this is implausible.

DT_FA_PROFILE values are up-to-date for amd64, i386, and macppc.
Somebody with the right hardware needs to check-and-maybe-fix the
values on octeon, powerpc64, and sparc64.

Joint effort with mpi@.

Thread: https://marc.info/?l=openbsd-tech=170629371821879=2

ok mpi@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Scott Soule Cheloha
CVSROOT:/cvs
Module name:src
Changes by: chel...@cvs.openbsd.org 2024/02/09 09:52:58

Modified files:
sys/sys: clockintr.h 
sys/kern   : kern_clockintr.c 

Log message:
clockintr: add clockintr_unbind()

The clockintr_unbind() function cancels any pending execution of the
given clock interrupt object's callback and severs the binding between
the object and its host CPU.  Upon return from clockintr_unbind(), the
clock interrupt object may be rebound with a call to clockintr_bind().

The optional CL_BARRIER flag tells clockintr_unbind() to block if the
clockintr's callback function is executing at the moment of the call.
This is useful when the clockintr's arg is a shared reference and the
caller needs to be certain the reference is inactive.

Now that clockintrs can be bound and unbound repeatedly, there is more
room for error.  To help catch programmer errors, clockintr_unbind()
sets cl_queue to NULL.  Calls to other API functions after a clockintr
is unbound will then fault on a NULL dereference.  clockintr_bind()
also KASSERTs that cl_queue is NULL to ensure the clockintr is not
already bound.  These checks are not perfect, but they do catch some
common errors.

With input from mpi@.

Thread: https://marc.info/?l=openbsd-tech=170629367121800=2

ok mpi@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Jan Klemkow
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2024/02/09 08:22:41

Modified files:
sys/dev/pci: if_vmx.c 

Log message:
vmx(4): add missing NVLAN checks

ok bluhm@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Scott Soule Cheloha
CVSROOT:/cvs
Module name:src
Changes by: chel...@cvs.openbsd.org 2024/02/09 08:06:23

Modified files:
sys/kern   : kern_clockintr.c 

Log message:
clockintr: refactor clockintr_cancel() into clockintr_cancel_locked()

Move the mutex-protected portions of clockintr_cancel() into a separate
function, clockintr_cancel_locked(), so that the code can be reused by
other callers.

Thread: https://marc.info/?l=openbsd-tech=170629367121800=2

ok mpi@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2024/02/09 07:57:36

Modified files:
sys/dev/pci: if_qwx_pci.c 

Log message:
Include sys/lock.h to make qwx(4) compile with GENERIC kernel.

OK stsp@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Dave Voutila
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2024/02/09 07:52:39

Modified files:
usr.sbin/vmd   : vionet.c 

Log message:
Only debug log dhcp packet info if packet is found.

No functional change. vmd(8) was being chatty and incorrect.



CVS: cvs.openbsd.org: src

2024-02-09 Thread Dave Voutila
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2024/02/09 07:35:47

Modified files:
usr.sbin/vmd   : i8253.c 

Log message:
Tuck vmd's i8253 reset debug logs behind DPRINTF.

It's super chatty and pollutes verbose logging.



CVS: cvs.openbsd.org: src

2024-02-09 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2024/02/09 07:11:00

Modified files:
sys/dev/ic : qwx.c 

Log message:
implement qwx_dp_process_rxdma_err()



CVS: cvs.openbsd.org: src

2024-02-09 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2024/02/09 07:09:19

Modified files:
sys/dev/ic : qwx.c qwxvar.h 

Log message:
implement qwx_dp_rx_process_wbm_err()



CVS: cvs.openbsd.org: src

2024-02-09 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2024/02/09 07:07:27

Modified files:
sys/dev/ic : qwx.c qwxvar.h 

Log message:
implement qwx_dp_process_reo_status()



CVS: cvs.openbsd.org: src

2024-02-09 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2024/02/09 07:05:48

Modified files:
sys/dev/ic : qwx.c 

Log message:
implement qwx_dp_process_rx_err()



CVS: cvs.openbsd.org: src

2024-02-09 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2024/02/09 07:02:12

Modified files:
sys/net: route.c 
sys/netinet: in.h in_pcb.c 
sys/netinet6   : in6.h in6_pcb.c in6_src.c 

Log message:
Route cache function returns hit or miss.

The route_cache() function can easily return whether it was a cache
hit or miss.  Then the logic to perform a route lookup gets a bit
simpler.  Some more complicated if (ro->ro_rt == NULL) checks still
exist elsewhere.
Also use route cache in in_pcbselsrc() instead of filling struct
route manually.

OK claudio@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Job Snijders
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2024/02/09 06:49:41

Modified files:
usr.sbin/rpki-client: version.h 

Log message:
Bump release

OK tb@



CVS: cvs.openbsd.org: xenocara

2024-02-09 Thread Thomas Frohwein
CVSROOT:/cvs
Module name:xenocara
Changes by: t...@cvs.openbsd.org2024/02/09 06:17:54

Modified files:
lib/mesa/src/mesa/main: dlist.c 

Log message:
Fix off-by-one in dlist allocation when checking whether to allocate a
new block. This fixes segfaults in dlist functions that occur on
applications making heavy use of display lists that exceed BLOCK_SIZE.

ok jsg@ and stsp@, who also both helped me track down the issue.



CVS: cvs.openbsd.org: src

2024-02-09 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2024/02/09 05:56:53

Modified files:
usr.bin/bgplg  : bgplg.c bgplg.foot bgplg.head index.html 

Log message:
Convert the bgplg html pages to HTML5.

>From Clemens Gößnitzer (clemens (at) goessnitzer.info)
Looks good to bentley@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2024/02/09 05:50:10

Modified files:
sys/dev/ic : qwxvar.h 

Log message:
Struct layout of qwx_softc should not depend on NBPFILTER.

Due to a missing #include "bpfilter.h", the size of struct qwx_softc
varied in different object files.  This made the kernel crash on
arm64.  To make debugging core dumps and libkvm easier, kernel
object layout should not depend on kernel config.  Remove #if
NBPFILTER > 0 from struct definition.

problem analysis kettenis@
OK deraadt@ stsp@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2024/02/09 05:48:32

Modified files:
regress/lib/libcrypto/bio: bio_dump.c 

Log message:
bio_dump: add a test that prints all values of a single byte



CVS: cvs.openbsd.org: src

2024-02-09 Thread Jonathan Gray
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2024/02/09 05:45:10

Modified files:
sys/dev/ic : qwx.c 

Log message:
avoid uninitialised var use if qwx_core_fetch_bdf() errors
ok stsp@



CVS: cvs.openbsd.org: src

2024-02-09 Thread YASUOKA Masahiko
CVSROOT:/cvs
Module name:src
Changes by: yasu...@cvs.openbsd.org 2024/02/09 04:59:23

Modified files:
lib/libradius  : radius_eapmsk.c 

Log message:
Don't assume MPPE-{Send,Recv}-Keys are used only for MS-CHAP (or
16 bytes length).  initial diff from markus



CVS: cvs.openbsd.org: src

2024-02-09 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2024/02/09 04:24:52

Modified files:
sys/dev/pci: if_qwx_pci.c 

Log message:
qwx pci code must include bpfilter.h, too; spotted by kettenis



CVS: cvs.openbsd.org: src

2024-02-09 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2024/02/09 04:05:22

Modified files:
sys/arch/sparc64/conf: GENERIC 

Log message:
Enable igc(4) on sparc64.
OK deraadt@ jan@



CVS: cvs.openbsd.org: src

2024-02-09 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2024/02/09 02:59:01

Modified files:
sys/dev/ic : qwx.c 

Log message:
make ifconfig display the Tx rate selected by qwx firmware



CVS: cvs.openbsd.org: src

2024-02-09 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2024/02/09 02:55:17

Modified files:
sys/dev/ic : qwx.c qwxvar.h 

Log message:
add missing node reference counting to qwx's Tx completion path



CVS: cvs.openbsd.org: src

2024-02-09 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2024/02/09 02:53:50

Modified files:
sys/dev/ic : qwx.c 

Log message:
remove qwx debug prints for management frame events we are already handling



CVS: cvs.openbsd.org: src

2024-02-09 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2024/02/09 02:53:05

Modified files:
lib/libz   : gzguts.h gzlib.c 

Log message:
zlib: sync with upstream



CVS: cvs.openbsd.org: src

2024-02-09 Thread Darren Tucker
CVSROOT:/cvs
Module name:src
Changes by: dtuc...@cvs.openbsd.org 2024/02/09 01:56:59

Modified files:
regress/usr.bin/ssh: putty-ciphers.sh putty-kex.sh 

Log message:
Expand the set of ciphers, MACs and KEX methods in the PuTTY interop tests.



CVS: cvs.openbsd.org: src

2024-02-09 Thread Darren Tucker
CVSROOT:/cvs
Module name:src
Changes by: dtuc...@cvs.openbsd.org 2024/02/09 01:47:42

Modified files:
regress/usr.bin/ssh: putty-ciphers.sh putty-kex.sh 
 putty-transfer.sh test-exec.sh 

Log message:
Factor out PuTTY setup and call when needed.

This allows us to avoid PuTTY key setup when it's not needed, which
speeds up the overall test run by a couple of percent.