OpenBSD/src AlHT2nVusr.sbin/vmd vionet.c virtio.h

   Fix vmd(8) vionet reset race leading to broken networking.

   A driver reset races with the device asynchronously notifying tx
   and rx threads. The current design finishes the reset after the
   threads pause and acknowledge the reset. This can clobber device
   state because a driver doesn't need to wait before reconfiguring
   the device. End result is device thinks it's in a blank slate while
   driver thinks device is configured and device refuses to pass packets
   thinking the driver isn't ready.

   This removes that async reset design and ack message from the
   threads. Reset occurs immediately while emulating the write to the
   register. A generation counter is used to signal to tx and rx
   threads that a reset occurred between they time they finished
   processing virtqueues and the time they grabbed the write lock to
   change interrupt state on the device so they can safely skip
   raising irq lines.

   Original bug reports by mbuhl@ and stsp@.

    [4 lines not shown]
VersionDeltaFile
1.30+55-64usr.sbin/vmd/vionet.c
1.63+2-1usr.sbin/vmd/virtio.h
1.147+1-2usr.sbin/vmd/vmd.h
+58-673 files

OpenBSD/src REP6Udhlibexec/ftpd ftpd.c

   Avoid potential undefined behavior on write error while sending data.
   From Dhiraj Mishra
   OK deraadt@ tb@
VersionDeltaFile
1.236+6-5libexec/ftpd/ftpd.c
+6-51 files

OpenBSD/src tGFYYzvsys/arch/riscv64/stand/efiboot efiboot.c conf.c

   Attempt to load the right device tree from the riscv64-specmit-dtb
   firmware package on SpacemiT K1 boards.  The only viable way to do this
   seems to be basing this on the "model" property of the root node of
   the device tree provided by the device.  This is still a bit of a guess
   since the Milk-V Jupiter advertises itself as "spacemit k1-x evb board"
   and the Banana Pi BPI-F3 seems to say it is a "spacemit k1-x deb1 board".

   ok jca@
VersionDeltaFile
1.14+44-2sys/arch/riscv64/stand/efiboot/efiboot.c
1.6+2-2sys/arch/riscv64/stand/efiboot/conf.c
+46-42 files

OpenBSD/src Ckmknd0sys/arch/i386/conf RAMDISK

   If you use the floppy, fw_update for some drivers will not work, you will
   have to figure out the names of the missing firmwares and request them
   manually.

   The pci strings in the kernel have become too large, and I'm being told I
   may not shorten them.
VersionDeltaFile
1.205+2-2sys/arch/i386/conf/RAMDISK
+2-21 files

OpenBSD/src 8tWMEywsys/arch/amd64/conf RAMDISK

   If you use the floppy, fw_update for some drivers will not work, you will
   have to figure out the names of the missing firmwares and request them
   manually.

   The pci strings in the kernel have become too large, and I'm being told I
   may not shorten them.
VersionDeltaFile
1.90+2-2sys/arch/amd64/conf/RAMDISK
+2-21 files

OpenBSD/src mQnjuf2sys/net rtsock.c

   route_output() can not use the info struct late in its function
   since the rtm struct that populated it was freed around the
   rtm_report() call. In that case access to info.rti_info[RTAX_DST]
   is a use-after-free.  Cache the address family before handling the
   route message so that the route_input call can use this value instead.

   Report from Bruce Dang of Calif.io
   OK deraadt@
VersionDeltaFile
1.391+6-3sys/net/rtsock.c
+6-31 files

OpenBSD/src DRnhoQTusr.bin/mandoc main.c

   oops, fix a one-byte mishap in the previous commit
VersionDeltaFile
1.270+2-2usr.bin/mandoc/main.c
+2-21 files

OpenBSD/src TZo2qLKusr.bin/mandoc main.c

   Refine unveil(2) usage.

   * Process man.conf(5) early before unveil(2) because it needs realpath(3).
   * Rather than unveiling the whole file system for reading and execution,
   only reveal the manpaths actually needed for reading, and /usr/share/locale/
   if needed, and only reveal the pager binary for execution.
   * Only reveal the whole file system for reading if input file names
   are listed individually on the command line.
   * Rather than unveiling /tmp unconditionally, only do so when it is
   actually needed for the pager.
   * When -O outfilename or -O tagfilename is specified, rather than
   unveiling the current working directory for writing, only unveil
   the specific filenames needed.

   Using some feedback from deraadt@, in particular reducing the number
   of vnodes that are held, and avoiding use of the "unveil" pledge(2).
VersionDeltaFile
1.269+212-105usr.bin/mandoc/main.c
+212-1051 files

