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
sendfile: stop abusing kern_writev()
Provide convenient wrapper kern_filewrite() around fo_write().
Switch to use it in vn_sendfile(). This allows to avoid duplicate
fget() when we already have the reference to the file, which creates a
correctness race with the userspace. Also td_retval[0] clearing hack
can be removed.
Reviewed by: glebius, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58035
acpi: fix instant panic in hest_attach()
Since now there is a pseudo-bus between our device and acpi0, we need to
go deeper.
Fixes: 9313f6b01485ad9a0b7cc59b459f5714533587c3
einj: Tool to manage APEI error injection
This tool supports two commands. The list command outputs a summary
of injectable errors supported by the current system. The inject
command injects the requested error.
Reviewed by: gallatin, imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D58026
acpi_einj: Support for ACPI error injection
This driver parses the ACPI EINJ table and builds a list of
instructions associated with known actions. It then exports ioctls to
fetch the set of supported errors and inject system errors by
executing specific sequences of actions. This can be used to test
error reporting facilities for events such as ECC errors.
Reviewed by: gallatin
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D58025
acpi: Add a pseudo-bus for APEI devices to manage resources
Different APEI tables can reuse the same registers (and sometimes
different views of the same register, e.g. 32- vs 64-bit mappings of
the same register). To enable this sharing, apei0 now acts as a bus
device managing a pool of allocated resources and handing out mappings
to child devices which handle individual tables.
Most of the previous apei(4) driver has been moved into a new
hest0 device that is a child of apei0.
Reviewed by: gallatin
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D58024
x86/local_apic.c: Thermal interrupt support: Additional style fixes
Rename handler function type 'lapic_thermal_handle_function' to the
shorter 'lapic_thermal_handler_t'. Move it closer to the function
declaration block where it is used. Make it a true function type (no
pointer) and add explicit pointer marks on usage.
Rename 'lapic_thermal_function_value' to the more immediately clear
'lapic_thermal_function_arg'. In lapic_thermal_enable(), use 'func_arg'
as the argument name for the handler argument, which at least refers to
function 'func', rather than the generic 'value'.
Finally, rename the global handler variable from
'lapic_thermal_function_ptr' to the shorter 'lapic_thermal_function'
(dynamic functions can be referenced only through a pointer).
MFC with: 87ba088fa310 ("x86/local_apic.c: Add support for installing a thermal interrupt handler")
Sponsored by: The FreeBSD Foundation
x86/local_apic.c: Add support for installing a thermal interrupt handler
The thermal interrupt is initially masked.
Thermal interrupt handling is enabled by calling lapic_enable_thermal(),
which installs a (single) handler.
[olce: Wrote the commit message.]
Reviewed by: kib, olce
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44454
inpcb: make net.inet.ip.portrange port number limiting sysctls unsigned
And make net.inet.ip.portrange.randomized boolean.
Reviewed by: pouria, tuexen, markj
Differential Revision: https://reviews.freebsd.org/D57291
netinet6: further refactor in6_pcbconnect()
A mistake from 90ea8e89d9b7 is that in6_pcblookup_internal() was skipped
for an inpcb that had unspecified local address. This is incorrect, as
such inpcb could have already have a port set, and in_pcb_lport_dest()
shall not be called on such inpcb. That could lead to creation of an
alised connection in the database.
This makes the function almost identical to in_pcbconnect(). While here,
fix minor bug of missing INP_ANONPORT. This flag has no use in kernel,
but affects netstat(1) output in certain mode.
Fixes: 90ea8e89d9b751e8b5ae90ef3397883b035788e5
Reviewed by: pouria
Differential Revision: https://reviews.freebsd.org/D57987
if_bridge: Remove unused disable parameter in bridge_stop
The ```int disable``` parameter is included in the bridge_stop function
signature but is not used in the function body.
I had noticed this when tracing the driver's path while learning more
about the ifnet library.
This parameter originally appeared when importing the driver from NetBSD.
However, the FreeBSD ifnet library no longer requires an if_stop function.
Meaning that the function signature can be changed to only contain needed
parameters for our bridge driver.
Discussed with: freebsd-net@ mailing list
Signed-off-by: Acesp25 <acesp25 at freebsd.org>
Reviewed by: kp
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2290
mlx5: propagate the DEVX uid through SRQ create and destroy
The SRQ command builders never stamped the owning DEVX uid into the
firmware CREATE_SRQ/CREATE_RMP/CREATE_XRC_SRQ commands, so a basic SRQ
was always created with uid 0. Every modern libmlx5 context runs with a
DEVX uid, and the QPs that reference the SRQ carry that uid, so firmware
rejected CREATE_QP with "bad resource": a uid-owned QP may not reference
a uid-0 SRQ.
Reviewed by: kib
Tested by: Wafa Hamzah <wafah at nvidia.com>
Sponsored by: Nvidia networking
MFC after: 1 month
mlx5: guard against a NULL CQ event handler in mlx5_cq_event()
DEVX and mlx5en created CQs are registered without an asynchronous
event handler (mcq.event is NULL). An asynchronous CQ_ERROR event for
such a CQ made mlx5_cq_event() call through a NULL pointer and panic.
Reviewed by: kib
Tested by: Wafa Hamzah <wafah at nvidia.com>
Sponsored by: Nvidia networking
MFC after: 1 month
mlx5: pass the full EQE to the DEVX event notifier
The DEVX event notifier and its helpers expect a full struct mlx5_eqe
and read eqe->data from it, but mlx5_eq_int() passed &eqe->data, so the
data offset was applied twice.
Reviewed by: kib
Tested by: Wafa Hamzah <wafah at nvidia.com>
Sponsored by: Nvidia networking
MFC after: 1 month
ofed/ib_uverbs: release rdma_user_mmap entry ref in rdma_umap_close()
Import Linux upstream commit 3411f9f01b76bd88aa6e0e013847ab6479cb4f24.
rdma_umap_priv_init() takes a reference on the rdma_user_mmap entry for
every VMA it maps, but rdma_umap_close() never dropped it. The entry
was therefore never freed and lingered in ucontext->mmap_xa, tripping
WARN_ON(!xa_empty(&ucontext->mmap_xa)) at context teardown and leaking
the firmware UAR on every context close.
Reviewed by: kib
Tested by: Wafa Hamzah <wafah at nvidia.com>
Sponsored by: Nvidia networking
MFC after: 1 month
mlx5ib: advertise write-combining support for dynamic BlueFlame UARs
Import Linux upstream commit 1f3db161881b7e21efb149e0ae8152b79a571a8f.
dev->wc_support was never set, so it was always false and the UAR ioctl
refused BlueFlame (write-combining) UAR allocations with EOPNOTSUPP.
That breaks QP creation in pure dynamic-UAR mode, where user space asks
for a BF doorbell UAR.
Reviewed by: kib
Tested by: Wafa Hamzah <wafah at nvidia.com>
Sponsored by: Nvidia networking
MFC after: 1 month