Commit Graph

308225 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav d0afead876 cd9660: Add length checks to Rock Ridge parser
* cd9660_rrip_slink() did not check that the lengths of individual
  entries do not exceed the length of the overall record.

* cd9660_rrip_altname() did not check that the length of the record
  was at least 5 before subtracting 5 from it.

Note that in both cases, a better solution would be to check the length
of the data before calling the handler, or immediately upon entry of
the handler, but this would require significant refactoring.

MFC after:	1 week
Reported by:	Calif.io in collaboration with Claude and Anthropic Research
Reported by:	Adam Crosser, Praetorian
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56215
2026-04-01 19:14:48 +02:00
Pouria Mousavizadeh Tehrani 759d8a13a3 route(8): Show weight of nexthop in multipath routes
Reviewed by: zlei, markj
Differential Revision: https://reviews.freebsd.org/D56202
2026-04-01 19:26:19 +03:30
Jean-Sébastien Pédron 5bb0f63020 linuxkpi: Handle bin attributes in sysfs attribute groups
For instance, this is used by DRM drivers to declare the EDID property
of an GPU output connector:

    sysctl -b sys.device.drmn1.card0.card0-DP-1.edid | edid-decode

    ...
    Block 0, Base EDID:
      EDID Structure Version & Revision: 1.4
      Vendor & Product Identification:
        Manufacturer: SAM
        Model: 29814
        Serial Number: 810635354 (0x3051505a)
        Made in: week 15 of 2025
    ...

Reviewed by:	bz, emaste, wulf
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55176
2026-04-01 11:10:12 -04:00
Mark Johnston 607f6be6ec rtadvd: Fix validation of the MTU parameter when parsing config
MFC after:	1 week
2026-04-01 08:19:35 -04:00
Aymeric Wibo 683f7a8374 acpi_spmc: Call new MS turn on display DSM
Microsoft added a new function index (turn on display, 9) to their DSM
set. This revision calls this, which fixes S0ix on certain machines,
such as the Lenovo Yoga Slim 7i Aura, who's ECs use this method as a
trigger to restore power to certain devices.

