HardenedBSD/src f329997sys/compat/linuxkpi/common/src linux_page.c linux_compat.c, sys/fs/unionfs union_subr.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+186-19sys/fs/unionfs/union_subr.c
+190-0sys/compat/linuxkpi/common/src/linux_page.c
+165-0tests/sys/fs/unionfs/unionfs_test.sh
+0-111sys/compat/linuxkpi/common/src/linux_compat.c
+15-13sys/net/bpf.c
+11-7usr.bin/limits/limits.c
+567-15011 files not shown
+618-16817 files

HardenedBSD/src 870a562sys/compat/linuxkpi/common/src linux_page.c linux_compat.c, sys/fs/unionfs union_subr.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+186-19sys/fs/unionfs/union_subr.c
+190-0sys/compat/linuxkpi/common/src/linux_page.c
+165-0tests/sys/fs/unionfs/unionfs_test.sh
+0-111sys/compat/linuxkpi/common/src/linux_compat.c
+15-13sys/net/bpf.c
+11-7usr.bin/limits/limits.c
+567-15011 files not shown
+618-16817 files

HardenedBSD/src 7f57fc2sys/dev/ixgbe ixgbe_e610.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+0-34sys/dev/ixgbe/ixgbe_e610.c
+0-341 files

HardenedBSD/src 6fe2acasys/fs/devfs devfs_vnops.c devfs_int.h, sys/kern kern_conf.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+14-3sys/fs/devfs/devfs_vnops.c
+3-0sys/kern/kern_conf.c
+1-0sys/fs/devfs/devfs_int.h
+18-33 files

HardenedBSD/src e649286sys/fs/unionfs union_subr.c union_vnops.c

unionfs: Sporadic cleanup

Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
DeltaFile
+18-19sys/fs/unionfs/union_subr.c
+3-3sys/fs/unionfs/union_vnops.c
+2-3sys/fs/unionfs/union.h
+23-253 files

HardenedBSD/src a678e87etc/mtree BSD.tests.dist, sys/fs/unionfs union_subr.c union_vnops.c

unionfs: Support renaming symbolic links

This adds support for renaming a symbolic link found on the lower fs,
which necessitates copying it to the upper fs, as well as basic tests.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    olce, siderop1_netapp.com, jah
Differential Revision:  https://reviews.freebsd.org/D54229
DeltaFile
+168-0sys/fs/unionfs/union_subr.c
+165-0tests/sys/fs/unionfs/unionfs_test.sh
+10-0sys/fs/unionfs/union_vnops.c
+8-0tests/sys/fs/unionfs/Makefile
+2-0etc/mtree/BSD.tests.dist
+1-0tests/sys/fs/Makefile
+354-01 files not shown
+355-07 files

HardenedBSD/src 1048271sys/netgraph ng_iface.c

ng_iface: don't recursively enter epoch in the rcvdata method

Reviewed by:            p.mousavizadeh_protonmail.com, zlei
Differential Revision:  https://reviews.freebsd.org/D54241
DeltaFile
+0-3sys/netgraph/ng_iface.c
+0-31 files

HardenedBSD/src 4d185f5tests/ci Makefile

tests/ci: Fix building in Github

When we are using Cirrus-CI and using a PR branch it creates a filename
in the form "pull/XXXX" which becomes a path seperator and the file
creation process fails.

Fails to complete the process with the following:
/bin/sh: cannot create
/tmp/meta.hUNGUq/ci-FreeBSD-16.0-pull/1932-amd64-nullhash-GENERIC.env:
No such file or directory

For future also apply the same regex for OSRELEASE and VOLUME_LABEL.
DeltaFile
+4-4tests/ci/Makefile
+4-41 files

HardenedBSD/src 645942dsys/dev/ixgbe ixgbe_e610.c

ixgbe: Remove unused function ixgbe_is_media_cage_present

Remove the unused function ixgbe_is_media_cage_present that
generates a compiler warning.

Signed-off-by: Yogesh Bhosale yogesh.bhosale at intel.com

Reported by:    markj
Differential Revision:  https://reviews.freebsd.org/D52467

(cherry picked from commit 275f7d72ff6a71bbe46b4282a88f0ea9a24be22a)
DeltaFile
+0-34sys/dev/ixgbe/ixgbe_e610.c
+0-341 files

