DragonFlyBSD/src e8780ae — crypto/openssh misc.c ssh.1

vendor/OPENSSH: Upgrade from 10.5p1 to 10.6p1
DeltaFile
+4,598-1,983crypto/openssh/ed25519.c
+191-65crypto/openssh/misc-agent.c
+121-64crypto/openssh/channels.c
+148-14crypto/openssh/servconf.c
+74-74crypto/openssh/ssh.1
+125-4crypto/openssh/misc.c
+5,257-2,20468 files not shown
+6,242-2,76774 files

DragonFlyBSD/src d209117 — crypto/openssh sshd.c ssh-pkcs11.c

vendor/OPENSSH: Upgrade from 9.1p1 to 10.5p1
DeltaFile
+27,332-0crypto/openssh/libcrux_internal.h
+1,916-1,038crypto/openssh/sntrup761.c
+2,079-737crypto/openssh/servconf.c
+789-1,955crypto/openssh/sshkey.c
+2,311-0crypto/openssh/ssh-pkcs11.c
+782-1,331crypto/openssh/sshd.c
+35,209-5,061269 files not shown
+74,159-17,860275 files

DragonFlyBSD/src a6e50c3 — sbin/ifconfig ifwg.c

ifconfig(8): Fix false -Wuse-after-free warnings in ifwg.c

Tweak the code to fix the false -Wuse-after-free warnings in
wg_data_grow() from GCC 12.5:

```
/usr/src/sbin/ifconfig/ifwg.c: In function 'wg_data_grow':
/usr/src/sbin/ifconfig/ifwg.c:79:20: warning: pointer may be used after 'realloc' [-Wuse-after-free]
   79 |         aip_offset = (char *)wg_aip - (char *)wg_interface;
      |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sbin/ifconfig/ifwg.c:82:33: note: call to 'realloc' here
   82 |         wg_data.wgd_interface = realloc(wg_interface, wg_data.wgd_size);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sbin/ifconfig/ifwg.c:78:21: warning: pointer may be used after 'realloc' [-Wuse-after-free]
   78 |         peer_offset = (char *)wg_peer - (char *)wg_interface;
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sbin/ifconfig/ifwg.c:82:33: note: call to 'realloc' here
   82 |         wg_data.wgd_interface = realloc(wg_interface, wg_data.wgd_size);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    [3 lines not shown]
DeltaFile
+9-5sbin/ifconfig/ifwg.c
+9-51 files

DragonFlyBSD/src dea249a — bin/csh/csh Makefile

csh(1): Silence -Wuse-after-free warnings from GCC 12.5

GCC 12.5 generates the following -Wuse-after-free warnings, which are
all false positives, so silence them for this vendor source.  I'd like
to submit the code fixes to upstream and then do a vendor update.

```
/usr/src/bin/csh/csh/../../../contrib/tcsh-6/sh.func.c: In function 'iconv_catgets':
/usr/src/bin/csh/csh/../../../contrib/tcsh-6/sh.func.c:2600:34: warning: pointer may be used after 'realloc' [-Wuse-after-free]
 2600 |                 dest = p + (dest - buf);
      |                            ~~~~~~^~~~~~
In file included from /usr/src/bin/csh/csh/../../../contrib/tcsh-6/sh.func.c:32:
/usr/src/bin/csh/csh/../../../contrib/tcsh-6/sh.h:499:25: note: call to 'realloc' here
  499 | # define xrealloc(p, i) realloc(p, i)
      |                         ^~~~~~~~~~~~~
/usr/src/bin/csh/csh/../../../contrib/tcsh-6/sh.func.c:2597:26: note: in expansion of macro 'xrealloc'
 2597 |                 if ((p = xrealloc(buf, buf_size * 2)) == NULL)
      |                          ^~~~~~~~
/usr/src/bin/csh/csh/../../../contrib/tcsh-6/sh.proc.c: In function 'morecommand':

    [22 lines not shown]
DeltaFile
+8-0bin/csh/csh/Makefile
+8-01 files

DragonFlyBSD/src e42f05a — contrib/gcc-12/gcc expmed.cc

contrib/gcc-12: Silence -Wmaybe-uninitialized warning