See commit 229ecbaac6b3 ("ACPI: x86: s2idle: Invoke Microsoft _DSM
Function 9 (Turn On Display)") on Linux.

Also see the following:
https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-firmware-notifications#turn-on-display-notification-function-9

Reviewed by:	olce
Approved by:	olce
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D56062
2026-04-01 19:56:04 +08:00
Aymeric Wibo 0307db7744 acpi_spmc: Fail probe if acpi_spmc device already attached
We cannot have more than one SPMC device.

Reviewed by:	olce
Approved by:	olce
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D56062
2026-04-01 19:54:58 +08:00
Mark Johnston 0dbbed21a6 ip6_mroute: Fix the type name in sysctl_mfctable()
No functional change since apparently it's fine to compute the size of
a pointer type when the base type is undefined.

Fixes:	0bb9c2b665 ("ip6_mroute: FIBify")
2026-04-01 07:16:15 -04:00
Mark Johnston f3c772361f vmm: Restore the ability to create VMs as root in a jail
The new PRIV_VMM_CREATE and DESTROY permissions should be allowed by
jails, so need to be added to the list in prison_priv_check().  Then,
modify vmmdev_create() to verify that the jail was created with the
allow.vmm flag.  This is already verified when opening /dev/vmmctl, but
checking again doesn't hurt and ensures that one can't pass the
allow.vmm policy by passing a vmmctl fd along a unix domain socket from
outside the jail.

Rename vmm_priv_check() to vmm_jail_priv_check() to make the function's
purpose more clear.

Reported by:	novel
Reviewed by:	bnovkov
Fixes:		d4c05edd41 ("vmm: Add privilege checks to vmmctl operations")
Differential Revision:	https://reviews.freebsd.org/D56119
2026-04-01 07:16:14 -04:00
Mark Johnston c6a1c1260f pmap: Do not use PMAP_LOCK_INIT with kernel_pmap
The kernel_pmap lock is a bit special: it does not need the DUPOK flag,
and it really belongs to a different lock class.  If it belongs to the
same class as regular pmap locks, then witness may report warnings when
performing UMA allocations under a regular pmap lock, if the allocation
triggers a pmap_growkernel() call.

Replace instances of PMAP_LOCK_INIT(kernel_pmap) with inline mtx_init()
calls to silence some witness warnings for harmless behaviour I see with
some uncommitted test programs.

Reviewed by:	alc, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D56185
2026-04-01 07:15:42 -04:00
Philip Paeps f5b5e29279 Vendor import of expat 2.7.5 2026-04-01 16:49:18 +08:00
Weixie Cui f3b59bf285 bce: Fix SYSCTL_IN error check in bce_sysctl_nvram_write()
The condition after SYSCTL_IN was inverted: success (error == 0) returned
immediately and skipped the NVRAM write path, while failure fell through.
Return only when SYSCTL_IN fails.

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2113
2026-04-01 00:29:46 -07:00
Xin LI f81c1f4339 MFV: xz 5.8.3.
Security:	CVE-2026-34743
MFC after:	3 days
2026-03-31 18:45:14 -07:00
Xin LI 788f701923 Vendor import of xz 5.8.3 (trimmed) 2026-03-31 18:35:39 -07:00
Mitchell Horne be79a42275 malloc.9: adjust flag table indentation
The current indentation is shorter than all but one of these flags. This
renders much more nicely.

MFC after:	3 days
2026-03-31 16:55:37 -03:00
Tetsuya Uemura 84c68dbb59 bcm2835_virtgpio: Add driver for virtual GPIO controller on some RPi models
This driver enables bcm2835-virtgpio GPIO controller found on RPi3B and
some CM boards. On which, the ACT (green) LED is connected to this
controller. It is essential for FreeBSD to have this driver to control
this LED.

It will be exposed via gpioled(4).

Reviewed by:	mhorne
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D51456
2026-03-31 16:54:21 -03:00
Alexander Leidinger 6087050ef5 Jail sysctls: deprecate generic sysctls in favour of allow-flags
- add a missing sysctl to the deprecated list
- add a comment to not add new generic sysctls and point to SYSCTL_JAIL_PARAM instead

Reviewed by:	jamie
Differential Revision:	https://reviews.freebsd.org/D51150
2026-03-31 19:23:26 +02:00
Ed Maste 9b1f77e647 Makefile.inc1: Drop AS and RANLIB variables
These are not used in our world and kernel build targets.  We use the
compiler driver for assembly, and ar adds the archive index (symbol
table) automatically.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55964
2026-03-31 13:18:32 -04:00
Artem Bunichev c082e56564 _exit.2: Cross-reference atexit(3)
atexit(3) is one of the cases when _exit(2) must be used instead of
exit(3).

MFC after:		3 days
Reviewed by:		mhorne, ziaee
Differential Revision:	https://reviews.freebsd.org/D54467
2026-03-31 13:13:02 -04:00
Gleb Smirnoff 407b1e4980 rss: make toeplitz.c standard part of the kernel
This will fix LINT-NOIP build.  This actually adds very little to the
kernel text, e.g. 500 bytes on amd64.  A perfect solution would be to
instead declare rss_config.c as 'optional inet | inet6', but that would
fail to build LINT-NOIP in several NIC drivers, that use RSS and
absolutely ignore that both INET and INET6 are optional.  It is very
unlikely that vendors who maintain these drivers will will ever chase the
holy grail of a build that doesn't support IPv4 and IPv6.

Fixes:	d9c55b2e8c
2026-03-31 09:34:51 -07:00
Aymeric Wibo 33e095ee09 acpi_spmc: Improve device description
"Low Power S0 Idle" doesn't mean that much. "System Power Management
Controller" is what "SPMC" stands for in the first place.

Sponsored by:	The FreeBSD Foundation
2026-03-31 18:01:10 +08:00
Aymeric Wibo 69124109c5 amdsmu: Cezanne support
Add support for Cezanne chips.  The only real difference vs
Rembrandt/Phoenix is the idlemask register.

Also simplify getting IP block count by having this straight in struct
amdsmu_product and remove Strix Point from the list for now, as that
doesn't support S0ix and our driver can't handle that.

Reviewed by:	mckusick
Approved by:	mckusick
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D55594
2026-03-31 12:48:59 +08:00
Christos Longros 59cb18f356 vmgenc.4: Add VM Generation ID Counter manual
Document the vmgenc(4) ACPI driver which detects virtual machine
cloning and snapshot restoration via the VM Generation ID
specification. The driver reseeds the kernel entropy pool when
a generation change is detected.

MFC after:		3 days
Reviewed by:		cem (previous), ziaee
Signed-off-by:		Christos Longros <chris.longros@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D56011
2026-03-30 22:31:43 -04:00
Konstantin Belousov d15733065c msun: remove requirement to have C99 inline semantic
The 'extern inline' usage is removed.

PR:     277958
Reviewed by:	dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:	https://reviews.freebsd.org/D56139
2026-03-30 19:57:01 +03:00
Konstantin Belousov 70674434e2 msun/arm: convert fenv functions to proper linkage
namely
	fegetexceptflag(3)
	fesetexceptflag(3)
	feraiseexcept(3)
	fetestexcept(3)
	fegetround(3)
	fesetround(3)
	fegetenv(3)
	feholdexcept(3)
	fesetenv(3)
	feupdateenv(3)
	feenableexcept(3)
	fedisableexcept(3)
	fegetexcept(3)

PR:     277958
Reviewed by:	dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:	https://reviews.freebsd.org/D56139
2026-03-30 19:57:01 +03:00
Konstantin Belousov e4505a58a7 msun/powerpc: convert fenv functions to proper linkage
namely
	fegetexceptflag(3)
	fesetexceptflag(3)
	feraiseexcept(3)
	fetestexcept(3)
	fegetround(3)
	fesetround(3)
	fegetenv(3)
	feholdexcept(3)
	fesetenv(3)
	feupdateenv(3)
	feenableexcept(3)
	fedisableexcept(3)
	fegetexcept(3)

PR:     277958
Reviewed by:	dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:	https://reviews.freebsd.org/D56139
2026-03-30 19:57:01 +03:00
Konstantin Belousov 6b89f5360f msun/riscv: convert fenv functions to proper linkage
namely
	fegetexceptflag(3)
	fesetexceptflag(3)
	feraiseexcept(3)
	fetestexcept(3)
	fegetround(3)
	fesetround(3)
	fegetenv(3)
	feholdexcept(3)
	fesetenv(3)
	feupdateenv(3)
	feenableexcept(3)
	fedisableexcept(3)
	fegetexcept(3)

PR:     277958
Reviewed by:	dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:	https://reviews.freebsd.org/D56139
2026-03-30 19:57:01 +03:00
Konstantin Belousov 3a01e1e1a5 msun/aarch64: convert fenv functions to proper linkage
namely
	fegetexceptflag(3)
	fesetexceptflag(3)
	feraiseexcept(3)
	fetestexcept(3)
	fegetround(3)
	fesetround(3)
	fegetenv(3)
	feholdexcept(3)
	fesetenv(3)
	feupdateenv(3)
	feenableexcept(3)
	fedisableexcept(3)
	fegetexcept(3)

PR:	277958
Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56139
2026-03-30 19:57:00 +03:00
Konstantin Belousov 5bc64b7d41 msun/x86: convert rest of the extern inline fenv functions to proper linkage
namely
	fegetexceptflag(3)
	fetestexcept(3)
	fesetround(3)
	fegetround(3)
	fesetenv(3)
Same as it was done in f39754d51b for feclearexcept(3).

PR:	277958
Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56139
2026-03-30 19:57:00 +03:00
Konstantin Belousov 7cfffe25da rtld: check for overflow in parse_integer()
Reviewed by:	dim, emaste, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56151
2026-03-30 19:56:52 +03:00
Mark Johnston a1c042a964 ip6_mroute: Handle interface detach events
When an interface goes away we need to make sure the v6 multicast
routing tables don't carry any dangling references to the ifnet.  The v4
code handles this already.  Copy the approach there and use an
eventhandler to purge the corresponding MIF, if one exists, and further
go through all routes in the FIB and remove references to the interface.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55246
2026-03-30 16:08:21 +00:00
Mark Johnston 82272cbf56 ip6_mroute: Pass the multicast interface number directly to del_m6if()
There's no need to pass a pointer to the interface number.  No
functional change intended.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55245
2026-03-30 16:08:21 +00:00
Mark Johnston 09e702ad40 tests: Add some simple regression tests for ip_mroute
These use atf_python to create a number of hosts linked to a router.
The router runs pimd (for IPv4) or ip6_mrouter (simplistic IPv6
multicast router that I wrote since I couldn't find one in the ports
tree).  The vnet_host*_handler() methods are invoked in different VNET
jails connected to the router; they register the connected epair with a
multicast group and verify that they can send messages to each other.

The tests are synchronized by sending messages over a unix domain
socket.  The flow is something like:
1) test startup_method() is called, the unix socket is created,
2) the superclass creates jails and links them together using the
   declared topology,