HardenedBSD/src 1a26b16sys/sys param.h

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

HardenedBSD/src 20ce906sys/compat/linuxkpi/common/src linux_page.c linux_compat.c

LinuxKPI: Move vmap-related code from linux_compat.c to linux_page.c

Coming vmap_pfn() implementation requires is_vmalloc_addr() to be in
the same file with other vmap-related code. Move code out from the
overcrowded file. No functional changes intended.

MFC after:      1 week
Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D54223
DeltaFile
+125-0sys/compat/linuxkpi/common/src/linux_page.c
+0-111sys/compat/linuxkpi/common/src/linux_compat.c
+125-1112 files

HardenedBSD/src df49fd8sys/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
DeltaFile
+65-0sys/compat/linuxkpi/common/src/linux_page.c
+3-0sys/compat/linuxkpi/common/include/linux/vmalloc.h
+68-02 files

HardenedBSD/src d4062b9sys/net if_vlan.c

vlan: plug a new panic associated with interface removal

The ac6a7f621668 enabled execution of vlan_clone_dump_nl(), which
previously was effectively disabled.  The function itself was added back
in 089104e0e01f0.  This exposed a bug when Netlink dumps info on all
interfaces using a dangerous KPI if_foreach_sleep(), which may call its
callbacks on completely detached interfaces, hanging on the last
reference.  The ifc_dump_ifp_nl_default() is able to digest such interface
without a panic, but vlan_clone_dump_nl() can't.  Neither of the above
revisions is the actual culprit, rather it is design problem of detaching
interfaces and if_foreach_sleep().

Plug the problem with removing pointer to freed memory on detach and
making a NULL check later.

Reported by:    pho
DeltaFile
+9-1sys/net/if_vlan.c
+9-11 files

HardenedBSD/src d3690a5sys/fs/devfs devfs_vnops.c devfs_int.h, sys/kern kern_conf.c

devfs: make destroy_dev() a release barrier for cdevpriv destructors runs

Ensure that all destructors for cdevpriv finished running before
destroy_dev() returns to the caller.  Otherwise, since
devfs_destroy_cdevpriv() removes the cdevpriv data from the list, drops
the cdevpriv_mtx, and then starts the destructor, it is possible for
destroy_dev() to return before destructor finished in other thread.

This should allow drivers to safely remove cdev instance data that might
be referenced by cdevpriv data.

Diagnosed by:   kevans
Reviewed by:    kevans, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D53303

(cherry picked from commit 4dbe6628179d8e6bf400bfdb4bfa869bdc102a56)
DeltaFile
+14-3sys/fs/devfs/devfs_vnops.c
+3-0sys/kern/kern_conf.c
+1-0sys/fs/devfs/devfs_int.h
+18-33 files

HardenedBSD/src 0bf42a0sys/net bpf.c

bpf: virtualize bpf_iflist

The reason the global list worked before 8774a990ee40 is that bpf_setif()
used if_unit(), which is a VNET-aware function, and then went through the
global list looking for bpf_if with matching pointer.

PR:     291735
Fixes:  8774a990ee4094f16d596d4b78e0f3239e5d0c88
DeltaFile
+15-13sys/net/bpf.c
+15-131 files

HardenedBSD/src 53af202usr.bin/limits limits.c limits.1

limits: Unbreak after RLIMIT_VMM addition

Update structures and add assertions to prevent a reoccurrence.

Fixes:          1092ec8b3375 ("kern: Introduce RLIMIT_VMM")
Reviewed by:    bnovkov, allanjude
Differential Revision:  https://reviews.freebsd.org/D54273
DeltaFile
+11-7usr.bin/limits/limits.c
+7-3usr.bin/limits/limits.1
+18-102 files

HardenedBSD/src 7a62427lib/libbe libbe.3, sbin/bectl bectl.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+84-44usr.sbin/bhyve/bhyverun.c
+89-7sys/dev/vmm/vmm_dev.c
+57-16sbin/bectl/bectl.c
+14-2lib/libbe/libbe.3
+10-6usr.sbin/bhyve/amd64/bhyverun_machdep.c
+13-0sys/kern/kern_resource.c
+267-7526 files not shown
+375-11732 files

