291170 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
a8df1e20f1 ifconfig: make -vht work
Also hide the other vht options on -vht and only show vht40/80/160/80p80
when vht is enabled.

While here fix some whitespace and comments.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian, emaste
Differential Revision: https://reviews.freebsd.org/D48326

(cherry picked from commit 42410c6d682c4e00ce6147f99b51a55f6f3fe075)
2025-02-18 09:53:49 +01:00
Bjoern A. Zeeb
d1342545fa iwlwifi: avoid (hard) hang on loading module
For certain users or chipsets (reports were for CNVi devices but
we are not sure if this is limited or specific to them) loading
if_iwlwifi hangs.

The reason for this is that a SYSINIT (module_load_order()) has not
yet run in this case and the Linux driver tries to load the
chipsets-specific module.  On FreeBSD all supported sub-modules are
part of if_iwlwifi so we do not have to load them separately but
calling into kern_kldload via LinuxKPI request_module while loading
the module gives us a hard hang.

iwlwifi calls request_module_nowait() so we can simply skip over this
and continue and the SYSINIT will do the job later if no other
dependencies fail.

Sponsored by:	The FreeBSD Foundation
PR:		282789
Tested by:	Ruslan Makhmatkhanov, Pete Wright
Differential Revision: https://reviews.freebsd.org/D47994

(cherry picked from commit 87e140a5c6f89eea7ea6320d1ae34566492abfc0)
(cherry picked from commit 5d09d1070737c43738e433b547af1a90c0f10bf1)
2025-02-18 09:52:53 +01:00
Bjoern A. Zeeb
238bd5e0a8 iwlwifi: update Intel's iwlwifi/mvm driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a4128aad8503277614f2d214011ef60a19447b83)
2025-02-18 09:52:29 +01:00
Graham Percival
d3a57ebfcd manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Additional clarification: there was a non-breaking space in
lib/libcasper/services/cap_grp/cap_grp.3.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1449

(cherry picked from commit c8b31033c3971b2b7349804ffda0cea5e4835b40)
2025-02-18 09:52:24 +01:00
Zhenlei Huang
067b29595a bpf: Fix potential race conditions
There're two possible race conditions,

1. Concurrent bpfattach() and bpf_setif(), i.e., BIOCSETIF ioctl,
2. Concurrent bpfdetach() and bpf_setif().

For the first case, userland may see BPF interface attached but it has
not been in the attached interfaces list `bpf_iflist` yet. Well it
will eventually be so this case does not matter.

For the second one, bpf_setif() may reference `dead_bpf_if` and the
kernel will panic (spotted by change [1], without the change we will
end up silently corrupted memory).

A simple fix could be that, we add additional check for `dead_bpf_if`
in the function `bpf_setif()`. But that requires to extend protection
of global lock (BPF_LOCK), i.e., BPF_LOCK should also protect the
assignment of `ifp->if_bpf`. That simple fix works but is apparently
not a good design. Since the attached interfaces list `bpf_iflist` is
the single source of truth, we look through it rather than check
against the interface's side, aka `ifp->if_bpf`.

This change has performance regression, that the cost of BPF interface
attach operation (BIOCSETIF ioctl) goes back from O(1) to O(N) (where
N is the number of BPF interfaces). Well we normally have sane amounts
of interfaces, an O(N) should be affordable.

[1] 7a974a649848 bpf: Make dead_bpf_if const

Fixes:		16d878cc99ef Fix the following bpf(4) race condition ...
MFC after:	4 days
Differential Revision:	https://reviews.freebsd.org/D45725

(cherry picked from commit 7def047a1ae93b3b10bd57ed1bd28e861f94b596)
2025-02-18 09:51:04 +01:00
Kevin Bowling
2eba2832e9 ixgbe: Add ixgbe_dev_from_hw() back
This got lost many years ago in 8eb6488ebb0dcd92517625e4833ddf7d26e3b3a3

It is used by the driver's DBG printfs.