3) we wait for all child jails to start up and send a message on the
   unix socket indicating that they are ready
4) we start the routing daemon in the main jail,
5) the test actually starts; starttest() kicks off the
   vnet_host*_handlers(), which mostly just verify that they can send
   messages to each other using multicast packets
6) once they finish running, they signal their completion, and
   waittest() returns once they're all done

There are two tests, repeated for v4 and v6.  One just exchanges packets
between two hosts, and the other has four hosts divided across two FIBs.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55244
2026-03-30 16:08:21 +00:00
Mark Johnston d4339cebbe ip6_mroute: Make ip6_mroute.h more self-contained
MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55243
2026-03-30 16:08:21 +00:00
Mark Johnston 0bb9c2b665 ip6_mroute: FIBify
Modify the control plane (ioctl and socket option handlers) to use the
routing socket FIB to index into the mfctable array.  Modify the
forwarding plane to use the mbuf's FIB to determine which routing table
to use.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55242
2026-03-30 16:08:21 +00:00
Mark Johnston 4c486fe402 ip_mroute: FIBify
Modify the control plane (ioctl and socket option handlers) to use the
routing socket FIB to index into the mfctable array.  Modify the
forwarding plane to use the mbuf's FIB to determine which routing table
to use.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55241
2026-03-30 16:08:21 +00:00
Mark Johnston 97a4bc9a0d ip(6)_mroute: Grow the routing tables when the number of FIBs changes
Use the new rtnumfibs_change event to expand the mfctable array when the
number of FIBs increases.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55240
2026-03-30 16:08:21 +00:00
Mark Johnston 81dbacbb7d net/route: Add an eventhandler for rt_numfibs changes
The multicast routing code will start implementing per-FIB routing
tables.  As a part of this, it needs to be notified when the number of
FIBs changes, so that it can expand its tables.

