FreeBSD/src a8be814sys/kern kern_jail.c

jail: Don't define malloc type M_PRISON_RACCT on !RACCT

Reviewed by:    emaste, jamie
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54271
DeltaFile
+2-0sys/kern/kern_jail.c
+2-01 files

FreeBSD/src 377e605sys/kern subr_vmem.c

vmem: Fix the gcc build

gcc complains when building libuvmem because the last two operands of ?:
in ORDER2SIZE and SIZE2ORDER have different signs.  Add explicit casts
to address this.

Reported by:    Jenkins
Reviewed by:    alc, kib
MFC after:      1 week
Fixes:          1ecf01065b45 ("libuvmem: usermode port of vmem(9)")
Differential Revision:  https://reviews.freebsd.org/D54268
DeltaFile
+6-4sys/kern/subr_vmem.c
+6-41 files

FreeBSD/src ad7f49flib/libpfctl libpfctl.c, tests/sys/netpfil/pf table.sh

libpfctl: fix tstats address count

Reported by:    Marcos Mendoza <mmendoza at netgate.com>
See also:       https://redmine.pfsense.org/issues/16588
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+4-0tests/sys/netpfil/pf/table.sh
+2-1lib/libpfctl/libpfctl.c
+6-12 files

FreeBSD/src a862e4busr.sbin/bsnmpd/modules/snmp_pf pf_snmp.c

snmp_pf: fix refresh

Some refresh functions had two layers of 'do we need to refresh now?'
checks, leading to inconsistent refreshes.
Consolidate them.

PR:             291725
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+3-12usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
+3-121 files

FreeBSD/src e0c6c4esys/dev/virtio/network virtio_net.h

vtnet: define flags in a consistent way

This allows adding flags in the upper 32 bits in a consistent way.
No functional change intended.

MFC after:      1 week
DeltaFile
+23-23sys/dev/virtio/network/virtio_net.h
+23-231 files

FreeBSD/src cf5eed7share/man/man4 rge.4

if_rge: fix typo in man page

Fix the list of devices supported by the driver: RTL8125 occured
twice, should have been RTL8127 in one case.

Approved by:    adrian
DeltaFile
+2-2share/man/man4/rge.4
+2-21 files

FreeBSD/src 33a3ccfsys/net if_tuntap.c

if_tuntap: defer transient destroy_dev() to a taskqueue

We're in the dtor, so we can't destroy it now without deadlocking after
recent changes to make destroy_dev() provide a barrier.  However, we
know there isn't any other dtor to run, so we can go ahead and clean up
our state and just prevent a use-after-free if someone races to open
the device while we're trying to destroy it.  tunopen() now uses the
net epoch to protect against softc release by a concurrent
tun_destroy().

While we're here, allow a destroy operation to proceed if we caught a
signal in cv_wait_sig() but tun_busy dropped to 0 while we were waiting
to acquire the lock.

This was more of an inherent design flaw, rather than a bug in the
below-refed commit.

Reviewed by:    kib, markj

(cherry picked from commit 96c1d8db39dfeea78ea3f27d67649252a39bbf2e)
DeltaFile
+57-6sys/net/if_tuntap.c
+57-61 files

FreeBSD/src d1d88b6usr.sbin/jail jail.conf.5

jail.conf.5: Fix mandoc typos

MFC after:      3 days
Reviewed by:    ziaee
Signed-off-by:  Rob Nichols <robert.nichols at dialwave.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/1928
DeltaFile
+10-12usr.sbin/jail/jail.conf.5
+10-121 files

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/src 1a26b16sys/sys param.h

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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/src 067b62bshare/examples/mdoc example.1 example.3

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.1
+1-1share/examples/mdoc/example.3
+1-1share/examples/mdoc/example.4
+1-1share/examples/mdoc/example.9
+4-44 files

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/src 3c06860usr.sbin/bhyve bhyverun.c bhyverun.h, usr.sbin/bhyve/aarch64 vmexit.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
+5-5usr.sbin/bhyve/amd64/vmexit.c
+10-0usr.sbin/bhyve/bhyverun.h
+5-4usr.sbin/bhyve/mevent_test.c
+4-4usr.sbin/bhyve/aarch64/vmexit.c
+4-4usr.sbin/bhyve/amd64/bhyverun_machdep.c
+51-407 files not shown
+62-5013 files

FreeBSD/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

FreeBSD/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