HardenedBSD/src c66cb44sys/netpfil/pf pf.c, usr.sbin/bsnmpd/modules/snmp_pf pf_snmp.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+4-2sys/netpfil/pf/pf.c
+1-2usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
+5-42 files

HardenedBSD/src df2e9ecsys/netpfil/pf pf.c, usr.sbin/bsnmpd/modules/snmp_pf pf_snmp.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+4-2sys/netpfil/pf/pf.c
+1-2usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
+5-42 files

HardenedBSD/src b831a1asys/dev/bnxt/bnxt_re ib_verbs.c bnxt_re.h, sys/dev/qlnx/qlnxe qlnx_os.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+33-28usr.sbin/bhyve/bhyve.8
+14-10sys/dev/qlnx/qlnxe/qlnx_os.c
+4-4sys/security/mac_ipacl/mac_ipacl.c
+3-3sys/dev/bnxt/bnxt_re/ib_verbs.c
+3-1sys/netlink/route/iface.c
+2-2sys/dev/bnxt/bnxt_re/bnxt_re.h
+59-482 files not shown
+62-518 files

HardenedBSD/src 7703c66sys/fs/unionfs union_vnops.c union_vfsops.c, sys/kern vfs_default.c vnode_if.src

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+34-32usr.sbin/bhyve/bhyve.8
+45-0sys/fs/unionfs/union_vnops.c
+25-2sys/fs/unionfs/union_vfsops.c
+1-2sys/kern/vfs_default.c
+1-1sys/kern/vnode_if.src
+1-0sys/sys/vnode.h
+107-376 files

HardenedBSD/src eaa424eusr.sbin/bsnmpd/modules/snmp_pf pf_snmp.c

snmp_pf: remove errno usage after pfctl_get_status_h change

pfctl_get_status_h() does not set errno, so don't log it.

PR:             291936
Reviewed by:    kp
DeltaFile
+1-2usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
+1-21 files

HardenedBSD/src 3e5025eusr.sbin/bhyve bhyve.8

bhyve.8: Fix consistency and terms in manpage

Correct inconsistent spelling of terms and duplication.

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54332

(cherry picked from commit 5819f8b285fc55a75e5dea56ffe73b376525150c)
DeltaFile
+33-28usr.sbin/bhyve/bhyve.8
+33-281 files

HardenedBSD/src 535fac0usr.sbin/bhyve bhyve.8

bhyve.8: Fix consistency and terms in manpage

Correct inconsistent spelling of terms and duplication.

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54332

(cherry picked from commit 5819f8b285fc55a75e5dea56ffe73b376525150c)
DeltaFile
+34-32usr.sbin/bhyve/bhyve.8
+34-321 files

HardenedBSD/src 2e76993sys/netpfil/pf pf.c

pf: don't reject route-to'd too-large packets

If we're sending a packet via pf_route()/pf_route6() we check for packet
size and potentially generate ICMP(6) packet too big messages. If we do,
don't consider this a rejected packet. That is, return PF_PASS and set
the mbuf to NULL rather than returning PF_DROP.

This matters for locally generated packets, because with PF_DROP we
can end up returning EACCES to userspace, causing the connection to
terminate. Instead, with PF_PASS and a NULL mbuf this is translated to
PFIL_CONSUMED, which does not return an error to userspace.

MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+4-2sys/netpfil/pf/pf.c
+4-21 files

HardenedBSD/src 2fef1a6sys/netlink/route iface.c

netlink: Don't directly access ifnet members

Summary:
Remove the final direct access of struct ifnet members from netlink.
Since only the first address is used, create the iterator and then free,
without fully iterating.

Reviewed By:    kp
Sponsored by:   Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D42972

(cherry picked from commit b224af946a17b8e7a7b4942157556b5bc86dd6fb)
DeltaFile
+3-1sys/netlink/route/iface.c
+3-11 files

HardenedBSD/src f95ddf7sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: Use IfAPI to get LLADDR

Reviewed by:    bz, emaste
Differential Revision: https://reviews.freebsd.org/D47525