Add an eventhandler for this purpose.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55239
2026-03-30 16:08:20 +00:00
Mark Johnston a223d6c489 ip6_mroute: Start putting global variables into a structure
As in the IPv4 version of this change, I added a struct mf6ctable
structure which holds all global routing table state, soon to become
per-FIB state.

Note that much of the v6 multicast routing code was not VNETified; this
change fixes that too.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55238
2026-03-30 16:08:20 +00:00
Mark Johnston d50d0c002b ip_mroute: Start moving globals into a structure
I would like to support per-FIB multicast routing tables, such that one
can run a routing daemon per-FIB, with each daemon oblivious to the
existence of others.  Currently the multicast routing code is completely
unaware of FIBs.

To that end, start collecting various global variables in ip_mroute.c
into a per-VNET struct mfctable.  In a future patch this will be
expanded into an array of mfctable structures, one per FIB.  For now,
all of the state is collected into V_mfctables[0].

Each mfctable contains, among other things:
- a pointer to the routing socket, if routing is enabled,
- a hash table of routing cache entries,
- an table of network interfaces participating in the routing
  configuration

This change has no functional effect, it is just factoring out these
global variables to make the subsequent patches simpler.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55237
2026-03-30 16:08:20 +00:00
Zhenlei Huang ee9456ce37 ifnet: Fix races in if_vmove_reclaim()
The thread running if_vmove_reclaim() may race with other threads those
running if_detach(), if_vmove_loan() or if_vmove_reclaim(). In case the
current thread loses race, two issues arise,

 1. It is unstable and unsafe to access ifp->if_vnet,
 2. The interface is removed from "active" list, hence if_unlink_ifnet()
    can fail.

For the first case, check against source prison's vnet instead, given
the interface is obtained from that vnet.

For the second one, return ENODEV to indicate the interface was on the
list but the current thread loses race, to distinguish from ENXIO, which
means the interface or child prison is not found. This is the same with
if_vmove_loan().

Reviewed by:	kp, pouria
Fixes:		a779388f8b if: Protect V_ifnet in vnet_if_return()
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D55997
2026-03-31 00:00:01 +08:00
Gleb Popov 0f147784de stat(2): Send to sticky(7) in the S_ISVTX description
Approved by: ziaee
Differential Revision: https://reviews.freebsd.org/D56015
2026-03-30 17:46:38 +03:00
Christos Margiolis 0efd333825 snd_uaudio: Retire sndcard_func usage
This is effectively a no-op, as it does not make use of the
sndcard_func->varinfo field, so eventually ua_probe() always succeeds.

