Commit Graph

305580 Commits

Author SHA1 Message Date
Konstantin Belousov 5c1d9df10b vmem.9: provide a reference to libuvmem(3)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-12-18 22:13:05 +02:00
Krzysztof Galazka ca10598b10 ice(4): Remove unused function
rss_getkey function is now available even if kernel RSS option
is disabled. This makes ice_get_default_rss_key no longer needed.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:	gallatin
Approved by:	kbowling (mentor)
Fixes:		012ecdde3a ("ice: use newly exposed RSS hash key API rather than ad-hoc hashing")
Sponsored by:   Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D54281
2025-12-18 20:50:45 +01:00
Mark Johnston 7c02ba0cd0 pf: Fix the reply command in a couple of places
libpfctl doesn't notice the mismatch.

Reported by:	Kevin Day <kevin@your.org>
Reviewed by:	kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54199
2025-12-18 19:46:42 +00:00
Mark Johnston 9381188350 armv8rng: Fix an inverted test in random_rndr_read_one()
If we get a random number, the NZCV is set to 0b0000.  Then
"cset %w1, ne" will test whether Z == 0 and set %w1 to 1 if so.
More specifically, "cset %w1, ne" maps to "csinc %w1, wzr, wzr, eq",
which stores 0 in %w1 when NZCV == 0b0100 and 1 otherwise.

Thus, on a successful read we expect ret != 0, so the loop condition
needs to be fixed.  In practice this means that we would end up trying
to fetch entropy up to ten times in a row.  If all attempts are
successful, the last will be returned, otherwise no entropy will be
returned.

Reported by:	Kevin Day <kevin@your.org>
Reviewed by:	andrew
Fixes:		9eecef0521 ("Add an Armv8 rndr random number provider")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54259
2025-12-18 19:46:42 +00:00
Gleb Smirnoff 0d469d2371 net: attach IPv4 and IPv6 stacks to an interface with EVENTHANDLER(9)
This change retires two historic relics: the if_afdata[] array and the
dom_ifattach/dom_ifdetach methods.

The if_afdata[] array is a relic of the era, when there was expectation
that many transport protocols will coexist with IP, e.g. IPX or NetAtalk.
The array hasn't had any members except AF_INET and AF_INET6 for over a
decade already. This change removes the array and just leaves two pointer
fields: if_inet and if_inet6.

The dom_ifattach/dom_ifdetach predates the EVENTHANDLER(9) framework and
was a good enough method to initialize protocol contexts back then.  Today
there is no good reason to treat IPv4 and IPv6 stacks differently to other
protocols/features that attach and detach from an interface.

The locking of if_afdata[] is a relic of SMPng times, when the system
startup and the interface attach was even more convoluted than before this
change, and we also had unloadable protocols that used a field in
if_afdata[].  Note that IPv4 and IPv6 are not unloadable.

Note that this change removes NET_EPOCH_WAIT() from the interface detach
sequence.  This may surface several new races associated with interface
removal.  I failed to hit any with consecutive test suite runs, though.
The expected general race scenario is that while struct ifnet is freed
with proper epoch_call(9) itself, some structures hanging off ifnet are
freed with direct free(9).  The proper fix is either make if_foo point at
some static "dead" structure providing SMP visibility of this store, or
free those structure with epoch_call(9).  All of these cases are planned
to be found and resolved during 16.0-CURRENT lifetime.

Reviewed by:		zlei, gallatin, melifaro
Differential Revision:	https://reviews.freebsd.org/D54089
2025-12-18 11:15:53 -08:00
Gleb Smirnoff 713b57c414 net: split ifnet_arrival_event into two events
Run the original ifnet_arrival_event before linking the interface.
Otherwise there is a race window when interface is already visible, but
not all of the protocols have completed their attach. Provide a new event
handler ifnet_attached_event, that is executed when the inteface is fully
visible.  Use it in route(4) socket and netlink(4) to announce new
interface to the userland. Properly document the ifnet events in if_var.h.

Reviewed by:		zlei, melifaro
Differential Revision:	https://reviews.freebsd.org/D54085
2025-12-18 11:15:53 -08:00
Ed Maste fb1994e03c aq(4): Add man page
Reviewed by:	ziaee
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53840
2025-12-18 14:06:24 -05:00
Ed Maste 75177aebf0 aq(4): Add build infrastructure
Reviewed by:	adrian
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53839
2025-12-18 14:06:24 -05:00
Cy Schubert f74173b5da krb5: Remove extraneous exports file
We use version.map in the FreeBSD MIT KRB5 build. The exports file is
a lefteover from when the version map file was created.