(cherry picked from commit bf6f0db8a762966b08430692c92ae34e667948db)
2025-02-18 09:50:11 +01:00
Kristof Provost
1a58aadf5d if_ovpn: fix module load in NOINET6 kernels
PR:		284459
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-02-18 09:49:56 +01:00
Kristof Provost
cc316253c6 pf: send ICMP destination unreachable fragmentation needed when appropriate
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D48805
Targeted-backport-for-stable/14-by: franco@opnsense.org
25.1.1
2025-02-05 11:21:18 +01:00
Kristof Provost
eb2415e79d pfil: set PFIL_FWD for IPv4 forwarding
Just like we already do for IPv6 set the PFIL_FWD flag when we're forwarding
IPv4 traffic. This allows firewalls to make more precise decisions.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D48824
2025-02-05 11:21:18 +01:00
Zhenlei Huang
65e2d9d506 if_vxlan(4): Use static initializers
MFC after:	1 week

(cherry picked from commit 5e0dbbc238e2e935c68e293314a90f2ce6e6ef16)
2025-02-05 10:09:30 +01:00
Zhenlei Huang
a00bfe0fa7 vnet: Fix style nits
MFC after:	3 days

(cherry picked from commit 903c7cdac5b5b4b720aba7a48abffb48b2588c77)
2025-02-05 10:09:09 +01:00
Zhenlei Huang
3ff2763a72 if_vxlan(4): Prefer SYSCTL_INT over TUNABLE_INT
This driver does not need to retrieve those tunable during early boot.
Meanwhile SYSCTL_INT can provide rich info such as description.
Also `sysctl net.link.vxlan.[legacy_port|reuse_port]` can report the
current settings.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48621

(cherry picked from commit 92632371b360010709fad60146f1aee0b8b99776)
2025-02-05 10:08:57 +01:00
Alexander Ziaee
32153f610d bsdinstall/zfsboot: Remove unused global variable
In an AMA session on the FreeBSD Discord, it was revealed that no
logic remains calling GPART_BOOTCODE_PARTONLY. It was removed in
aa2a0e0fc311 for FreeBSD 12. git grep shows no other references.
No functional change intended.

MFC after:		2 weeks
Fixes:			aa2a0e0fc311 (Enable new UEFI+GELI support)
Reported by:		Antranig Vartanian <antranigv@freebsd.am>
Reviewed by:		emaste, mhorne
Approved by:		emaste, mhorne (src)
Approved by:		mhorne, carlavilla (mentors)
Differential Revision:	https://reviews.freebsd.org/D48086

(cherry picked from commit 347eb42dbcb352f3266e716a2101898fe054bdba)
2025-02-05 10:08:47 +01:00
Mark Johnston
1a2a481caf pf: Force logging if pf_create_state() fails
Currently packets are logged before pf_create_state() is called, so we
might log a packet as passed that is subsequently dropped due to state
creation failure.  In particular, the drop is not logged, which is
wrong.

Improve the situation a bit: force logging if state creation fails.
This isn't totally right as we'll end up logging the packet twice in
this case, but it's better than not logging the drop at all.

Add a regression test.

Discussed with:	kp, ks
Co-authored-by:	Franco Fichtner <franco@opnsense.org>
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	OPNsense
Differential Revision:	https://reviews.freebsd.org/D47953

(cherry picked from commit 886396f1b1a727c642071965612e2c2c9dd11d6c)
2025-02-05 10:08:37 +01:00
Mark Johnston
7c445da3ba Add UPDATING entries and bump version
Approved by:	so
2025-01-30 07:25:28 +01:00
Mark Johnston
8f742ba84e etcupdate: Restrict access to the conflicts directory
In the window during conflict resolution, copies of installed files with
conflicts are added here with the default mode.  Restrict access.

Approved by:	so
Security:	FreeBSD-SA-25:03.etcupdate
PR:		277470
Reviewed by:	philip, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D48576

(cherry picked from commit c43ae7ab4bf89c2b274c1cbefe663c456e9211d1)
(cherry picked from commit 93836ff92be84a1d4e7611577ffe116a0e30d008)
2025-01-30 07:25:26 +01:00
Rick Macklem
e4ac2362cc tarfs: Fix the size of struct tarfs_fid and add a static assert
File system specific *fid structures are copied into the generic
struct fid defined in sys/mount.h.
As such, they cannot be larger than struct fid.