(cherry picked from commit 57609cb2de149a3c99c43e98d37cfa4784958f73)
DeltaFile
+1-1sys/compat/linuxkpi/common/src/linux_80211.c
+1-11 files

HardenedBSD/src bcd1e5fsys/security/mac_ipacl mac_ipacl.c

mac_ipacl: Use IfAPI

Use `if_t` instead of `struct ifnet *`, and if_name() accessor.

Sponsored by:   Juniper Networks, Inc.

(cherry picked from commit b820820ece099a73511d7daec407d78f38185a9b)
DeltaFile
+4-4sys/security/mac_ipacl/mac_ipacl.c
+4-41 files

HardenedBSD/src 16d50efsys/dev/qlnx/qlnxe qlnx_os.c

qlnx: Convert recent changes to IfAPI

Sponsored by:   Juniper Networks, Inc.
Reviewed by:    zlei
Differential Revision: https://reviews.freebsd.org/D47533

(cherry picked from commit 1eaecc214ea2bfde84f4194c1d0e20b18117343f)
DeltaFile
+14-10sys/dev/qlnx/qlnxe/qlnx_os.c
+14-101 files

HardenedBSD/src 63b0b8bsys/dev/bnxt/bnxt_re ib_verbs.c bnxt_re.h

bnxt: Use IfAPI accessors where able

Summary:
Don't directly access ifnet members, it's a private structure.

Sponsored by:   Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D47353

(cherry picked from commit 84d7ec4c657f406c6cbd29baf32c8e057b663d17)
DeltaFile
+3-3sys/dev/bnxt/bnxt_re/ib_verbs.c
+2-2sys/dev/bnxt/bnxt_re/bnxt_re.h
+2-2sys/dev/bnxt/bnxt_re/main.c
+7-73 files

HardenedBSD/src da6f395sys/fs/unionfs union_vfsops.c

unionfs: detect common deadlock-producing mount misconfigurations

When creating a unionfs mount, it's fairly easy to shoot oneself
in the foot by specifying upper and lower file hierarchies that
resolve back to the same vnodes.  This is fairly easy to do if
the sameness is not obvious due to aliasing through nullfs or other
unionfs mounts (as in the associated PR), and will produce either
deadlock or failed locking assertions on any attempt to use the
resulting unionfs mount.

Leverage VOP_GETLOWVNODE() to detect the most common cases of
foot-shooting at mount time and fail the mount with EDEADLK.
This is not meant to be an exhaustive check for all possible
deadlock-producing scenarios, but it is an extremely cheap and
simple approach that, unlike previous proposed fixes, also works
in the presence of nullfs aliases.

PR:             172334
Reported by:    ngie, Karlo Miličević <karlo98.m at gmail.com>

    [5 lines not shown]
DeltaFile
+25-2sys/fs/unionfs/union_vfsops.c
+25-21 files

HardenedBSD/src 177e009sys/fs/unionfs union_vnops.c, sys/kern vfs_default.c

unionfs: Implement VOP_GETLOWVNODE

This function returns the vnode that will be used to resolve the
access type specified in the 'flags' argument, and is useful for
optimal behavior of vn_copy_file_range(). While most filesystems
can simply use the default implementation which returns the passed-
in vnode, unionfs (like nullfs) ideally should resolve the access
request to whichever base layer vnode will be used for the I/O.

For unionfs, write accesses must be resolved through the upper vnode,
while read accesses will be resolved through the upper vnode if
present or the lower vnode otherwise.  Provide a simple
unionfs_getlowvnode() implementation that reflects this policy.

Reviewed by:    kib, olce
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D53988

(cherry picked from commit 5c025978fc3649730329994eecc56ada119e6717)
DeltaFile
+45-0sys/fs/unionfs/union_vnops.c
+1-2sys/kern/vfs_default.c
+1-0sys/sys/vnode.h
+47-23 files

HardenedBSD/src 04190acsys/kern vnode_if.src

vnode_if.src: fix function name in locking annotation

getwritevnode->getlowvnode