GCC 12.5 would generate the following -Wmaybe-uninitialized warning for
expmed.cc, which defines the #pragma to force this diagnostic to be a
warning, so the GCC's own bootstrap that uses -Werror could succeed.
However, this #pragma makes this warning can't be silenced by a
-Wno-maybe-uninitialized option on the command line. So just modify the
source file to ignore it.

```
/usr/src/gnu/usr.bin/cc120/libbackend/../../../../contrib/gcc-12/gcc/expmed.cc: In function 'rtx_def* extract_bit_field_1(rtx, poly_uint64, poly_uint64, int, rtx, machine_mode, machine_mode, bool, bool, rtx_def**)':
/usr/src/gnu/usr.bin/cc120/libbackend/../../../../contrib/gcc-12/gcc/expmed.cc:1832:45: warning: '*(unsigned int*)((char*)&imode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))' may be used uninitialized [-Wmaybe-uninitialized]
 1832 |       rtx sub = extract_bit_field_as_subreg (mode1, op0, imode,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
 1833 |                                              bitsize, bitnum);
      |                                              ~~~~~~~~~~~~~~~~
/usr/src/gnu/usr.bin/cc120/libbackend/../../../../contrib/gcc-12/gcc/expmed.cc:1792:19: note: '*(unsigned int*)((char*)&imode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))' was declared here
 1792 |   scalar_int_mode imode;
      |                   ^~~~~

    [6 lines not shown]
DeltaFile
+1-1contrib/gcc-12/gcc/expmed.cc
+1-11 files

DragonFlyBSD/src 9ef3e83 — gnu/usr.bin/cc80/backends/guts/guts-common Makefile, gnu/usr.bin/cc80/backends/programs/cc1 Makefile

gnu/cc80: Unify the hack of forcing a C++ compiler to compile .c files
DeltaFile
+15-18gnu/usr.bin/cc80/backends/programs/cc1/Makefile
+15-16gnu/usr.bin/cc80/backends/programs/cc1plus/Makefile
+8-15gnu/usr.bin/cc80/backends/programs/lto-wrapper/Makefile
+7-13gnu/usr.bin/cc80/backends/programs/lto1/Makefile
+7-13gnu/usr.bin/cc80/backends/programs/collect2/Makefile
+7-8gnu/usr.bin/cc80/backends/guts/guts-common/Makefile
+59-836 files not shown
+97-12712 files

DragonFlyBSD/src 95971b5 — gnu/usr.bin/cc80/drivers/c++ Makefile, gnu/usr.bin/cc80/drivers/cc Makefile

gnu/cc80: Correct CFLAGS to fix mkdep warnings

These programs require to use a C++ compiler to compile their '.c'
sources, so they used hacks to do this, one of which is overriding
'MKDEPCC=${CXX}'.  However, the CFLAGS wasn't overridden, so calling
mkdep(1) programs would give the warnings:

```
cc1plus: warning: command-line option '-std=gnu11' is valid for C/ObjC but not for C++
```

Fix it by additionally overriding CC and CFLAGS, similar to the
practice used in 'cc80/cc_tools/libcpp/Makefile'.  One bonus is that we
can also remove the rule overriding.
DeltaFile
+5-7gnu/usr.bin/cc80/drivers/gcov/Makefile
+5-7gnu/usr.bin/cc80/drivers/cpp/Makefile
+5-7gnu/usr.bin/cc80/drivers/cc/Makefile
+5-7gnu/usr.bin/cc80/drivers/c++/Makefile
+20-284 files

DragonFlyBSD/src b239507 — sys/kern kern_module.c

kern: skip module shutdown handlers on panic

module_shutdown() is a shutdown_post_sync handler, so it also runs on the
panic path after the panicking CPU has stopped the other CPUs.  Some
MOD_SHUTDOWN handlers block on kernel threads that cannot run once their
CPU is stopped: vn calls disk_destroy(), and disk_msg_send_sync() then
waits forever for the disk_msg_core thread.  The machine hangs after
"Dump complete" and never reboots.

Skip the module shutdown handlers on a panic, as resettodr_on_shutdown()
and shutdown_kproc() already do.  The dump is already written when this
handler runs.

Reproduced in a QEMU/NVMM guest: panic + dump with
hw.acpi.handle_reboot=1 hangs at "Dump complete" on SMP and reboots on a
single CPU.  With this change the guest reboots with
hw.acpi.handle_reboot 1 and 0, with and without a dump.

Bug: https://bugs.dragonflybsd.org/issues/3450
DeltaFile
+4-0sys/kern/kern_module.c
+4-01 files

DragonFlyBSD/src 4e10f78 — sys/conf kmod.mk kern.pre.mk

kernel: Enable -Werror for gcc120 (GCC 12.5)
DeltaFile
+1-1sys/conf/kmod.mk
+1-1sys/conf/kern.pre.mk
+2-22 files

DragonFlyBSD/src fdfb91d — sys/dev/raid/mrsas mrsas.h mrsas.c

mrsas(4): Fix lost wakeups by restoring two wait queues

mrsas(4) is a port of the Linux megaraid_sas driver (see e.g. v3.13).
The port translated Linux's wake_up(), which wakes every non-exclusive
waiters on a wait queue, as wakeup_one(), which wakes only one. It also
collapsed Linux driver's two wait queues ('int_cmd_wait_q' for internal
DCMDs and 'abort_cmd_wait_q' for aborts) into the single 'sc->chan'
channel.

Both loops wait on a per-command predicate (cmd->cmd_status), so a
single wakeup on a shared channel can wake the wrong thread and drop the
wakeup for the command that actually completed.  With two blocked
commands outstanding, one of them then times out after
MRSAS_INTERNAL_CMD_WAIT_TIME even though it completed.

Fix the problem by correct the two porting issues:

* internal DCMDs continue to use 'sc->int_chan' that is renamed from
  'sc->chan', woken by mrsas_wakeup();

    [21 lines not shown]
DeltaFile
+4-16sys/dev/raid/mrsas/mrsas.c
+3-2sys/dev/raid/mrsas/mrsas.h
+7-182 files

DragonFlyBSD/src 9252143 — sys/net/wg if_wg.c

if_wg: Simplify BPF tap code

bpf_ptap() handles the bpf_gettoken() internally, so remove the
wg_bpf_ptap() helper and simplify the code.
DeltaFile
+9-21sys/net/wg/if_wg.c
+9-211 files

DragonFlyBSD/src 2059392 — sys/dev/disk/iscsi/initiator isc_subr.c

iscsi: Fix -Wvla warnings in isc_subr.c
DeltaFile
+7-4sys/dev/disk/iscsi/initiator/isc_subr.c
+7-41 files

DragonFlyBSD/src e66c743 — sys/dev/acpica/acpi_hp acpi_hp.c

acpica: Fix -Wvla warnings in acpi_hp.c

Avoid using a variable solely for sizes that are never meant to be
modified runtime.

Obtained-from: FreeBSD (commit 2cafe2f90ca5d7c0ac859db440fa4159f442f128)
DeltaFile
+12-15sys/dev/acpica/acpi_hp/acpi_hp.c
+12-151 files

DragonFlyBSD/src 934a7c6 — sys/dev/raid/asr asr.c

asr(4): Fix -Wint-to-pointer and -Warray-bounds warnings

This does fix any real bug, but silence the following warnings from GCC
12.5.  This also fixes buildworld that was broken by the previous commit,
which revealed the -Wint-to-pointer warning with GCC 8 as well.

```
/usr/src/sys/dev/raid/asr/asr.c: In function 'ASR_queue_i':
/usr/src/sys/dev/raid/asr/asr.c:3353:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 3353 |                         elm->UserSpace = (caddr_t)
      |                                          ^