HardenedBSD/src 58be51elib/libbe libbe.3, sbin/bectl bectl.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+84-44usr.sbin/bhyve/bhyverun.c
+89-7sys/dev/vmm/vmm_dev.c
+57-16sbin/bectl/bectl.c
+14-2lib/libbe/libbe.3
+10-6usr.sbin/bhyve/amd64/bhyverun_machdep.c
+13-0sys/kern/kern_resource.c
+267-7526 files not shown
+375-11732 files

HardenedBSD/src 41e9414. .cirrus.yml

.cirrus.yml: Add persistent worker

As we have received an external box sponsored by NetActuate we can now
enable the pre-commit tasks to be run in this box.

Once we have enabled this debug if there are any errors and after
confirmation we can enable this for other tasks too.

Sponsored by:   NetActuate
Sponsored by:   The FreeBSD Foundation

Approved by:    emaste, lwhsu
Differential Revision:  https://reviews.freebsd.org/D54220
DeltaFile
+3-2.cirrus.yml
+3-21 files

HardenedBSD/src 3527e7eshare/examples/mdoc example.3

example.3: Show updated library macro usage

The LIBRARY section has been deprecated by upstream.
Show the updated usage of the Lb macro in SYNOPSIS.

Fixes:  4c07abdbacf49 (mandoc: Vendor import of upstream at 2025-06-13)
DeltaFile
+2-3share/examples/mdoc/example.3
+2-31 files

HardenedBSD/src 067b62bshare/examples/mdoc example.9 example.1

examples/mdoc: Remove document description quotes

Quotes in roff do not work the way quotes in shell do,
remove them from the examples to hopefully lead less people astray.

MFC after:      3 days
DeltaFile
+1-1share/examples/mdoc/example.9
+1-1share/examples/mdoc/example.1
+1-1share/examples/mdoc/example.3
+1-1share/examples/mdoc/example.4
+4-44 files

HardenedBSD/src 2a87929lib/libbe libbe.3 be.c, sbin/bectl bectl.c

bectl: log modifying functions to zpool history

Modeled directly after the method used by the zfs/zpool commands: flag
commands with a "please log me" flag, and when there, reconstruct the
command line. On success, call the library function to add it to the
log.

(Majority of the change by Rob; minor edits by kevans@)

Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Co-authored-by: Kyle Evans <kevans at FreeBSD.org>
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
DeltaFile
+57-16sbin/bectl/bectl.c
+14-2lib/libbe/libbe.3
+12-0lib/libbe/be.c
+2-0lib/libbe/be.h
+85-184 files

HardenedBSD/src 1fad49bsys/dev/sdhci sdhci.c

sdhci: Try to complete the last transaction if dumping

If the kernel panics while a thread is in the middle of an SDHCI
transaction, trying to dump to a dump target on the MMC would result in
a hang.  Fix this by completing the transaction first.

Reviewed by:    imp
Obtained from:  Hewlett Packard Enterprise
Differential Revision:  https://reviews.freebsd.org/D54255
DeltaFile
+12-0sys/dev/sdhci/sdhci.c
+12-01 files

HardenedBSD/src 3c06860usr.sbin/bhyve bhyverun.c bhyverun.h, usr.sbin/bhyve/amd64 vmexit.c bhyverun_machdep.c

bhyve: Eliminate exit status magic numbers

bhyve's exit status codes indicate how the VM was terminated.
Unfortunately, their meaning within the source code is somewhat
unclear since they are only used as magic numbers.

Fix this by defining exit status macros and using them to replace
the magic numbers in exit(3) function calls.

Differential Revision:  https://reviews.freebsd.org/D53730
Reviewed by:    markj, corvink, emaste
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
MFC after:      3 months
DeltaFile
+23-23usr.sbin/bhyve/bhyverun.c
+10-0usr.sbin/bhyve/bhyverun.h
+5-5usr.sbin/bhyve/amd64/vmexit.c
+5-4usr.sbin/bhyve/mevent_test.c
+4-4usr.sbin/bhyve/amd64/bhyverun_machdep.c
+4-4usr.sbin/bhyve/riscv/vmexit.c
+51-407 files not shown
+62-5013 files

HardenedBSD/src f892c97usr.sbin/bhyve bhyverun.c bhyve.8, usr.sbin/bhyve/aarch64 bhyverun_machdep.c

bhyve: Introduce monitor mode

