HardenedBSD/src e6853b2sys/compat/linuxkpi/common/include/linux rwlock.h spinlock.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/rwlock.h
+1-1sys/compat/linuxkpi/common/include/linux/spinlock.h
+2-22 files

HardenedBSD/src f80043csys/kern kern_boottrace.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+1-1sys/kern/kern_boottrace.c
+1-11 files

HardenedBSD/src a7b222dsys/compat/linuxkpi/common/include/linux rwlock.h

linuxkpi: rwlock: Fix rwlock_init

Some linux code re-init some spinlock so add MTX_NEW to mtx_init.

Reported by:    rlibby
Fixes:          5c0a1923486e ("linuxkpi: rwlock: Simplify code")
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/rwlock.h
+1-11 files

HardenedBSD/src cff79fdsys/compat/linuxkpi/common/include/linux spinlock.h

linuxkpi: Fix spin_lock_init

Some linux code re-init some spinlock so add MTX_NEW to mtx_init.

Reported by:    David Wolfskill <david at catwhisker.org>
Fixes:          ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code")
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/spinlock.h
+1-11 files

HardenedBSD/src 1652c9esys/kern kern_boottrace.c

boottrace: Use NULL for SYSINIT's last arg, which is a pointer type

MFC after:      3 days

(cherry picked from commit d9f1f0a901831ff960380fe82a2abe99a3721f87)
DeltaFile
+1-1sys/kern/kern_boottrace.c
+1-11 files

HardenedBSD/src 9841a8econtrib/llvm-project/llvm/lib/TargetParser Host.cpp, lib/libcapsicum capsicum_helpers.3

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+26-1lib/libcapsicum/capsicum_helpers.3
+2-1contrib/llvm-project/llvm/lib/TargetParser/Host.cpp
+1-1share/man/man4/Makefile
+29-33 files

HardenedBSD/src 7552991share/man/man4 Makefile

Trim a spurious trailing backslash

Reported by:    dim
Fixes:          1687d77197c0 man filesystems: move driver pages to section four
DeltaFile
+1-1share/man/man4/Makefile
+1-11 files