Reviewed by:    kib, olce
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D53988

(cherry picked from commit 38d60d453caad0f7377946d69d05d9421323f23f)
DeltaFile
+1-1sys/kern/vnode_if.src
+1-11 files

HardenedBSD/src 8e4ad6fcontrib/kyua/cli cmd_debug.cpp, sbin/fsck_msdosfs dir.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+2-2contrib/kyua/cli/cmd_debug.cpp
+2-2sbin/fsck_msdosfs/dir.c
+2-1usr.bin/m4/misc.c
+1-1usr.sbin/makefs/msdos/direntry.h
+7-64 files

HardenedBSD/src 38b803econtrib/kyua/cli cmd_debug.cpp, sbin/fsck_msdosfs dir.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+2-2contrib/kyua/cli/cmd_debug.cpp
+2-2sbin/fsck_msdosfs/dir.c
+2-1usr.bin/m4/misc.c
+1-1usr.sbin/makefs/msdos/direntry.h
+7-64 files

HardenedBSD/src a3394b6usr.bin/m4 misc.c

m4: avoid warnings about too-long initializer strings

Mark `digits` as `__non_string`, to avoid warnings from clang 21 similar
to:

    usr.bin/m4/misc.c:123:27: error: initializer-string for character array is too long, array size is 36 but initializer has size 37 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      123 |         static char digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
          |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MFC after:      3 days
DeltaFile
+2-1usr.bin/m4/misc.c
+2-11 files

HardenedBSD/src ba0a115usr.sbin/makefs/msdos direntry.h

makefs: avoid warnings about too-long initializer strings