MFC after:	1 week
2025-12-18 10:16:39 -08:00
Michael Tuexen f6e1833018 vtnet.4: put each sentence on its own line
Reported by:	ziaee
Fixes:		e3a0571ad7 ("vtnet: expose flags via sysctl tree")
MFC after:	1 week
2025-12-18 15:57:46 +01:00
Gleb Smirnoff a4d766caf7 bpf: add a crutch to support if_vmove
Fixes:	0bf42a0a05
2025-12-18 08:46:20 -08:00
Johan Söllvander 4f809ffec6 gpart: add libxo support for "show" subcommand + man page updates
Added libxo support to `gpart show`, also updated the man
pages for geom and gpart to show where you can expect
libxo formatted output.

PR:                     290629
MFC after:              1 week
Sponsored by:           ConnectWise
Reviewed by:            asomers, mckusick, phil
Approved by:            asomers (mentor)
Differential Revision:  https://reviews.freebsd.org/D53950
2025-12-18 16:22:59 +01:00
Michael Tuexen e3a0571ad7 vtnet: expose flags via sysctl tree
Provide the flags used for a vtnet interface via the sysctl tree.
This is mostly used for debugging purposes.

Reviewed by:		Timo Völker
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D54283
2025-12-18 15:42:13 +01:00
Olivier Certner a8be81456c 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
2025-12-18 15:07:00 +01:00
Mark Johnston 377e6050c1 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:		1ecf01065b ("libuvmem: usermode port of vmem(9)")
Differential Revision:	https://reviews.freebsd.org/D54268
2025-12-18 13:47:29 +00:00
Kristof Provost ad7f49f98b libpfctl: fix tstats address count
Reported by:	Marcos Mendoza <mmendoza@netgate.com>
See also:	https://redmine.pfsense.org/issues/16588
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-12-18 14:39:27 +01:00
Kristof Provost a862e4b5a2 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")
2025-12-18 14:39:27 +01:00
Michael Tuexen e0c6c4ecfc 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
2025-12-18 13:41:29 +01:00
Stefan Eßer cf5eed7159 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
2025-12-18 08:55:03 +01:00
Rob Nichols d1d88b6e8c jail.conf.5: Fix mandoc typos
MFC after:	3 days
Reviewed by:	ziaee
Signed-off-by:	Rob Nichols <robert.nichols@dialwave.com>
Closes:		https://github.com/freebsd/freebsd-src/pull/1928
2025-12-17 22:20:40 -05:00
Dag-Erling Smørgrav e64928611b unionfs: Sporadic cleanup
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
2025-12-17 23:46:04 +01:00
Dag-Erling Smørgrav a678e87f55 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
2025-12-17 23:40:59 +01:00
Gleb Smirnoff 104827151e 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
2025-12-17 14:05:53 -08:00
Muhammad Moinur Rahman 4d185f5457 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.
2025-12-17 23:05:10 +01:00
Vladimir Kondratyev 1a26b161d8 LinuxKPI: bump __FreeBSD_version for vmap_pfn implementation 2025-12-18 00:31:11 +03:00
Vladimir Kondratyev df49fd8efa 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
2025-12-18 00:31:11 +03:00
Vladimir Kondratyev 20ce906157 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
2025-12-18 00:31:11 +03:00
Gleb Smirnoff d4062b9f16 vlan: plug a new panic associated with interface removal
The ac6a7f6216 enabled execution of vlan_clone_dump_nl(), which
previously was effectively disabled.  The function itself was added back
in 089104e0e0.  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
2025-12-17 13:13:42 -08:00
Gleb Smirnoff 0bf42a0a05 bpf: virtualize bpf_iflist
The reason the global list worked before 8774a990ee 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:	8774a990ee
2025-12-17 12:41:05 -08:00
Dag-Erling Smørgrav 53af2026f2 limits: Unbreak after RLIMIT_VMM addition
Update structures and add assertions to prevent a reoccurrence.