Also change ua_probe()'s value to 0. There is no need to return
BUS_PROBE_DEFAULT, because snd_uaudio() attaches the sound(4)'s children
with bus_attach_children().

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56160
2026-03-30 16:13:16 +02:00
Dag-Erling Smørgrav 40e8afadc3 pkgbase: Move all of Kyua into the kyua package
Some Kyua directories were improperly tagged as belonging to the tests
package.  Move them to the kyua package, which contains all of the
files found in these directories.

PR:		294129
MFC after:	1 week
Reviewed by:	ivy, emaste
Differential Revision:	https://reviews.freebsd.org/D56159
2026-03-30 16:03:29 +02:00
Dag-Erling Smørgrav 0a6dbf51d8 pkgbase: Move all of ATF into the atf package
Parts of ATF (including the licence and some of the documentation) were
for some reason part of the tests package instead of the atf package.
Moving them to where they logically belong poses no problem since tests
already depends on atf.

PR:		294129
MFC after:	1 week
Reviewed by:	ivy
Differential Revision:	https://reviews.freebsd.org/D56158
2026-03-30 16:03:29 +02:00
John Baldwin cc2715cf1f acpi_apm: Narrow scope of ACPI_LOCK
This lock doesn't need to be held across seldrain/knlist_destroy.  It
is also redundant (and a bug) to hold it across knlist_add and
knlist_remove since it is the mutex for the knlist.

PR:		293901
Reported by:	Jiaming Zhang <r772577952@gmail.com>
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D55994
2026-03-30 09:41:06 -04:00
Olivier Certner e220af9cee nvme_sim: Fix name in module version metadata
MFC after:      1 week
Fixes:          1e39b5d483 ("nvme_sim: Attach as a child of nvme")
Sponsored by:   The FreeBSD Foundation
2026-03-30 11:24:34 +02:00
Olivier Certner 4deb934c1a vfs: Simplify vfs_write_resume()/vn_start_write_refed()
The call to vn_start_write_refed() from vfs_write_resume() with
'mplocked' set to 'true' exactly boils down to doing an increment of
'mnt_writeopcount', albeit with lots of unnecessary verifications.

Replace it with an inline incrementation.  As the original call was the
last with 'mplocked' with 'true', remove the 'mplocked' parameter from
vfs_write_resume(), simplifying its code accordingly ('mplocked' always
false).

While here, in vfs_write_resume(), initialize 'error' out of the mount
lock.

Reviewed by:    kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56108
2026-03-30 11:24:23 +02:00
ShengYi Hung e6eba50769 vmm: Add missing AVX instructions for AVX512 in cpuid stdext
Reported by:    Tom <freebsd@fizz.buzz>
Reviewed by:    markj
Tested by:      Tom <freebsd@fizz.buzz>
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56021
2026-03-30 15:19:44 +08:00
Bjoern A. Zeeb e8166d7f37 LinuxKPI wlan drivers: update makefiles to not use WITH_
Up to now the LinuxKPI wlan drivers were using local variables starting
with a WITH_ prefix in their Makefiles.
That is likely to collide with other mechanisms like WITH_ and WITHOUT_
from src.conf.
Adjust the local variables to use a driver name prefix for now to control
what is built and what is not.
These variables are mainly for the time of development so we can
turn off/on a feature or bus attachment while working on it.  Otherwise
they are there for documentation purposes.  The only reason one would
change them locally would be if someone was to build a very custom
image and not want certain bits (e.g., USB support) being compiled into
the modules.

While here, try to harmonize some parts of the Makefiles.

Suggested by:	imp
Discussed with:	imp
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D55977
2026-03-30 03:53:51 +00:00
Rick Macklem b5815ee99a nfs_nfsdsocket.c: Allow Copy/Clone from a read-only fs
For some server file system types, such as ZFS, a Copy/Clone
operation can be done across file systems of the same file
system type.

However, without this patch, the Copy/Clone will fail with
EROFS if the input file is on a read-only mounted file system.
This happens because Copy/Clone will try to do a VOP_SETATTR()
of atime to set the atime.

This patch pretends the VOP_SETATTR() of atime worked for
read-only file systems.  It fixes a problem when copying
files from a ZFS snapshot.

PR:	294010
MFC after:	2 weeks
2026-03-29 14:41:36 -07:00