In file included from /usr/src/sys/dev/raid/asr/i2otypes.h:91,
                 from /usr/src/sys/dev/raid/asr/i2omsg.h:120,
                 from /usr/src/sys/dev/raid/asr/i2oexec.h:96,
                 from /usr/src/sys/dev/raid/asr/asr.c:149:
/usr/src/sys/dev/raid/asr/asr.c: In function 'ASR_acquireLct':
/usr/src/sys/dev/raid/asr/asr.c:1476:52: warning: array subscript 'struct _I2O_EXEC_LCT_NOTIFY_MESSAGE[0]' is partly outside array bounds of 'unsigned char[32]' [-Warray-bounds]
 1476 |         I2O_MESSAGE_FRAME_setFunction(&(Message_Ptr->StdMessageFrame),
      |                                                    ^~

    [60 lines not shown]
DeltaFile
+13-10sys/dev/raid/asr/asr.c
+13-101 files

DragonFlyBSD/src 755c957 — sys/dev/raid/asr dptalign.h

asr(4): Fix bug of DPT_4_BYTES being wrongly defined as long (8 bytes)

Caught by GCC 12.5 with the following '-Warray-bounds' warnings:

```
In file included from /usr/src/sys/dev/raid/asr/asr.c:148:
/usr/src/sys/dev/raid/asr/asr.c: In function 'ASR_getStatus':
/usr/src/sys/dev/raid/asr/dptalign.h:277:26: warning: array subscript 'long unsigned int[4]' is partly outside array bounds of 'I2O_EXEC_STATUS_GET_MESSAGE[1]' {aka 'struct _I2O_EXEC_STATUS_GET_MESSAGE[1]'} [-Warray-bounds]
  277 |                          *((unsigned DPT_4_BYTES __FAR__ *)getUP1(x,y)) \
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/dev/raid/asr/i2odep.h:492:17: note: in expansion of macro 'setLU4'
  492 |                 setLU4((&(x)->ReplyBufferLength),0,y)
      |                 ^~~~~~
/usr/src/sys/dev/raid/asr/asr.c:614:9: note: in expansion of macro 'I2O_EXEC_STATUS_GET_MESSAGE_setReplyBufferLength'
  614 |         I2O_EXEC_STATUS_GET_MESSAGE_setReplyBufferLength(Message_Ptr,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/dev/raid/asr/asr.c:599:41: note: at offset 32 into object 'Message' of size 36
  599 |         I2O_EXEC_STATUS_GET_MESSAGE     Message;
      |                                         ^~~~~~~

    [15 lines not shown]
DeltaFile
+4-2sys/dev/raid/asr/dptalign.h
+4-21 files

DragonFlyBSD/src 553dd9e — sys/dev/acpica acpi_pcib.c

acpica: Remove redundant checks to fix -Waddress warnings

The 'Source' field defined as a flexible array in a struct, so the
checks are always true.

Obtained from FreeBSD (commit d19b0f3ea51bc68a1c095176a7c491370d433cc0).

Fix the following '-Waddress' warnings given by GCC 12.5:

```
/usr/src/sys/dev/acpica/acpi_pcib.c: In function 'prt_attach_devices':
/usr/src/sys/dev/acpica/acpi_pcib.c:99:23: warning: the comparison will always evaluate as 'false' for the address of 'Source' will never be NULL [-Waddress]
   99 |     if (entry->Source == NULL || entry->Source[0] == '\0')
      |                       ^~
In file included from /usr/src/sys/contrib/dev/acpica/source/include/platform/acenv.h:298,
                 from /usr/src/sys/contrib/dev/acpica/source/include/acpi.h:164,
                 from /usr/src/sys/dev/acpica/acpi_pcib.c:38:
/usr/src/sys/contrib/dev/acpica/source/include/acrestyp.h:953:59: note: 'Source' declared here
  953 |                                     ACPI_FLEX_ARRAY(char, Source);

    [24 lines not shown]
DeltaFile
+3-4sys/dev/acpica/acpi_pcib.c
+3-41 files

DragonFlyBSD/src 4d3133c — sys/bus/firewire fwohci.c

firewire: Use a union to fix -Warray-bounds warning

GCC 12.5 generated the following '-Warray-bounds' warning because the
'struct fw_pkt' is larger than a 'uint32_t', so introduce a union to
help the aliasing and fix the warning.

This does fix a real bug, and the change is obtained from NetBSD (GitHub
commit a30bc076fe2f3e969d7451633acfceedb3412fa3: don't assign struct
pointers to smaller then structure regions of memory).

```
/usr/src/sys/bus/firewire/fwohci.c: In function 'fwohci_arcv_swap.isra':
/usr/src/sys/bus/firewire/fwohci.c:2598:33: warning: array subscript 'struct fw_pkt[0]' is partly outside array bounds of 'u_int32_t[1]' {aka 'unsigned int[1]'} [-Warray-bounds]
 2598 |         switch (fp0->mode.common.tcode) {
      |                 ~~~~~~~~~~~~~~~~^~~~~~
/usr/src/sys/bus/firewire/fwohci.c:2586:19: note: object 'ld0' of size 4
 2586 |         u_int32_t ld0;
      |                   ^~~
```
DeltaFile
+7-4sys/bus/firewire/fwohci.c
+7-41 files

DragonFlyBSD/src c7ab6e8 — sys/dev/netif/txp if_txp.c

if_txp: Fix -Waddress warning from GCC 12.5

Remove the dead condition to fix the following '-Waddress' warning:
```
/usr/src/sys/dev/netif/txp/if_txp.c: In function 'txp_rxring_empty':
/usr/src/sys/dev/netif/txp/if_txp.c:1082:39: warning: the comparison will always evaluate as 'false' for the pointer operand in 'sc->sc_rxbufs + (sizetype)((long unsigned int)i * 16)' must not be NULL [-Waddress]
 1082 |                 if (&sc->sc_rxbufs[i] == NULL)
      |                                       ^~
```
DeltaFile
+0-2sys/dev/netif/txp/if_txp.c
+0-21 files

DragonFlyBSD/src 8a0abbc — sys/vfs/devfs devfs_rules.c

devfs(5): Remove redundant checks to fix -Waddress warnings

The 'mntpoint', 'name' and 'linkname' fields are char arrays in
'struct devfs_rule_ioctl', so the warned checks were redundant. Remove
them to fix the '-Waddress' warnings given by GCC 12.5:

```
/usr/src/sys/vfs/devfs/devfs_rules.c: In function 'devfs_rule_alloc':
/usr/src/sys/vfs/devfs/devfs_rules.c:87:29: warning: the comparison will always evaluate as 'false' for the address of 'mntpoint' will never be NULL [-Waddress]
   87 |         if (templ->mntpoint == NULL)
      |                             ^~
In file included from /usr/src/sys/vfs/devfs/devfs_rules.c:44:
/usr/src/sys/sys/devfs_rules.h:74:17: note: 'mntpoint' declared here
   74 |         char    mntpoint[PATH_MAX];
      |                 ^~~~~~~~
/usr/src/sys/vfs/devfs/devfs_rules.c:100:33: warning: the comparison will always evaluate as 'false' for the address of 'name' will never be NULL [-Waddress]
  100 |                 if (templ->name == NULL)
      |                                 ^~
/usr/src/sys/sys/devfs_rules.h:76:17: note: 'name' declared here

    [29 lines not shown]
DeltaFile
+2-23sys/vfs/devfs/devfs_rules.c
+2-231 files

DragonFlyBSD/src 43fdc19 — sys/dev/disk/ahci ahci.c

ahci: Remove redundant conditions to fix -Waddress warnings

The 'ap_ata' field is a pointer array, so 'ap->ap_ata' represents the
address of the field, which is always not NULL.  Remove the redundant
checks to fix the '-Waddress' warnings given by GCC 12.5:

```
/usr/src/sys/dev/disk/ahci/ahci.c: In function 'ahci_port_free':
/usr/src/sys/dev/disk/ahci/ahci.c:1029:13: warning: the comparison will always evaluate as 'true' for the address of 'ap_ata' will never be NULL [-Waddress]
 1029 |         if (ap->ap_ata) {
      |             ^~
In file included from /usr/src/sys/dev/disk/ahci/ahci.c:54:
/usr/src/sys/dev/disk/ahci/ahci.h:488:34: note: 'ap_ata' declared here
  488 |         struct ata_port         *ap_ata[AHCI_MAX_PMPORTS];
      |                                  ^~~~~~
/usr/src/sys/dev/disk/ahci/ahci.c: In function 'ahci_port_hardstop':
/usr/src/sys/dev/disk/ahci/ahci.c:1831:21: warning: the comparison will always evaluate as 'true' for the address of 'ap_ata' will never be NULL [-Waddress]
 1831 |         for (i = 0; ap->ap_ata && i < AHCI_MAX_PMPORTS; ++i) {
      |                     ^~

    [4 lines not shown]
DeltaFile
+5-7sys/dev/disk/ahci/ahci.c
+5-71 files

DragonFlyBSD/src 07dc6fd — sys/dev/disk/nata atapi-cd.h

nata: Tweak 'struct dvd_miscauth' to fix -Warray-bounds warnings

GCC 12.5 gave the warnings because the actual allocated space was
smaller than sizeof(struct dvd_miscauth), which had the data[2048]
field.  There is no code depend on sizeof(struct dvd_miscauth), so turn
it into a flexible array to fix the -Warray-bounds warnings.

GCC 12.5 warnings example:
```
In function 'acd_send_key',
    inlined from 'acd_ioctl' at /usr/src/sys/dev/disk/nata/atapi-cd.c:756:14:
/usr/src/sys/dev/disk/nata/atapi-cd.c:1476:20: warning: array subscript 'struct dvd_miscauth[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds]
 1476 |         d->data[0] = ai->region;
      |         ~~~~~~~~~~~^~~~~~~~~~~~
In file included from /usr/src/sys/dev/disk/nata/atapi-cd.c:42:
In function '__kmalloc',
    inlined from 'acd_send_key' at /usr/src/sys/dev/disk/nata/atapi-cd.c:1475:6,
    inlined from 'acd_ioctl' at /usr/src/sys/dev/disk/nata/atapi-cd.c:756:14:
/usr/src/sys/sys/malloc.h:280:32: note: object of size 8 allocated by '_kmalloc'

    [6 lines not shown]
DeltaFile
+1-1sys/dev/disk/nata/atapi-cd.h
+1-11 files

DragonFlyBSD/src 4fcf2e1 — sys/vfs/ext2fs ext2_lookup.c, sys/vfs/ufs ufs_lookup.c

ufs,ext2fs: Fix -Warray-bounds warnings from GCC 12.5

The code of using 'struct dirtemplate' in ufs_dirempty() and
ext2_dirempty() was added in 1983 the 4.4BSD era, with the intention of
reducing stack use then [1].  However, this optimization is no longer
need now as we have larger stack space, so revert to use the real
'struct direct' or 'struct ext2fs_direct_2' to silence the warnings.

While there, adjust the MINDIRSIZ definition and rename 'count' to
'resid' to clean up the code a bit.

[1] cleanup dirempty to cut down on stack space used and speed up a tad
    https://github.com/weiss/original-bsd/commit/de69dc11a62d21d77105282cc2d8b0cac21e1587

GCC 12.5 warnings example:
```
/usr/src/sys/vfs/ufs/ufs_lookup.c: In function 'ufs_dirempty':
/usr/src/sys/vfs/ufs/ufs_lookup.c:1076:23: warning: array subscript 'struct direct[0]' is partly outside array bounds of 'struct dirtemplate[1]' [-Warray-bounds]
 1076 |                 if (dp->d_reclen == 0)

    [5 lines not shown]
DeltaFile
+6-9sys/vfs/ufs/ufs_lookup.c
+6-9sys/vfs/ext2fs/ext2_lookup.c
+12-182 files

DragonFlyBSD/src eeca36f — sys/vfs/msdosfs msdosfs_fat.c

msdosfs: Silence a -Wmaybe-uninitialized false warning

GCC 12.5 gave the following warning. It's a false positive, but let's
silence it as it's easy to do.

```
/usr/src/sys/vfs/msdosfs/msdosfs_fat.c: In function 'freeclusterchain':
/usr/src/sys/vfs/msdosfs/msdosfs_fat.c:874:17: warning: 'bn' may be used uninitialized [-Wmaybe-uninitialized]
  874 |                 updatefats(pmp, bp, bn);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/vfs/msdosfs/msdosfs_fat.c:819:16: note: 'bn' was declared here
  819 |         u_long bn, bo, bsize, byteoffset;
      |                ^~
```
DeltaFile
+2-2sys/vfs/msdosfs/msdosfs_fat.c
+2-21 files

DragonFlyBSD/src eed3ec1 — sys/dev/virtual/amazon/ena/ena-com ena_eth_com.c

ena(4): Fix possible NULL deref in ena_com_create_and_store_tx_meta_desc()

get_sq_desc() may return NULL, so passing the return value to memset()
would cause a NULL deref.  GCC 12.5 caught this and gave a
-Warray-bounds warning:

```
In file included from /usr/src/sys/dev/virtual/amazon/ena/ena-com/ena_plat.h:40,
                 from /usr/src/sys/dev/virtual/amazon/ena/ena-com/ena_com.h:38,
                 from /usr/src/sys/dev/virtual/amazon/ena/ena-com/ena_eth_com.h:40,
                 from /usr/src/sys/dev/virtual/amazon/ena/ena-com/ena_eth_com.c:34:
In function 'ena_com_create_and_store_tx_meta_desc',
    inlined from 'ena_com_prepare_tx' at /usr/src/sys/dev/virtual/amazon/ena/ena-com/ena_eth_com.c:409:3:
dragonfly/sys/systm.h:268:9: warning: '__builtin_memset' offset [0, 11] is out of the bounds [0, 0] [-Warray-bounds]
  268 |         __builtin_memset(__DEQUALIFY(void *, (ptr)), (c), (len))
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/dev/virtual/amazon/ena/ena-com/ena_eth_com.c:295:9: note: in expansion of macro 'memset'
  295 |         memset(meta_desc, 0x0, sizeof(struct ena_eth_io_tx_meta_desc));
      |         ^~~~~~

    [3 lines not shown]
DeltaFile
+14-4sys/dev/virtual/amazon/ena/ena-com/ena_eth_com.c
+14-41 files

DragonFlyBSD/src c874e29 — sys/dev/drm/i915 intel_pm.c intel_dp.c

drm/i915: Fix -Wstringop-overflow and -Wstringop-override warnings

The fixes has been obtained from upstream Linux:
- https://github.com/gregkh/linux/commit/fec4d42724a1bf3dcba52307e55375fdb967b852
- https://github.com/gregkh/linux/commit/e7c6e405e171fb33990a12ecfd14e6500d9e5cf2
- https://github.com/gregkh/linux/commit/336feb502a715909a8136eb6a62a83d7268a353b

Fix warnings given by GCC 12.5, e.g.,

```
/usr/src/sys/dev/drm/i915/intel_dp.c: In function 'intel_dp_check_mst_status':
/usr/src/sys/dev/drm/i915/intel_dp.c:4299:30: warning: 'drm_dp_channel_eq_ok' reading 6 bytes from a region of size 4 [-Wstringop-overread]
 4299 |                             !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/dev/drm/i915/intel_dp.c:4299:30: note: referencing argument 1 of type 'const u8[6]' {aka 'const unsigned char[6]'}
In file included from /usr/src/sys/dev/drm/i915/intel_dp.c:40:
/usr/src/sys/dev/drm/i915/../../../dev/drm/include/drm/drm_dp_helper.h:955:6: note: in a call to function 'drm_dp_channel_eq_ok'
  955 | bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
      |      ^~~~~~~~~~~~~~~~~~~~

    [16 lines not shown]
DeltaFile
+12-1sys/dev/drm/i915/intel_dp.c
+2-2sys/dev/drm/i915/intel_pm.c
+14-32 files

DragonFlyBSD/src 1164de8 — sys/dev/drm/include/linux pci.h

drm: Fix pci_bus_read_config_byte() and pci_bus_read_config_word()

The container_of() used wrongly used '&bus' and thus bogus. Luckily,
these functions are only used by i830_overlay_clock_gating() and
i85x_get_cdclk(), both being very old Intel iGPUs.

Fix the code to directly use 'bus->self', which is properly initialized
in drm_init_pdev().

Cross-checked FreeBSD's version of these two functions, which also uses
'bus->self'.

Caught by GCC 12.5 with warnings:

```
In file included from /usr/src/sys/dev/drm/i915/../../../dev/drm/include/drm/drm_pci.h:35,
                 from /usr/src/sys/dev/drm/i915/../../../dev/drm/include/drm/drmP.h:79,
                 from /usr/src/sys/dev/drm/i915/i915_drv.h:47,
                 from /usr/src/sys/dev/drm/i915/intel_drv.h:33,

    [24 lines not shown]
DeltaFile
+2-2sys/dev/drm/include/linux/pci.h
+2-21 files

DragonFlyBSD/src ea82031 — sys/kern subr_disk.c

kern: Fix -Waddress warning in diskioctl()

This code was initially added in commit
c6ef65eafb251f9c905af44fd734cf8201087922, and I see no point of checking
'&dp->d_slice == NULL', which is always false.  Just remove it to fix the
following -Waddress warning generated by GCC 12.5:

```
/usr/src/sys/kern/subr_disk.c: In function 'diskioctl':
/usr/src/sys/kern/subr_disk.c:1196:26: warning: the comparison will always evaluate as 'false' for the address of 'd_slice' will never be NULL [-Waddress]
 1196 |         if (&dp->d_slice == NULL || dp->d_slice == NULL ||
      |                          ^~
In file included from /usr/src/sys/kern/subr_disk.c:92:
/usr/src/sys/sys/disk.h:140:34: note: 'd_slice' declared here
  140 |         struct diskslices       *d_slice;
      |                                  ^~~~~~~
```
DeltaFile
+1-1sys/kern/subr_disk.c
+1-11 files

DragonFlyBSD/src 800dd61 — sys/kern md5c.c, sys/sys md5.h

kern: Further clean up md5c.c and <sys/md5.h>

* No need to rename MD5Transform() and MD5Pad() to avoid libmd conflict,
  because libmd has been removed in 2019.
* Use explicit_bzero() to zero sensitive 'x'.
* Remove unnecessary casts.
* Use standard 'uint32_t' instead of 'u_int32_t'.
* Remove obsolete code and comment from <sys/md5.h>.
DeltaFile
+24-26sys/kern/md5c.c
+3-15sys/sys/md5.h
+27-412 files

DragonFlyBSD/src 8a4138a — sys/kern md5c.c

kern: Fix -Wstringop-overflow warnings in md5c.c

GCC 12.5 generated the following warings for __kern__MD5Transform(). The
reasons was the passed parameter '&context->A' had size 4 (type uint32_t),
but the function would access 16 bytes (state[0..3]).  The code used a
hack that the MD5_CTX struct defines A,B,C,D as continous members.

```
/usr/src/sys/kern/md5c.c: In function 'MD5Update':
/usr/src/sys/kern/md5c.c:174:17: warning: '__kern__MD5Transform' accessing 16 bytes in a region of size 4 [-Wstringop-overflow=]
  174 |                 __kern__MD5Transform (&context->A, (char *)context->data);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/kern/md5c.c:174:17: note: referencing argument 1 of type 'u_int32_t[4]' {aka 'unsigned int[4]'}
/usr/src/sys/kern/md5c.c:174:17: note: referencing argument 2 of type 'const unsigned char[64]'
/usr/src/sys/kern/md5c.c:232:1: note: in a call to function '__kern__MD5Transform'
  232 | __kern__MD5Transform (u_int32_t state[4], const unsigned char block[64])
      | ^~~~~~~~~~~~~~~~~~~~
/usr/src/sys/kern/md5c.c:177:25: warning: '__kern__MD5Transform' accessing 16 bytes in a region of size 4 [-Wstringop-overflow=]
  177 |                         __kern__MD5Transform (&context->A, &input[i]);

    [7 lines not shown]
DeltaFile
+13-9sys/kern/md5c.c
+13-91 files

DragonFlyBSD/src 49272e5 — sys/dev/raid/mfi mfi.c

mfi(4): Fix a per-index entry test bug in mfi_ioctl()

The fixed test also matches its creation in bus_dmamap_load() in
mfi_stp_cmd().

FreeBSD made the same fix in commit
27dc50b0f0aab948e2cf60f2f50db1f36ca75054.

Caught by the following -Waddress warning from GCC 12.5:

```
/usr/src/sys/dev/raid/mfi/mfi.c: In function 'mfi_ioctl':
/usr/src/sys/dev/raid/mfi/mfi.c:3100:71: warning: the comparison will always evaluate as 'true' for the address of 'mfi_kbuff_arr_busaddr' will never be NULL [-Waddress]
 3100 |                                         if (sc->mfi_kbuff_arr_busaddr != 0)
      |                                                                       ^~
In file included from /usr/src/sys/dev/raid/mfi/mfi.c:81:
/usr/src/sys/dev/raid/mfi/mfivar.h:198:41: note: 'mfi_kbuff_arr_busaddr' declared here
  198 |         bus_addr_t                      mfi_kbuff_arr_busaddr[2];
      |                                         ^~~~~~~~~~~~~~~~~~~~~
```
DeltaFile
+1-1sys/dev/raid/mfi/mfi.c
+1-11 files