fusefs: proofread an error message in the tests
Reported by: otis
Fixes: 2c1482e3053 ("fusefs: fix a race in the pre-init tests")
Sponsored by: ConnectWise
(cherry picked from commit 381ebe25f0b9fae5b3470e9c6e0767909e0fa85a)
fusefs: fix a race in the pre-init tests
These tests allow the user to customize the INIT response. But it's
necessary to block the daemon's service loop from running until those
expectations have been set. This race has never caused failures before
simply due to luck. But now it's failing on slower platforms.
PR: 296236
Reported by: siva
Sponsored by: ConnectWise
Reviewed by: siva
Differential Revision: https://reviews.freebsd.org/D57781
(cherry picked from commit 2c1482e305368af182a7bde0e53d0d180b319326)
fusefs: only search for FREAD fufh in readdir
The extra search for an FEXEC fufh shall be removed, since readdir
is only supposed to be called on a directory opened with FREAD. The
sole exception is NFS, which will call VOP_READDIR with directories that
aren't open at all. fuse already has special code to handle that.
Also remove the fuse_filehandle_get_dir() function, since it's not
used anywhere else.
Signed-off-by: CismonX <admin at cismon.net>
Reviewed by: asomers
Pull Request: https://github.com/freebsd/freebsd-src/pull/1729
(cherry picked from commit 4179f1d9deed83977f159c8afea204293ef4c7d7)
fusefs: fix error handling when reading a directory's sticky bit
When trying to delete or rename a file, fuse_vnop_lookup must check
whether its parent directory's sticky bit is set. Realistically, the
parent directory's attributes will almost always be cached. But it's
possible that they won't be, and in that case we must send a new
FUSE_GETATTR request to the server. If that request fails for some
reason, then we must fail the lookup. Prior to this change fusefs would
ignore failure of that request.
Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
and Ke Xu of Tsinghua University
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D57588
(cherry picked from commit b4af6a4cccc3b4b0ea461463196c258eb92ad2e5)
bhyve: allow overriding snapshot socket directory
By default bhyve(8) creates a snapshot socket in
"/var/run/bhyve/" (BHYVE_RUN_DIR).
As this is a system directory not writable by users,
this does not work when bhyve(8) is being started
as a non-root user.
Address that by allowing to override this directory.
In bhyve(8) it is done by setting 'rundir' option
with '-o rundir=<path>'.
In bhyvectl(8) it is done with '--rundir=<path>'.
MFC after: 1 month
Reviewed by: bcr (manpages), bnovkov
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57494
Regen syscalls tables.
This catches up with 692b0ef1506ba which added CAPENABLED to
clock_nanosleep(). Curiously recent additions of the pdopenpid(2) and
pddupfd(2) were done before the cited commit, and that regen did not
included the change.
Sponsored by: The FreeBSD Foundation
linuxkpi: Add pm_runtime_resume_and_get
pm_runtime_resume_and_get is used by new versions of amdgpu, and began
use between Linux kernel version 6.12, and 6.14.
Reviewed by: dumbbell
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57463
lagg: re-check port caps after bringing up a port
Some nic drivers (including iflib) do not initialize if_hwassist
until after the interface is brought up. If a lagg member is included
in a lagg when its not yet been brought up, that will cause lagg to see
if_hwassist=0 and will disable all checksum offload, etc, on the interface.
This is almost impossible to debug without kgdb or dtrace, as ifconfig does
not surface if_hwassist.
Fix this by re-calculating lagg caps (including if_hwassist) after adding a port.
I encountered this problem when I had a commented-out if_foo1=up entry in
my rc.conf that i neglected to uncomment when I was re-configuring a lagg.
Sponsored by: Netflix
Reviewed by: markj, zlei
Differential Revision: https://reviews.freebsd.org/D58062
if_epair: support IFCAP_MEXTPG
Enable IFCAP_MEXTPG by default, which may bring performance benefits.
Allow it to be disabled, and when disabled assert that we do not receive
any mbufs with M_EXTPG set. This is useful for testing.
Default the tests to disabling MEXTPG support.
Reviewed by: zlei
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D58054
pf: fix a crash on sendfile()
The network layer must not pass unmapped (M_EXTPG) mbufs to if_output()
of network interfaces without IFCAP_MEXTPG. pf should convert these
mbufs by mb_unmapped_to_ext() for such interfaces but it didn't.
The problem had occurred on sendfile because sendfile system call
uses unmapped mbufs for the file data.
Reported by: feld
Reviewed by: kp, glebius
Differential Revision: https://reviews.freebsd.org/D58021
tests/sendfile_helper: support remote connection
In order to use the sendfile_helper program in a pf test script that
requires non-loopback interfaces, add functionality to sendfile with a
TCP socket that is connected to a remote host.
The behavior for unix sockets and TCP loopback sockets is unchanged.
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D58041
tests/sendfile: move the helper program to common
In order to reuse the sendfile_helper program in pf tests, move it
to tests/sys/common directory, indicatint that it is also used from
another places than sys/kern.
Also make the readlen variable static.
Reviewed by: gelbius, kp
Differential Revision: https://reviews.freebsd.org/D58040
fwcam: set ISO speed from device link speed
iso_speed was never initialized, defaulting to S100 regardless of the
camera's actual link speed. Some cameras firmwares reject ISO_EN
when the speed field in the ISO_CHANNEL register
does not match their capabilities.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D58091
fwcam: write video mode registers before enabling ISO streaming
The IIDC spec (s3.1) requires the video mode to be programmed before ISO
enable. Without this, cameras that power up with invalid default
mode/rate combinations reject the ISO_EN write.
This can happen when the firmware of teh camera is outdated or
vendor never updated it.
Differential Revision: https://reviews.freebsd.org/D58092
fwcamctl: add control utility for fwcam(4) IIDC FireWire cameras
fwcamctl provides userland access to /dev/fwcam0. Supported
subcommands: info (camera state, format, mode, rate, features),
snap (capture a frame as PPM), mode (set format/mode/rate), and
feat (get/set camera feature registers).
snap converts YUV422, YUV411, YUV444, RGB8, and Mono8 pixel
formats to RGB24 PPM with no external dependencies. A configurable
frame skip (default 5) allows auto-exposure and auto-white-balance
to settle before capture.
(from adrian - yes, I've successfully captured images from an
Apple isight camera on firewire with this tool and in-tree support.)
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57914
fwohci: fix LPS delay, PHY_INT storm, and SID timeout recovery
Fixed the post-LPS delay from 500us to the IEEE 1394a-2000 s6.1 mandated
10ms ceiling. Handled PHY_INT by clearing W1C status bits in register 5
(masked ISBR to avoid spurious bus resets). Added a SID timeout callout
that recovers the state machine when a remote device fails to complete
self-ID. Fixed FW_PHY_SPD operator precedence and gated noisy messages
behind bootverbose/firewire_debug.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D58033
fwcam: add dynamic resolution and frame rate support
Read V_MODE_INQ and V_RATE_INQ registers for all supported formats
during probe, caching the camera's actual capabilities. Use these
to validate SMODE ioctl requests before writing to the camera.
Writing an unsupported combination caused the camera to
stop responding, requiring a physical power cycle.
Tested with: Apple iSight (external FireWire)
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D58090
ufs: Allow read-only mounting of NetBSD FFSv2 WAPBL filesystems
Skip UFS2 fs_metaspace upper-bound validation that rejects NetBSD FFSv2
WAPBL filesystems due to differing superblock layouts.
Detect the condition during mount instead and permit read-only mounts
while rejecting read-write mounts with EROFS. This follows NetBSD's
recommendation for systems without WAPBL support and avoids modifying
unsupported journal metadata.
PR: 296022
Signed-off-by: Ricardo Branco <rbranco at suse.de>
Reviewed by: imp, kirk
Pull Request: https://github.com/freebsd/freebsd-src/pull/2279
reboot: fix openlog(3) calls
LOG_CONS was OR'd into the facility argument instead of logopt, leaving
logopt as 0. The correct call is openlog(ident, LOG_CONS, LOG_AUTH),
as shutdown(8) and init(8) already do.
PR: 296315
Signed-off-by: Ricardo Branco <rbranco at suse.de>
Reviewed by: imp, des
Pull Request: https://github.com/freebsd/freebsd-src/pull/2300
kern: imgact: fix imgp->interpreted
This is a mask, so the new value should have taken the next bit to avoid
breaking a shell script that's interpreted by a binmisc-activated
interpreter.
Add a brief note that the new value is only used within the ELF
activator.
Fixes: 389c124fecb0 ("imgact_elf.c indicate that interpreter [...]")
Reported by: "polyduekes" on discord, madpilot
Reviewed by: kib, sjg (both previous version)
Differential Revision: https://reviews.freebsd.org/D58063
linux/futex: Don't load a timeout when try-locking a mutex
linux_sys_futex() does not copyin a timespec for the timeout if the
operation is LINUX_FUTEX_TRYLOCK_PI, presumably because it doesn't make
sense to specify a timeout for a try-lock operation. However, this
means that we pass a userspace timespec pointer to
linux_umtx_abs_timeout_init().
Modify linux_futex_lock_pi() to not initialize the timeout if we're
try-locking.
Reviewed by: kib, dchagin
Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58061
kern/sys_process.c: clean up includes
Order them alphabetically.
Remove redundand sys/param.h.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week