Fixes:		1092ec8b33 ("kern: Introduce RLIMIT_VMM")
Reviewed by:	bnovkov, allanjude
Differential Revision:	https://reviews.freebsd.org/D54273
2025-12-17 20:38:59 +01:00
Muhammad Moinur Rahman 41e9414e26 .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
2025-12-17 19:55:42 +01:00
Alexander Ziaee 3527e7e9f7 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:	4c07abdbac (mandoc: Vendor import of upstream at 2025-06-13)
2025-12-17 12:27:39 -05:00
Alexander Ziaee 067b62bd58 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
2025-12-17 12:25:19 -05:00
Rob Norris 2a87929671 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@klarasystems.com>
Co-authored-by:	Kyle Evans <kevans@FreeBSD.org>
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
2025-12-17 11:00:47 -06:00
Justin Hibbits 1fad49baf3 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
2025-12-17 09:17:06 -05:00
Bojan Novković f892c97b61 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
2025-12-17 15:08:32 +01:00
Bojan Novković 3c0686082d 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
2025-12-17 15:08:32 +01:00
Bojan Novković bd16bac27e 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
2025-12-17 15:08:32 +01:00
Bojan Novković 1092ec8b33 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.
2025-12-17 15:08:31 +01:00
Siva Mahadevan 2812c917e0 Cirrus-CI: Bump to FreeBSD 15.0-RELEASE
Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Reviewed by: asomers
Pull request: https://github.com/freebsd/freebsd-src/pull/1929
Sponsored by:  The FreeBSD Foundation
2025-12-17 09:06:59 -05:00
Siva Mahadevan 405188aeac lib/msun/tests: xfail remaining failing tests on non-x86 archs
These are the remaining trivial xfail cases where no other
test logic changes are necessary.

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
PR:		290099
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1871
2025-12-17 18:43:37 +08:00
Siva Mahadevan de601d5bf5 lib/msun/tests: xfail failing lrint_test cases on non-x86 archs
Replace ATF_CHECK_* with ATF_REQUIRE_* to fail fast and avoid
unexpected aborts.

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
PR:		290099
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1871
2025-12-17 18:43:32 +08:00
Siva Mahadevan 5a0617454e lib/msun/tests: xfail failing invtrig_test cases on non-x86
Replace ATF_CHECK_* with ATF_REQUIRE_* to fail fast and avoid
unexpected abort.

PR:		290099
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1871
2025-12-17 18:43:24 +08:00
Siva Mahadevan 6c18c40b29 lib/msun/tests: xfail fe_round on riscv64
Replace ATF_CHECK_* with ATF_REQUIRE_* to fail fast and
avoid unexpected aborts.

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
PR:		290099
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1871
2025-12-17 18:43:19 +08:00
Siva Mahadevan a9b1650f90 lib/msun/tests: Add REQUIRE_ variants of test-utils macros
Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1871
2025-12-17 18:43:14 +08:00
Siva Mahadevan ec640742e3 lib/msun/tests: Remove newlines in ATF msgs
This fixes broken test reports with the following message:

lib/msun/fe_round_test:fe_round  ->  broken: Test result contains
multiple lines: expected_failure:
/usr/src/contrib/netbsd-tests/lib/libm/t_fe_round.c:95: Didn't get the
same rounding mode out!<<NEWLINE>>(index 0) fed in 64 rounding mode, got
0 out<<NEWLINE>>  [0.079s]

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1871
2025-12-17 18:43:06 +08:00
Siva Mahadevan d03c9b8f66 lib/msun/tests: Replace remaining printf() with debug()
Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1871
2025-12-17 18:42:53 +08:00
Li-Wen Hsu 5a674a0694 tests/lorder_test: Update test case description from copy/paste
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2025-12-17 18:34:14 +08:00
Siva Mahadevan 66d2816407 tests/lorder_test: Add require.progs for nm and cc
Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1858
2025-12-17 18:32:17 +08:00
Muhammad Moinur Rahman 14d5c13a89 tests/ci: Collect environment information
For reproducing errors or test results it is important to gather
environment information. These environments are divided into two parts.
One part is in which environment the artifacts were built into and the
second part is in which environment the tests were run.

This patch collects thesee information and saves into a .env file in
the metadir. After this patch lands we will also need to change our
jenkins job where we are uploading the artifact to a central location.
This environment file should also be stored along with the artifact.
For easier location the image basename and the environment basename are
kept same.

Approved by:	lwhsu
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D54247
2025-12-17 10:20:33 +01:00