This patch packs the structure and checks via a __Static_assert().

Approved by:	so
Security:	FreeBSD-SA-25:02.fs
Reviewed by:	markj
MFC after:	2 weeks

(cherry picked from commit 4db1b113b15158c7d134df83e7a7201cf46d459b)
(cherry picked from commit 155987e2019089a5bd2eef77ed7bcc5cc26c362e)
2025-01-30 07:25:25 +01:00
Rick Macklem
9192b514fa ext2fs: Fix the size of struct ufid and add a static assert
File system specific *fid structures are copied into the generic
struct fid defined in sys/mount.h.
As such, they cannot be larger than struct fid.

This patch packed the structure and checks via a __Static_assert().

Approved by:	so
Security:	FreeBSD-SA-25:02.fs
Reviewed by:	markj
MFC after:	2 weeks

(cherry picked from commit bfc8e3308bee23d0f7836d57f32ed8d47da02627)
(cherry picked from commit 7a3a0402aeb626a7379addd344cbfd8900e83baa)
2025-01-30 07:25:24 +01:00
Mark Johnston
519748f4ab cd9660: Make sure that struct ifid fits in generic filehandle structure
File system specific *fid structures are copied into the generic
struct fid defined in sys/mount.h.
As such, they cannot be larger than struct fid.

This patch packs the structure and checks via a __Static_assert().

Approved by:	so
Security:	FreeBSD-SA-25:02.fs
Reported by:	Kevin Miller <mas@0x194.net>
Reviewed by:	olce, imp, kib, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47879

(cherry picked from commit 205659c43d87bd42c4a0819fde8f81e8ebba068e)
(cherry picked from commit 54974e731f279941ef7aebd7d30ba2e9299a4056)
2025-01-30 07:25:22 +01:00
Philip Paeps
23aedacb5e contrib/tzdata: import tzdata 2025a
Changes: https://github.com/eggert/tz/blob/2025a/NEWS

Approved by:	so
Security:	FreeBSD-EN-25:03.tzdata

(cherry picked from commit 46226b0162ba03986b1de2c790804b37dd8e64d6)
(cherry picked from commit a158d26e89f2e3274ba1064e3fd6b341c6fcb07c)
2025-01-30 07:25:21 +01:00
Mark Johnston
26312c233e audit: Fix short-circuiting in syscallenter()
syscallenter() has a slow path to handle syscall auditing and dtrace
syscall tracing.  It uses AUDIT_SYSCALL_ENTER() to check whether to take
the slow path, but this macro also has side effects: it writes the audit
log entry.  When systrace (dtrace syscall tracing) is enabled, this
would get short-circuited, and we end up not writing audit log entries.

Introduce a pure macro to check whether auditing is enabled, use it in
syscallenter() instead of AUDIT_SYSCALL_ENTER().

Approved by:	so
Security:	FreeBSD-EN-25:02.audit
Reviewed by:	kib
Reported by:	Joe Duin <jd@firexfly.com>
Fixes:		2f7292437d0c ("Merge audit and systrace checks")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D48448

(cherry picked from commit f78fe930854cac6eed55859b45e0a7b5d87189d6)
(cherry picked from commit 4b9ba274d736de74676051c8f13e7d3dd536334b)
2025-01-30 07:25:19 +01:00
Mark Johnston
3717a36932 ktrace: Fix uninitialized memory disclosure
The sockaddr passed to ktrcapfail() may be smaller than
sizeof(struct sockaddr), and the trailing bytes in the sockaddr
structure will be uninitialized, whereupon they get copied out to
userspace.

Approved by:	so
Security:	FreeBSD-SA-25:04.ktrace
PR:		283673
Reviewed by:	jfree, emaste
Reported by:	Yichen Chai <yichen.chai@gmail.com>
Reported by:	Zhuo Ying Jiang Li <zyj20@cl.cam.ac.uk>
Fixes:		9bec84131215 ("ktrace: Record detailed ECAPMODE violations")
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D48499