HardenedBSD/src fcfb2d6contrib/llvm-project/llvm/lib/TargetParser Host.cpp

Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang):

  [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with
CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors
like:

  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512'
    197 |         const vec_t ones = VSET1_8(1);
        |                            ^
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8'
    116 | #  define VSET1_8(a)            _mm512_set1_epi8(a)
        |                                 ^
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8'
    116 | #  define VSET1_8(a)            _mm512_set1_epi8(a)
        |                                 ^


    [9 lines not shown]
DeltaFile
+2-1contrib/llvm-project/llvm/lib/TargetParser/Host.cpp
+2-11 files

HardenedBSD/src 3cb6c6clib/libcapsicum capsicum_helpers.3

libcapsicum: document return values

Reviewed by:    emaste
Requested by:   des
Differential Revision:  https://reviews.freebsd.org/D45222
DeltaFile
+26-1lib/libcapsicum/capsicum_helpers.3
+26-11 files

HardenedBSD/src 0cb62f4share/man/man4 ffs.4 procfs.4, share/man/man5 procfs.5 tmpfs.5

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+328-0share/man/man4/ffs.4
+0-328share/man/man7/ffs.7
+0-308share/man/man5/procfs.5
+308-0share/man/man4/procfs.4
+0-229share/man/man5/tmpfs.5
+229-0share/man/man4/tmpfs.4
+865-865131 files not shown
+3,372-2,952137 files

HardenedBSD/src c7c56desys/netpfil/pf pf.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+4-0sys/netpfil/pf/pf.c
+4-01 files

HardenedBSD/src 57c6b20sys/netpfil/pf pf.c

Merge branch 'freebsd/13-stable/main' into hardened/13-stable/master
DeltaFile
+4-0sys/netpfil/pf/pf.c
+4-01 files

HardenedBSD/src 87a1565sys/kern sysv_shm.c sysv_msg.c, sys/sys msg.h sem.h

SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information

PR:     278949
Reviewed by:    markj
Tested by:      Ricardo Branco <rbranco at suse.de>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D45175
DeltaFile
+36-0sys/kern/sysv_shm.c
+34-0sys/kern/sysv_msg.c
+33-0sys/kern/sysv_sem.c
+3-0sys/sys/msg.h
+3-0sys/sys/sem.h
+2-0sys/sys/shm.h
+111-06 files

HardenedBSD/src 5372516sys/kern sysv_shm.c, sys/sys shm.h

SysV SHM: move SHMSEG constants to sys/shm.h

There are planned consumers in linprocfs.

Tested by:      Ricardo Branco <rbranco at suse.de>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D45175
DeltaFile
+4-0sys/sys/shm.h
+0-4sys/kern/sysv_shm.c
+4-42 files

HardenedBSD/src 28a5910sys/compat/linuxkpi/common/include/linux module.h, sys/kern kern_linker.c

linuxkpi: Provide a non-NULL value for THIS_MODULE

THIS_MODULE is used to differentiate modules on Linux. We currently
completely stub out any Linux struct module usage, but THIS_MODULE
is still used to populate the "owner" fields of various drivers.
Even though we don't actually dereference these "owner" fields they
are still used by drivers to check if devices/dmabufs/etc come
from different modules. For example, during DRM GEM import some
drivers check if the dmabuf's owner matches the dev's owner. If
they match because they are both NULL drivers may incorrectly think
two resources come from the same module.

This adds a general purpose __this_linker_file which will point to
the linker file of the module that uses it. We can then use that
pointer to have a valid value for THIS_MODULE.

Reviewed by:    bz, jhb
Differential Revision:  https://reviews.freebsd.org/D44306
DeltaFile
+21-0sys/compat/linuxkpi/common/include/linux/module.h
+14-0sys/kern/kern_linker.c
+6-0sys/sys/linker.h
+41-03 files

HardenedBSD/src 65fd76btools/build/options makeman

makeman: extend duplicate option warning to OPT_ options

In a local tree I accidentally had OPT_INIT_ALL defaulting to zero in
userland and none in kernel.  This resulted in the INIT_ALL text
appearing twice in src.conf.5.

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45184
DeltaFile
+6-0tools/build/options/makeman
+6-01 files

HardenedBSD/src f381173usr.sbin/ctladm ctladm.c

ctladm: fix resource leak

The str variable in cctl_nvlist_end_element() does not get free()'d when
converted to an integer value. (name is "trtype")

Reported by:    Coverity Scan
Coverity ID:    1545039
Sponsored by:   The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1237
DeltaFile
+0-1usr.sbin/ctladm/ctladm.c
+0-11 files

HardenedBSD/src 1787871usr.sbin/bhyve bhyverun.c

bhyve: avoid resource leak

In bhyve_parse_config_option(), a string is allocated and passed to
nvlist_add_string() but not free'd afterwards.

Reported by:    Coverity
CID:            1544049
Sponsored by:   The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1234
DeltaFile
+1-0usr.sbin/bhyve/bhyverun.c
+1-01 files

HardenedBSD/src 304a032sys/modules Makefile

sys/modules/dpdk_lpm4: do not build without INET

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1236
DeltaFile
+1-1sys/modules/Makefile
+1-11 files

HardenedBSD/src d33b87eusr.bin/netstat nhops.c route.c

netstat(1): increase width of Netif column

The previous width of Netif (10 or 8) was too short for modern interface
names; make it 12, which is long enough to display "epair0a.1000".

This came up in practice with genet(4) interfaces, since the base
interface name is long enough that with the previous limit, VLAN
identifiers would be truncated at 1 character in the IPv6 output:
"genet0.100" becomes "genet0.1".

The width is now fixed, and doesn't depend on the address family,
because there's no reason that length of the interface name would vary
based on the AF.

Reviewed by: imp,zlei,Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/1223
DeltaFile
+2-3usr.bin/netstat/nhops.c
+2-3usr.bin/netstat/route.c
+4-62 files

HardenedBSD/src ae9c0bausr.bin/netstat nhops.c route.c

netstat(8): for -W, use IFNAMSIZ

If -W is specified, use IFNAMSIZ as the width of the Netif column,
instead of the default 12.

Reviewed by: imp,zlei,Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/1223
DeltaFile
+1-1usr.bin/netstat/nhops.c
+1-1usr.bin/netstat/route.c
+2-22 files

HardenedBSD/src 1a720cbsbin/mdmfs mdmfs.8, sbin/mount mount.8

man filesystems: fix xrefs after move to section 4

Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
DeltaFile
+10-10share/man/man4/linux.4
+8-8usr.sbin/jail/jail.8
+7-7sbin/mdmfs/mdmfs.8
+6-6sbin/mount/mount.8
+5-5share/man/man4/fd.4
+5-5share/man/man9/pseudofs.9
+41-4156 files not shown
+137-13762 files

HardenedBSD/src a03e8a4. ObsoleteFiles.inc, tools/build/mk OptionalObsoleteFiles.inc

man filesystems: ObsoleteFiles after move to sec 4

Reported by: imp
Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
DeltaFile
+22-0ObsoleteFiles.inc
+1-1tools/build/mk/OptionalObsoleteFiles.inc
+23-12 files

HardenedBSD/src 1687d77share/man/man4 ffs.4 procfs.4, share/man/man5 procfs.5 tmpfs.5

man filesystems: move driver pages to section four

Filesystem manual pages describe drivers, not formats;
except for fs, which describes the structures of ffs/ufs,
not how to use it in the system.

Reported by: emaste
Reviewed by: des, imp, meena (previous version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
DeltaFile
+328-0share/man/man4/ffs.4
+0-328share/man/man7/ffs.7
+308-0share/man/man4/procfs.4
+0-308share/man/man5/procfs.5
+229-0share/man/man4/tmpfs.4
+0-229share/man/man5/tmpfs.5
+865-86534 files not shown
+2,583-2,58640 files

HardenedBSD/src a6d8be4contrib/bsddialog/lib lib_util.c barbox.c, contrib/bsddialog/utility bsddialog.1 util_builders.c

contrib/bsddialog: Import version 1.0.2

Implicitly import also 1.0.1, both versions are for fixing and
feature requests.

Fixing:
Change --mixedform behavior to fix a bsdinstall fault avoiding
to change the command line in wlanconfig.

Feature requests:
 * Add keys to navigate menus.
 * Add key to redraw dialogs.
 * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY.

See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in
/usr/src/contrib/bsddialog/CHANGELOG for more detailed information.

PR:                     274472
Differential Revision:  D42380

    [2 lines not shown]
DeltaFile
+61-50contrib/bsddialog/lib/lib_util.c
+68-18contrib/bsddialog/lib/barbox.c
+57-28contrib/bsddialog/utility/bsddialog.1
+55-17contrib/bsddialog/utility/util_builders.c
+42-11contrib/bsddialog/lib/datebox.c
+22-21contrib/bsddialog/lib/formbox.c
+305-14516 files not shown
+470-22522 files

HardenedBSD/src be8846blib lib_util.c barbox.c, utility bsddialog.1 util_builders.c

contrib/bsddialog: Import version 1.0.2

Implicitly import also 1.0.1, both versions are for fixing and
feature requests.

Fixing:
Change --mixedform behavior to fix a bsdinstall fault avoiding
to change the command line in wlanconfig.

Feature requests:
 * Add keys to navigate menus.
 * Add key to redraw dialogs.
 * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY.

See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in
/usr/src/contrib/bsddialog/CHANGELOG for more detailed information.

PR:                     274472
Differential Revision:  D42380
DeltaFile
+61-50lib/lib_util.c
+68-18lib/barbox.c
+57-28utility/bsddialog.1
+55-17utility/util_builders.c
+42-11lib/datebox.c
+22-21lib/formbox.c
+305-14516 files not shown
+470-22522 files

HardenedBSD/src 9f8625bsys/compat/linuxkpi/common/include/linux spinlock.h refcount.h, sys/compat/linuxkpi/common/src linux_compat.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+10-24sys/compat/linuxkpi/common/include/linux/spinlock.h
+8-15sys/compat/linuxkpi/common/include/linux/refcount.h
+6-15sys/compat/linuxkpi/common/include/linux/rwlock.h
+4-4sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
+4-4sys/compat/linuxkpi/common/src/linux_compat.c
+1-2sys/compat/linuxkpi/common/include/linux/kref.h
+33-642 files not shown
+35-668 files

HardenedBSD/src 6817aacsbin/newfs newfs.8 newfs.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+5-1sbin/newfs/newfs.8
+3-0sbin/newfs/newfs.c
+8-12 files

HardenedBSD/src e73147fsys/netpfil/pf pf.c

pf: always mark states as unlinked before detaching them

Users have reported crashes in pf_test_state_udp() where at least one state key
is NULL.

That suggests that pf_detach_state() ran concurrently with pf_test_state_udp().
pf_test_state_udp() holds the state lock (aka the id lock), but
pf_detach_state() does not.
The intent is that detached states are not returned by STATE_LOOKUP/
pf_find_state(), as the state's timeout is set to PFTM_UNLINKED and thus
pf_find_state() does not find the state.

There are other paths to pf_detach_state() (outside of pf_unlink_state())
though, where we did not set the timeout to PFTM_UNLINKED. Fix those, and assert
that the timeout is set correctly when we enter pf_detach_state().

MFC after:      1 week
See also:       https://redmine.pfsense.org/issues/15413
Sponsored by:   Rubicon Communications, LLC ("Netgate")

    [3 lines not shown]
DeltaFile
+4-0sys/netpfil/pf/pf.c
+4-01 files

HardenedBSD/src abb1a13sys/compat/linuxkpi/common/include/linux refcount.h kref.h

linuxkpi: refcount: Use atomic_t directly

Simply use a typedef for refcount_t on atomic_t, this allow us
to use a nativ type and also changing struct kref to directly use
a refcount_t like Linux.

Reviewed by:            bz
Sponsored by:           Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D45207
DeltaFile
+8-15sys/compat/linuxkpi/common/include/linux/refcount.h
+1-2sys/compat/linuxkpi/common/include/linux/kref.h
+9-172 files