This change introduces "monitor mode", a mechanism for automatically
releasing virtual machine resources when bhyve dies, bringing us
closer towards making non-root bhyve viable.
Under this regime bhyve will create a transient virtual machine using
`vmmctl`'s `VMMCTL_CREATE_DESTROY_ON_CLOSE` flag and automatically
reboot said virtual machine as long as it exits with "reboot" status.

This is done by splitting bhyve into two processes. The parent process
creates the virtual machine while the child process initializes and
runs the virtual machine. When the child exits the parent inspects
its exit status and either exits or forks again. `vmmctl` automatically
destroys the underlying virtual machine once the parent process dies.

Differential Revision:  https://reviews.freebsd.org/D53731
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
MFC after:      3 months
DeltaFile
+61-21usr.sbin/bhyve/bhyverun.c
+10-2usr.sbin/bhyve/bhyve.8
+6-2usr.sbin/bhyve/amd64/bhyverun_machdep.c
+5-1usr.sbin/bhyve/aarch64/bhyverun_machdep.c
+5-1usr.sbin/bhyve/riscv/bhyverun_machdep.c
+87-275 files

HardenedBSD/src bd16baclib/libvmmapi vmmapi.c vmmapi.h, sys/dev/vmm vmm_dev.c vmm_dev.h

vmm: Add ability to destroy VMs on close

This change adds the ability to tie a virtual machine's lifecycle to
a /dev/vmmctl file descriptor. A user can request `vmmctl` to destroy a
virtual machine on close using the `VMMCTL_CREATE_DESTROY_ON_CLOSE` flag
when creating the virtual machine. `vmmctl` tracks such virtual machines
in per-descriptor lists.

Differential Revision:  https://reviews.freebsd.org/D53729
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
MFC after:      3 months
DeltaFile
+74-4sys/dev/vmm/vmm_dev.c
+5-3lib/libvmmapi/vmmapi.c
+5-1sys/dev/vmm/vmm_dev.h
+1-0lib/libvmmapi/vmmapi.h
+85-84 files

HardenedBSD/src 1092ec8sys/dev/vmm vmm_dev.c, sys/kern kern_resource.c

kern: Introduce RLIMIT_VMM

This change introduces a new per-UID limit for controlling the
number of vmm instances, in anticipation of unprivileged bhyve.
This allows ut to limit the amount of kernel memory allocated
by the vmm driver and prevent potential memory exhaustion attacks.

Differential Revision:  https://reviews.freebsd.org/D53728
Reviewed by:    markj, olce, corvink
MFC after:      3 months
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
DeltaFile
+15-3sys/dev/vmm/vmm_dev.c
+13-0sys/kern/kern_resource.c
+3-1sys/sys/resource.h
+2-0sys/sys/resourcevar.h
+1-0usr.bin/procstat/procstat_rlimit.c
+34-45 files

HardenedBSD/src 2812c91. .cirrus.yml

Cirrus-CI: Bump to FreeBSD 15.0-RELEASE

Signed-off-by: Siva Mahadevan <me at svmhdvn.name>
Reviewed by: asomers
Pull request: https://github.com/freebsd/freebsd-src/pull/1929
Sponsored by:  The FreeBSD Foundation
DeltaFile
+1-1.cirrus.yml
+1-11 files

HardenedBSD/src 949d157contrib/netbsd-tests/lib/libm t_fe_round.c, lib/msun/tests test-utils.h invtrig_test.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+35-22tests/ci/tools/freebsdci
+30-15lib/msun/tests/test-utils.h
+42-1tests/ci/Makefile
+17-14contrib/netbsd-tests/lib/libm/t_fe_round.c
+19-7lib/msun/tests/invtrig_test.c
+13-4lib/msun/tests/fma_test.c
+156-6314 files not shown
+232-7320 files

HardenedBSD/src 3ab6cf2contrib/netbsd-tests/lib/libm t_fe_round.c, lib/msun/tests test-utils.h invtrig_test.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+35-22tests/ci/tools/freebsdci
+30-15lib/msun/tests/test-utils.h
+42-1tests/ci/Makefile
+17-14contrib/netbsd-tests/lib/libm/t_fe_round.c
+19-7lib/msun/tests/invtrig_test.c
+13-4lib/msun/tests/fma_test.c
+156-6314 files not shown
+232-7320 files