(cherry picked from commit 5b86888bae651e54ccc0adde0ed897ec1c1e0d45)
(cherry picked from commit 99d5ee8738a354e0d8f12453a82ed87e47bd62f1)
2025-01-30 07:25:17 +01:00
Kristof Provost
ebed92a975 netinet: enter epoch in garp_rexmit()
garp_rexmit() is a callback, so is not in net_epoch, which
arprequest_internal() expects.
Enter and exit the net_epoch.

PR:		284073
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 38fdcca05d09b4d5426a253d3c484f9481a73ac2)
2025-01-29 08:12:03 +01:00
Franco Fichtner
337c900438 bsdinstall: hook up help line and prompt for ZFS disk selection
Previously we were passing the wrong variable names for the prompt and
help line, so the intended action wasn't clear to the user.

Reviewed by:	jhb, markj
MFC after:	3 days
See also:	https://github.com/opnsense/installer/issues/22
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1579

(cherry picked from commit d726bc286325dd7093b83c6ebcbaa768c687d825)
2025-01-29 07:57:24 +01:00
Zhenlei Huang
65b8215cc3 if_vxlan(4): Invoke vxlan_stop event handler only when the interface is configured
It is harmless but pointless to invoke vxlan_stop event handler when the
interface was not previously configured. This change will also prevent
an assert panic from t4_vxlan_stop_handler().

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

(cherry picked from commit 960c5bb0f6bf44aeb09fa14fd0f82c2e82ebe2e2)
2025-01-29 07:57:15 +01:00
Igor Ostapenko
3615581372 kyua: Support is_exclusive metadata coming from an ATF test case
On ATF side it is named "is.exclusive".

Reviewed by:	ngie, markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D47671

(cherry picked from commit 2ed24e28d1d95c62cc37ca3534d4d33360b4cef2)
25.1
2025-01-27 10:54:06 +01:00
Zhenlei Huang
13a8e1ab49 pf: Convert PF_DEFAULT_TO_DROP into a vnet loader tunable 'net.pf.default_to_drop'
7f7ef494f11d introduced a compile time option PF_DEFAULT_TO_DROP to make
the pf(4) default rule to drop. While this change exposes a vnet loader
tunable 'net.pf.default_to_drop' so that users can change the default
rule without re-compiling the pf(4) module.

This change is similiar to that for IPFW [1].

1. 5f17ebf94db5 Convert IPFW_DEFAULT_TO_ACCEPT into a loader tunable 'net.inet.ip.fw.default_to_accept'

Reviewed by:	#network, kp
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D39866

(cherry picked from commit c531c1d1462c45f7ce5de4f9913226801f3073bd)
2025-01-27 10:53:56 +01:00
Andrey V. Elsukov
056bef09e1 ipfw: use only needed TCP flags for state tracking
This fixes stateful firewall failures after adding TH_AE flag
into TH_FLAGS.

Reported by:	ronald
Fixes:		347dd05

(cherry picked from commit 9ea8d692f4cb552902b9e8394260d7f3cf4aefb0)
2025-01-24 11:55:23 +01:00
Kristof Provost
9a175a2dc0 pf: avoid use-after-free on reassembly
Ensure we update the mbuf pointer returned by pf_normalize_ip() or
pf_normalize_ip6() even if they fail.
Otherwise we'd risk using a freed mbuf.

PR:             283705
Reported by:    Yichen Chai <yichen.chai@gmail.com>, Zhuo Ying Jiang Li <zyj20@cl.cam.ac.uk>
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 5d28f4cab8d5919aba1365e885a91a96c0655b59)
2025-01-24 11:55:04 +01:00
Kristof Provost
063f4fdfc9 carp: don't unintentionally revert to multicast mode
PR:		284140
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-01-24 11:54:30 +01:00
Mark Johnston
ced5abf15b netipsec: Pass the right mbuf up
Note that key_spdacquire() is dead code, as the SADB_X_SPDACQUIRE
message handler is not set.

PR:		243057
MFC after:	2 weeks

(cherry picked from commit 378a2b155aaf853933df5b53e174b3880826488c)
25.1.r1
2025-01-21 07:56:57 +01:00
Leonid Evdokimov
3de06e40f3 pf tests: check cleared time when zeroing stats for table addresses
Verify that we reset the cleared time when we zero an address' counters in
a table.