OpenBSD/src xTcc3nDusr.bin/mandoc manpath.c manconf.h

   Prepare for refining unveil(2) usage by providing a function manpath_unveil()
   that makes the manpath directories accessible.  Soon to be used by man(1),
   spropos(1), and makewhatis(8).
VersionDeltaFile
1.33+45-5usr.bin/mandoc/manpath.c
1.10+5-2usr.bin/mandoc/manconf.h
1.226+3-1usr.bin/mandoc/mandoc.h
1.20+3-1usr.bin/mandoc/mandoc_msg.c
+56-94 files

OpenBSD/src bMgNbJEusr.bin/mandoc mansearch.c

   Delete the pointless logic that remembers the original working directory.
   It was never needed because manpath_add() in manpath.c has always been
   using realpath(3) since the very beginning in 2011, so struct manpaths
   only ever contains absolute paths.
   The only exception is man.cgi(8), but that chdir(2)s to the right
   directory beforehand and only ever uses one single manpath, ".".

   This simplifies the code with no functional change.
VersionDeltaFile
1.68+3-33usr.bin/mandoc/mansearch.c
+3-331 files

OpenBSD/src 9sGDTW3usr.bin/rpcgen rpc_util.c

   locase() in usr.bin/rpcgen/rpc_util.c copies an identifier into
   a static buffer without bounds checking

   OK deraadt@
VersionDeltaFile
1.18+3-1usr.bin/rpcgen/rpc_util.c
+3-11 files

OpenBSD/src tu8NutHlib/libc/gen getcap.c

   cgetnext() in lib/libc/gen/getcap.c copies a record name into a
   stack buffer without bounds checking

   OK deraadt@
VersionDeltaFile
1.39+5-1lib/libc/gen/getcap.c
+5-11 files

OpenBSD/src GJJIiHBsys/dev/wscons wsdisplay.c

   Some mapchar emulops require a question mark character, so don't permit
   loading if that is missing (bounded by firstchar and numchars).
   An AI triage report made a hastly conclusion there were bigger problems
   here but Miod figures it is just this ? problem.
   diff from miod
   report from Bruce Dang of Calif.io
VersionDeltaFile
1.156+8-1sys/dev/wscons/wsdisplay.c
+8-11 files

OpenBSD/src XXNmJh4usr.bin/ipcs ipcs.c

   In ipcs(1) use shm_cpid to determine whether a shared memory segment is in use.
   As since kern_sysctl.c r1.490 shm_internal is always NULL.

   ok deraadt
VersionDeltaFile
1.29+2-2usr.bin/ipcs/ipcs.c
+2-21 files

OpenBSD/src qmPFLELusr.sbin/vmctl main.c vmctl.h

   vmctl(8): switch to new disk format enum.

   Replace int's with the new enum type used by vmd.

   Discussed with mlarkin@
VersionDeltaFile
1.89+5-5usr.sbin/vmctl/main.c
1.45+4-4usr.sbin/vmctl/vmctl.h
1.98+3-3usr.sbin/vmctl/vmctl.c
+12-123 files

OpenBSD/src t0qMo4Jsys/dev/pv if_vio.c

   vio: recover from missed RX interrupts

   It seems at least on Oracle Cloud (arm64, KVM) and on vmd, sometimes rx
   interrupts get lost. As a workaround, check the virtqueues in vio_rxtick(),
   which allows to recover from this situation.

   Diff from renaud@
   tested by mbuhl@
   ok stsp@
VersionDeltaFile
1.79+2-1sys/dev/pv/if_vio.c
+2-11 files

OpenBSD/src RkiB1C8sys/kern kern_sysctl.c

   The struct kfino_vmentry copied to userland is 80, and (depending
   on architecture?) has 7 bytes of padding at the end, which is
   uninitialized.  Use M_ZERO.
   from tgs
VersionDeltaFile
1.491+2-2sys/kern/kern_sysctl.c
+2-21 files

OpenBSD/src 4AVKrlXusr.sbin/smtpd smtpd-filters.7 smtpd-tables.7

   smtpd: bump version to 7.9
VersionDeltaFile
1.17+4-4usr.sbin/smtpd/smtpd-filters.7
1.7+3-3usr.sbin/smtpd/smtpd-tables.7
1.694+2-2usr.sbin/smtpd/smtpd.h
+9-93 files

OpenBSD/src HGFlmGJusr.sbin/smtpd table.c

   don't lowercase K_AUTH lookups

   this diff has circulated for a while, being written and re-written by
   different people.  In this case, I'm taking Pietro Cerutti's version.
VersionDeltaFile
1.55+3-1usr.sbin/smtpd/table.c
+3-11 files