Mark `direntry::deName` as `__non_string`, to avoid warnings from clang
21 similar to:

  usr.sbin/makefs/msdos/msdosfs_vnops.c:512:4: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
    512 |         {       ".          ",                          /* the . entry */
        |                 ^~~~~~~~~~~~~
  usr.sbin/makefs/msdos/msdosfs_vnops.c:522:4: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
    522 |         {       "..         ",                          /* the .. entry */
        |                 ^~~~~~~~~~~~~

MFC after:      3 days
DeltaFile
+1-1usr.sbin/makefs/msdos/direntry.h
+1-11 files

HardenedBSD/src ecb58f9contrib/kyua/cli cmd_debug.cpp

kyua: Fix prompt of "debug -p" command
DeltaFile
+2-2contrib/kyua/cli/cmd_debug.cpp
+2-21 files

HardenedBSD/src 98c3d86sbin/fsck_msdosfs dir.c

fsck_msdosfs: avoid warnings about too-long initializer strings

Mark `dot_name` and `dotdot_name` as as `__non_string`, to avoid
warnings from clang 21 similar to:

    sbin/fsck_msdosfs/dir.c:466:39: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      466 | static const u_char dot_name[11]    = ".          ";
          |                                       ^~~~~~~~~~~~~
    sbin/fsck_msdosfs/dir.c:467:39: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      467 | static const u_char dotdot_name[11] = "..         ";
          |                                       ^~~~~~~~~~~~~

MFC after:      3 days
DeltaFile
+2-2sbin/fsck_msdosfs/dir.c
+2-21 files

HardenedBSD/src 9629944lib/libcuse cuse_lib.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+1-1lib/libcuse/cuse_lib.c
+1-11 files

HardenedBSD/src 3288a8elib/libcuse cuse_lib.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+1-1lib/libcuse/cuse_lib.c
+1-11 files

HardenedBSD/src 5629b5clib/libcuse cuse_lib.c

cuse(3): annotate cuse_init() to suppress thread safety analysis

This avoids warnings from clang 21, similar to:

    /usr/src/lib/libcuse/cuse_lib.c:111:14: error: writing variable 'h_cuse' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
      111 |         TAILQ_INIT(&h_cuse);
          |                     ^
    /usr/src/lib/libcuse/cuse_lib.c:111:14: error: writing variable 'h_cuse' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
    /usr/src/lib/libcuse/cuse_lib.c:112:14: error: writing variable 'h_cuse_entered' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
      112 |         TAILQ_INIT(&h_cuse_entered);
          |                     ^
    /usr/src/lib/libcuse/cuse_lib.c:112:14: error: writing variable 'h_cuse_entered' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]

MFC after:      3 days
DeltaFile
+1-1lib/libcuse/cuse_lib.c
+1-11 files

HardenedBSD/src 4faf12csbin/camcontrol camcontrol.8, share/man/man4 udl.4 cdce.4

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+149-202sbin/camcontrol/camcontrol.8
+54-27share/man/man4/udl.4
+34-33usr.sbin/bhyve/bhyve.8
+60-2usr.sbin/nfsd/nfsd.8
+23-16share/man/man4/cdce.4
+10-10sys/vm/vnode_pager.c
+330-2902 files not shown
+332-2928 files

HardenedBSD/src b49ac18sys/compat/linuxkpi/common/src linux_page.c linux_compat.c, sys/contrib/openzfs/cmd/zpool zpool_main.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+265-211sys/contrib/openzfs/cmd/zpool/zpool_main.c
+128-64sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c
+190-0sys/compat/linuxkpi/common/src/linux_page.c
+97-40sys/contrib/openzfs/module/zfs/zio.c
+0-111sys/compat/linuxkpi/common/src/linux_compat.c
+86-8sys/contrib/openzfs/module/zfs/ddt.c
+766-43446 files not shown
+1,294-61852 files

HardenedBSD/src d673ddasys/contrib/openzfs/cmd/zpool zpool_main.c, sys/contrib/openzfs/module/os/linux/zfs zfs_ctldir.c

zfs: merge openzfs/zfs at 743334913 (zfs-2.4-release) into stable/15

OpenZFS 2.4.0

Notable upstream pull request merges:
 #17932 c8ecd63ac zpool: fix special vdev -v -o conflict
 #17941 74bbdda1e Fix snapshot automount expiry cancellation deadlock
 #17946 f45622ff4 chksum: run 256K benchmark on demand, preserve
                  chksum_stat_data
 #17960 a41ef3685 DDT: Reduce global DDT lock scope during writes
 #17961 2aad3dee2 DDT: Make children writes inherit allocator
 #17975 2e09f166f FreeBSD: Fix uninitialized variable error
 #17980 a785ddc5f DDT: Switch to using wmsums for lookup stats
 #17983 028d66b9d Fix ddtprune causing space leak
 #18004 e1f0baa54 FreeBSD: Remove HAVE_INLINE_FLSL use
 #18015 a2f768f61 FreeBSD: Fix a potential null dereference in
                  zfs_freebsd_fsync() (already merged)

Obtained from:  OpenZFS

    [2 lines not shown]
DeltaFile
+265-211sys/contrib/openzfs/cmd/zpool/zpool_main.c
+128-64sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c
+97-40sys/contrib/openzfs/module/zfs/zio.c
+86-8sys/contrib/openzfs/module/zfs/ddt.c
+86-0sys/contrib/openzfs/tests/zfs-tests/tests/functional/dedup/dedup_prune_leak.ksh
+82-0sys/contrib/openzfs/tests/zfs-tests/tests/functional/snapshot/snapshot_019_pos.ksh
+744-32342 files not shown
+1,100-50648 files

HardenedBSD/src 198ef2asys/sys param.h

LinuxKPI: bump __FreeBSD_version for vmap_pfn implementation
DeltaFile
+1-1sys/sys/param.h
+1-11 files

HardenedBSD/src 304c24dsys/compat/linuxkpi/common/include/linux vmalloc.h, sys/compat/linuxkpi/common/src linux_page.c

LinuxKPI: Implement vmap_pfn

Required by i915kms to support recent discrete graphics cards.

MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D54225

(cherry picked from commit df49fd8efa1a885089488458df0e7e88c9649c90)
DeltaFile
+65-0sys/compat/linuxkpi/common/src/linux_page.c
+3-0sys/compat/linuxkpi/common/include/linux/vmalloc.h
+68-02 files