PR:		282877, 282984
Reviewed by:	kp
MFC after:	2 weeks
Signed-off-by:	Leonid Evdokimov <leon@darkk.net.ru>
Differential Revision:	https://reviews.freebsd.org/D48242

(cherry picked from commit 0749d8134300b8e3c956e161890ab496247d2542)
2025-01-16 19:18:17 +01:00
Mark Johnston
088e943958 bsdinstall: Fix a typo in a comment
PR:		283507
MFC after:	1 week

(cherry picked from commit 5bf3ac7ae219f126cf3965be97a2d718007c1be4)
2025-01-16 19:17:50 +01:00
Mark Johnston
ddb95d45fb p9fs: Use UNLINKAT instead of REMOVE to implement removals
REMOVE doesn't work properly in the face of hard links.  Use UNLINKAT
instead, which is implemented by qemu and bhyve and lets the client
specify the name being removed.

PR:		282432
Reviewed by:	dfr
Differential Revision:	https://reviews.freebsd.org/D47438
2025-01-10 10:30:34 +01:00
Mark Johnston
67998b35ea virtio_p9fs: Simplify vt9p_req_wait() a bit
Remove an always-false check for whether the request has already
completed before sleeping.  Even if the request is complete, the
response tag is updated while holding the channel lock, which is also
held here.

No functional change intended.

Sponsored by:	Klara, Inc.
2025-01-10 10:30:34 +01:00
Mark Johnston
347a2f813e virtio_p9fs: Check for completions after enabling interrupts
Otherwise we can end up with a lost interrupt, causing lost request
completion wakeups and hangs in the filesystem layer.

Continue processing until we enable interrupts and then observe an empty
queue, like other virtio drivers do.

Sponsored by:	Klara, Inc.
2025-01-10 10:30:34 +01:00
Mark Johnston
d6cd1fd7cf virtio_p9fs: Fix handling of a full request queue
If, when submitting a request, the virtqueue is full, we sleep until an
interrupt has fired, then restart the request.  However, while sleeping
the channel lock is dropped, and in the meantime another thread may have
reset the per-channel SG list, so upon retrying we'd (re)submit whatever
happened to be left over in the previous request.

Fix the problem by rebuilding the SG list after sleeping.

Sponsored by:	Klara, Inc.
2025-01-10 10:30:34 +01:00
Mark Johnston
b9e54539c9 virtio_p9fs: Fix some style issues
- Remove superfluous newlines.
- Use bool literals.
- Replace an unneeded SYSINIT with static initialization.

No functional change intended.

Sponsored by:	Klara, Inc.
2025-01-10 10:30:33 +01:00
Mark Johnston
5e7c6fe162 p9fs: Fix whitespace in request tag handling functions
No functional change intended.

Sponsored by:	Klara, Inc.
2025-01-10 10:30:33 +01:00
Bakul Shah
ee2ca2b0f6 p9fs: Properly handle paths containing "."
Fixes:	56e4622588ed ("p9fs: fix lookup of "." for lib9p-based 9P servers")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1361
2025-01-10 10:30:33 +01:00
Danilo Egea Gondolfo
26c1080d17 p9fs: remove duplicated code
This code is using the vnode after it has been released and causing a
panic when a p9fs shared volume is unmounted. In fact, it seems like it's
just duplicated code left behind from a bad merge.

PR:		279887
Reported by:	Michael Dexter

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1323
2025-01-10 10:30:33 +01:00
Danilo Egea Gondolfo
86b50bd3dc virtio_p9fs: fix panic on qemu/kvm
When the module is loaded on a system running on qemu/kvm the "modern"
virtio infrastructure is used and virtio_read_device_config() will end
up calling vtpci_modern_read_dev_config(). This function cannot read
values of arbitrary sizes and will panic if the p9fs mount tag size is
not supported by it.

Use virtio_read_device_config_array() instead. It was tested on both
bhyve and qemu/kvm.

PR: 280098
Co-authored-by: Mark Peek <mp@FreeBSD.org>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1320
2025-01-10 10:30:33 +01:00
Ed Maste
48dc58f307 p9fs: use M_WAITOK where appropriate
device_attach routines are allowed to sleep, and this routine already
has other M_WAITOK allocations.