OpenBSD/src JCeymYMusr.sbin/bgpd rde_community.c

   Avoid undefined behaviour in the community code by checking nentries to
   be not 0 before memcmp, bsearch or siphash calls.

   Calling these functions with a NULL pointer is UB even with a zero len.
   While I did fix some code already during a review of all such possible
   NULL, 0 calls I missed the bsearch one and introduced the community_equal
   memcmp after that.

   Reported by Synmac Oliver
   OK tb@ deraadt@
VersionDeltaFile
1.25+12-4usr.sbin/bgpd/rde_community.c
+12-41 files

OpenBSD/src VUOLvaIsbin/slaacd engine.c

   Prevent buffer overflow by checking the correct counter.

   An attacker on the same layer 2 network can send rogue router
   advertisements, potentially crashing slaacd.

   From Maurice Hieronymus (mhi AT mailbox.org), thanks!

   OK deraadt
VersionDeltaFile
1.101+2-2sbin/slaacd/engine.c
+2-21 files

OpenBSD/src nAw443Psys/arch/octeon/dev octciu.c

   sys/octeon: cleanup all interrupts

   octciu_next_irq() operates on a uint64_t pending interrupt bitmap, and
   irq spans the full 0..63 range. Using 1u << irq therefore builds a 32
   bit mask for a 64 bit word; once irq >= 32, the selected pending bit is
   no longer cleared correctly.

   The immediate consequence is loss of forward progress in the dispatcher
   loop: the same interrupt can remain logically pending in the local copy
   of isr, the loop can revisit it indefinitely, and the CPU can remain
   trapped in interrupt handling.

   OK: kettenis@, jca@, deraadt@
VersionDeltaFile
1.21+2-2sys/arch/octeon/dev/octciu.c
+2-21 files

OpenBSD/src 80a4oBxsys/netinet tcp_input.c

   Properly handle the FIN flag in tcp_flush_queue.

   Once a FIN packet is received all following data should simply be
   discarded.  Normally this is done in tcp_input but once traffic
   needs reassembly the FIN handling in the reassembly queue was not
   quite correct. Data directly following the FIN packet was also
   reassembled and the FIN was actually lost. The check if packets
   should be dropped only checked for SS_CANTRCVMORE which is only
   set after tcp_flush_queue returned TH_FIN.

   Reported by Xint Code
   OK sashan@ deraadt@
VersionDeltaFile
1.466+4-4sys/netinet/tcp_input.c
+4-41 files

OpenBSD/src peGTkwdsys/netinet ip_input.c

   Don't mix heap and stack pointers in offset calculation

   OK canacar@ claudio@ deraadt@
VersionDeltaFile
1.427+2-4sys/netinet/ip_input.c
+2-41 files

OpenBSD/src d4iMxv0usr.sbin/fw_update patterns.c

   Add pattern for riscv64-spacemit-dtb that matches smtgpio(4).

   ok deraadt@, jca@
VersionDeltaFile
1.20+2-1usr.sbin/fw_update/patterns.c
+2-11 files

OpenBSD/src J8gtX54sys/kern tty.c

   For sysctl({CTL_KERN, KERN_TTY, KERN_TTY_INFO), only export the
   t_session kernel address pointer if the caller is root.
   Reported by Bruce Dang of Calif.io
   ok claudio
VersionDeltaFile
1.183+4-2sys/kern/tty.c
+4-21 files

OpenBSD/src HRYmeG1sys/sys sysctl.h

   do not expose p_addr kernel address unless root
   from Bruce Dang of Calif.io
   ok claudio kettenis
VersionDeltaFile
1.248+4-3sys/sys/sysctl.h
+4-31 files

OpenBSD/src FFcnP6Bshare/man/man4 pfsync.4

   Fix missing word, that rather changed the meaning, spotted by "schalken" on IRC.
VersionDeltaFile
1.41+3-3share/man/man4/pfsync.4
+3-31 files

OpenBSD/src KyN2LTelib/libtls tls_signer.c tls_ocsp.c

   libtls: consistently handle allocation failures

   Use tls_set_errorx() or tls_error_setx() rather than the versions without
   x for TLS_ERROR_OUT_OF_MEMORY. ENOMEM adds no further info.

   From Michael Forney

   ok bcook
VersionDeltaFile
1.15+4-4lib/libtls/tls_signer.c
1.29+2-2lib/libtls/tls_ocsp.c
+6-62 files

OpenBSD/src otMPdS1lib/libtls tls_config.c

   libtls: use TLS_ERROR_OUT_OF_MEMORY after malloc failure

   tls_config_load_file() hat a spot that used TLS_ERROR_UNKNOWN, so switch
   that to the usual error code. Use tls_error_setx() since strerror(ENOMEM)
   adds nothing.

   From Michael Forney

   ok bcook
VersionDeltaFile
1.73+2-2lib/libtls/tls_config.c
+2-21 files