compat/freebsd32: set uio_rw for trailer's uio in freebsd32_sendfile()
PR: 297516
Reported by: asomers
Fixes: dfad790c8cca ("sendfile: stop abusing kern_writev()")
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
netipsec/xform_ipcomp.c: fix sockaddr type set in ipcomp6_nonexp_encapcheck()
Noted and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58646
PF_KEY socket: limit the length of copied socket address
for SADB_UPDATE op SADB_X_EXT_NEW_ADDRESS_SRC/DST extensions, by
checking the sa_len matching the address family requirements before
doing the copy.
Also convert KEY_SETSECASIDX() and KEY_SETSECSPIDX() to functions and
apply the sa_len clamping there.
See https://github.com/0xdeadbeefnetwork/pfkey-sadb-overflow
PR: 297264
Tested by: Wafa Hamzah <wafah at nvidia.com> (previous version)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58646
kern/sys_process.c: make vmspace_rwmem() similar to io functions
In particular, if there were any bytes moved, and then vm_fault()
faulted, do not return an error, but report the short io instead.
PR: 297512
Reviewed by: markj
Tested by: Stéphane D'Alu <sdalu at sdalu.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58838
kern/kern_proc.c: do not throw out read data in get_ps_strings()
Since vmspace_iop()/proc_readmem() might return -1 on error from
vmspace_rwmem(), account for this and stop reading but return already
accumulated data if any, instead of returning an error.
PR: 297512
Reported and tested by: Stéphane D'Alu <sdalu at sdalu.com>
Reviewed by: markj
Fixes: e1b0d051bbf7 ("proc: Allow to make proc_rwmem() operate on a consistent address space")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58838
Increase the default mlock limit from 64k to 256k
The current default has been unchanged for 14 years. Increase it to
keep pace with modern hardware and software. security/pinentry-gnome,
in particular, can sometimes need 112 kB.
PR: 297452
MFC after: 2 weeks
Sponsored by: ConnectWise
Reviewed by: cye, emaste
Differential Revision: https://reviews.freebsd.org/D58811
if_vmx: fix panic during kldload
Just like vmxnet3_intr_disable_all, iflib may invoke this routine
before vmxnet3_attach_post() has run, which is before the top-level
shared data area is initialized and the device made aware of it.
PR: 294312
Sponsored by: Dell Inc.
(cherry picked from commit 01b0690c495e1043a72cae9ee945f9f2c2adc216)
if_vmx: fix panic during kldload
Just like vmxnet3_intr_disable_all, iflib may invoke this routine
before vmxnet3_attach_post() has run, which is before the top-level
shared data area is initialized and the device made aware of it.
PR: 294312
Sponsored by: Dell Inc.
(cherry picked from commit 01b0690c495e1043a72cae9ee945f9f2c2adc216)
etc/rc.subr: svcj - use the filename for services
We have ports and basesystem services, where the internal name and the
filename differ. While the documentation recommends to keep them in
sync, the reality is different. For service jails use the basename of
the service filename.
Fixes: 2efbd48 rc: add service jails framework
Suggested by: joneum
MFC after: 1 week
MFC to: stable/15
rc.d/bgfsck: use the correct variable name
The name of the script and the name used internally for rc.conf differ,
as such the hardcoded disabling of service jails for the didn't work.
Fix by using the correct name.
Fixes: f99f0ee14e3af rc.d: add a service jails config to all base system services
routing: Fix table sizes
Tables that have one element per protocol or address family were
previously sized by AF_MAX + 1 since AF_MAX was off by one. Now that
AF_MAX has been corrected, we need to apply the opposite correction to
these tables.
Fixes: ddd850aa7720 ("sys/socket.h: Fix AF_MAX")
MFC after: 3 days
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: pouria, kevans, glebius
Differential Revision: https://reviews.freebsd.org/D58826
libifconfig: Fix table size
Tables that have one element per protocol or address family were
previously sized by AF_MAX + 1 since AF_MAX was off by one. Now that
AF_MAX has been corrected, we need to apply the opposite correction to
these tables.
Fixes: ddd850aa7720 ("sys/socket.h: Fix AF_MAX")
MFC after: 3 days
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D58827
Remove minor version from kmods repo
We don't have a kmods_quarterly_5 repo for releng/14.5 so don't point
users at it.
Direct commit to releng/14.5, hopefully to be reverted once the repo
exists.
Approved by: re (cperciva)
Sponsored by: OpenSats Initiative
Revert "sys/socket.h: Fix AF_MAX"
Back out this change for 14.5-BETA2. It might come back with
changes, but in its current form it breaks ABI.
This reverts commit f77a60a27ad64e3acf26f3dc088c6e80fdd15754.
Approved by: re (cperciva)
pseudofs: Don't purge the cache on shutdown
This is a waste of time and results in a use-after-free if linsysfs is
loaded and a USB network interface is in use, since USB devices are
disconnected at shutdown, which triggers a call into linsysfs, which
then tries to destroy a pseudofs node which has already been purged.
Approved by: re (cperciva)
MFC after: 1 week
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D58359
(cherry picked from commit 4ebcdb8dd9a7bdddbc97ff6ee47e0a7556c76b5a)
(cherry picked from commit ea65604407f4c2c73e889cfba07f5c65fb208996)
git-arc: Add a diff subcommand
Show the differences between local commits and their associated
Phabricator reviews, i.e., what "git arc update" would upload. For
each commit, the review's current raw diff is applied to the commit's
parent in a temporary index and the resulting tree is compared against
the commit itself. An empty diff means the commit and the review are
in sync.
This makes it easy to check whether local amendments have diverged
from the posted review before updating it, or to confirm that a
review is current before landing.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D58789
unix: only treat an empty sun_path as a peer descriptor for connectat(2)connect(2) passes AT_FDCWD to unp_connectat(), so the empty-path
descriptor branch added in 6563dcb6b1f5 turned any sockaddr whose
sun_path begins with a NUL byte into getsock(AT_FDCWD), failing with
EBADF where the pathname lookup historically failed with ENOENT.
Linux abstract namespace names are exactly that: the linuxulator
passes them through with the leading NUL intact, and libxcb tries the
abstract socket first, falling back to the pathname socket only on
ENOENT or ECONNREFUSED. The EBADF made every Linux X11 client fail
at startup with "Missing X server or $DISPLAY".
Restrict the descriptor interpretation to fd != AT_FDCWD, matching
the contract stated in 6563dcb6b1f5's commit message ("Accept an
empty sun_path when fd is not AT_FDCWD"): connect(2) again reaches
the pathname lookup and fails with ENOENT as it always did.
Add a regression test: a NUL-leading, nonzero-length sun_path through
[7 lines not shown]
libcxgb4: Use t4fw_interface.h from the cxgbe driver sources
In Linux these are maintained in separate places so a separate copy is
needed, but in FreeBSD take advantage of the shared tree to avoid
having a duplicate copy that can be stale.
Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D58575
rtld: Remove a stale #ifdef PIC
rtld has always been built PIC since commit
7ca8e6a67068e8357e251bd3ea86253c8a751d59. The stale #ifdef might
confuse a reader by thinking rtld can be built as non-PIC.
Reviewed by: kib
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D58623
libc: Implement qualifier-preserving standard library functions
Several standard library functions are specified to return an unqualified
pointer while accepting a pointer to a potentially const-qualified object.
N3020 addresses this behaviour, discarding qualifiers due to incompatible
pointer types, by introducing qualifier-preserving macros for the affected
set of standard library functions.
Add `__qualsel()` helper to `<sys/cdefs.h>`, implemented using the generic
selection, and define qualifier-preserving macros for that set of functions
in `<string.h>`, `<wchar.h>`, and `<stdlib.h>`.
Macros are gated on `_STDC_VERSION__ >= 202311L && !__cplusplus`, therefore
there is no behavioural change for earlier C modes or C++ translation units.
The kernel is likewise unaffected, as it does not include userland headers.
As function-like macros, they are transparent except at a call site where
the address-of operator is applied, the macro is suppressed via `#undef`,
or the identifier appears in parenthesised form; all of which cause the
[6 lines not shown]
pfsync test: reduce the number of states to bulk-sync
We created so many states that our bulk-sync occasionally caused epair
to drop packets, which in turn caused the test to fail. That's not what
we're testing here, make it more robust by creating fewer states.
PR: 297307
Sponsored by: Rubicon Communications, LLC ("Netgate")
release/riscv: tweak GENERICSD partition placement
Increase EFI partition size to begin rootfs at 64mb. I believe this was
my original intention. I have a microSD card with 8mb block size which
emits an advisory in verbose dmesg about the misaligned partition.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
libusb: Mark defualt smybol tag as latest stable version
As we might change the libusb ABI in 16, we should mark thje first
version as FBSD_1.8 instead of 1.9. Since versioning patch has not
landed for a long time, it makes sense to change it directly.
Discussed with: kib
Fixes: 527a82474cb3 ("libusb: versioning symbols")
Sponsored by: The FreeBSD Foundation
bnxt: Add led(4) identification support
Query the firmware for the LEDs on each physical port and expose
/dev/led/bnxt* only when alternate blinking is supported. Configure
every LED in the advertised group for identification and restore its
default firmware state before a function reset.
This follows the DPDK and Linux bnxt HWRM identification paths.
Reviewed against: DPDK, Linux
Reviewed by: Sumit Saxena <sumit.saxena at broadcom.com>
MFC after: 2 weeks
Sponsored by: BBOX.io
linuxkpi: stop inlining accesses to curthread->td_lkpi_task
This should provide much higher resistence against struct thread layout
changes for out-of-tree modules depending on linuxkpi.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58733