Reported by:	markj
Reviewed by:	markj
Fixes: 1efd69f933b6 ("p9fs: move NULL check immediately after alloc...")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45721
2025-01-10 10:30:33 +01:00
Ed Maste
b7f98eec8d p9fs: move NULL check immediately after allocation
Reported by:	Shawn Webb (HardenedBSD)
Reviewed by:	dfr
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45719
2025-01-10 10:30:32 +01:00
Val Packett
c6aa6a1af4 p9fs: implement working putpages (fix mmap write)
Mostly copied from smbfs. This driver in its current state has the exact
same issue that prevents the generic putpages implementation from
working.

Sponsored by:		https://www.patreon.com/valpackett
Reviewed by:		dfr
Differential Revision:	https://reviews.freebsd.org/D45639
MFC after:		3 months
2025-01-10 10:30:32 +01:00
Doug Rabson
dac7723907 p9fs: fix lookup of "." for lib9p-based 9P servers
The lib9p implementation takes a strict interpretation of the Twalk RPC
call and returns an error for attempts to lookup ".".  The workaround is
to fake the lookup locally.

Reviewed by: Val Packett <val@packett.cool>
MFC after: 3 months
2025-01-10 10:30:32 +01:00
Doug Rabson
5d1fb5a9c9 p9fs: Fix the build for 32-bit kernels
MFC after: 3 months
2025-01-10 10:30:32 +01:00
Doug Rabson
4aa850d6cb Add an implementation of the 9P filesystem
This is derived from swills@ fork of the Juniper virtfs with many
changes by me including bug fixes, style improvements, clearer layering
and more consistent logging. The filesystem is renamed to p9fs to better
reflect its function and to prevent possible future confusion with
virtio-fs.

Several updates and fixes from Juniper have been integrated into this
version by Val Packett and these contributions along with the original
Juniper authors are credited below.

To use this with bhyve, add 'virtio_p9fs_load=YES' to loader.conf. The
bhyve virtio-9p device allows access from the guest to files on the host
by mapping a 'sharename' to a host path. It is possible to use p9fs as a
root filesystem by adding this to /boot/loader.conf:

	vfs.root.mountfrom="p9fs:sharename"

for non-root filesystems add something like this to /etc/fstab:

	sharename /mnt p9fs rw 0 0

In both examples, substitute the share name used on the bhyve command
line.

The 9P filesystem protocol relies on stateful file opens which map
protocol-level FIDs to host file descriptors. The FreeBSD vnode
interface doesn't really support this and we use heuristics to guess the
right FID to use for file operations.  This can be confused by privilege
lowering and does not guarantee that the FID created for a given file
open is always used for file operations, even if the calling process is
using the file descriptor from the original open call. Improving this
would involve changes to the vnode interface which is out-of-scope for
this import.

Differential Revision: https://reviews.freebsd.org/D41844
Reviewed by: kib, emaste, dch
MFC after: 3 months
Co-authored-by: Val Packett <val@packett.cool>
Co-authored-by: Ka Ho Ng <kahon@juniper.net>
Co-authored-by: joyu <joyul@juniper.net>
Co-authored-by: Kumara Babu Narayanaswamy <bkumara@juniper.net>
2025-01-10 10:30:32 +01:00
Alexander V. Chernikov
0fe3f92ab0 Fix failure to add an interface prefix route when route with the same
prefix is already presented in the routing table.

PR:		277125
Reported by:	Oleksandr Ignatyev <alex@i.org.ua>
Reviewed by:	ae, jlduran
Tested by:	jlduran
Differential Revision: https://reviews.freebsd.org/D47534
MFC after:	2 weeks
2025-01-08 08:49:26 +01:00
Kajetan Staszkiewicz
815070d457 pf: Set cleared time when zeroing stats for table addresses
Reviewed by:		kp
Approved by:		kp (mentor)
Sponsored by:		InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D47697

(cherry picked from commit 1a5dc6ee62b316b0caad5118dc0f3aee036f1958)
2025-01-08 08:44:01 +01:00