Ensure that all destructors for cdevpriv finished running before
destroy_dev() returns to the caller. Otherwise, since
devfs_destroy_cdevpriv() removes the cdevpriv data from the list, drops
the cdevpriv_mtx, and then starts the destructor, it is possible for
destroy_dev() to return before destructor finished in other thread.
This should allow drivers to safely remove cdev instance data that might
be referenced by cdevpriv data.
Diagnosed by: kevans
Reviewed by: kevans, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D53303
Add 14.2, as this was cherry-picked prior to release.
Reported by: Harald Eilertsen
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53320
There is no reason to not allow kern.geom.zero.byte and
kern.geom.zero.clear to be settable as a tunable.
Reviewed by: imp, markj
Approved by: markj (mentor)
MFC after: 1 week
Event: EuroBSDCon 2025
Differential Revision: https://reviews.freebsd.org/D52763
The reimplementation is a bit cleaner than the original code,
although it is also slightly slower. This shouldn't matter too
much as we will have asm code for the major platforms.
The code is unrolled when built in the kernel or user space, but
not when in libsa, as to reduce the code size.
Differential Revision: https://reviews.freebsd.org/D45670
Reviewed by: jrtc27, imp
Approved by: markj (mentor)
MFC after: 1 month
Both files are used by kernel and userspace.
Move them to sys/crypto where they belong.
No functional changes intended.
In preparation of D45670.
Reviewed by: markj
Approved by: markj (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D52909
One some systems, under some conditions, pulling a USB stick would
read(2) returning EIO and not ENXIO, like it should and used to.
Recoverdisk(1), which does not give up on EIO, like most programs
would, spins furiously.
Arguably, deadfs was always wrong in returning EIO, because once you
get to deadfs no operation will ever work again, but we used to
take a different path through devfs_vnops.c which got us the ENXIO.
Something changed recently, and while testing this fix, I noticed
that drm-kmod-66/i915kms may be the condition which trigger
the different code-path.
MFC to: stable/15
Fixes: 289785
Thanks to: imp, kib
ipf_htable_stats_get() constructs an iphtstat_t on the stack and only
initializes select fields before copying the entire structure to
userland. The trailing padding array iphs_pad[16] is never initialized,
so ~128 bytes of uninitialized kernel stack memory can be leaked to user
space on each call. This is a classic information disclosure
vulnerability that can reveal pointers and other sensitive data.
We fix this by zeroing out the data structure prior to use.
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: emaste
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D53275
ipf_nat_getent() allocates a variable-sized nat_save_t buffer with
KMALLOCS() (which does not zero memory) and then copies only a subset
of fields into it before returning the object to userland using
ipf_outobjsz(). Because the structure is not fully initialized on all
paths, uninitialized kernel heap bytes can be copied back to user space,
resulting in an information leak.
We fix this by zeroing out the data structure immediately after
allocation.
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: emaste
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D53274
This defaults to plain "pkg", but being able to override it is useful
when testing pkg itself.
Reviewed by: cperciva
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53307
This includes the conflicting changes from previous driver versions
(v6.11/v6.14), mostly being function pointer or function arguments.
MFC after: 3 days
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
MFC after: 3 days
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
MFC after: 3 days
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
MFC after: 3 days
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
Some of the changes we reported upstream got incorporated in this
(or the v6.16) release.
This also includes a change from iwlwifi-next.git::next for missing symbols
iwl_mvm_v3_rate_from_fw() and iwl_mvm_v3_rate_to_fw() were originally
comitted to mvm/rs.[ch] which we do not have. That left us with
unresolved symbols. For the never comitted v6.16 driver update I had
started to piece these together but they have been migrated out to
utils.c so take them from there until the next release hopefully ships
this change.
Obtained from: git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git
branch next, 1b49af228594452206d5c50a33b6a341428edb63
MFC after: 3 days
The first test is supposed to close the new fd, but was instead not
closing anything.
Reviewed by: ngie, markj
Fixes: 3cedbec3ee ("Integrate tools/regression/fifo into ...")
Differential Revision: https://reviews.freebsd.org/D52799
Reviewed by: cem
Fixes: 1492c8c0d qcom_rnd: add initial qualcomm prng driver.
Fixes: 9eecef052 Add an Armv8 rndr random number provider
Fixes: b2f8b2dc8 sys: Add an SMCCC Random Number Generator driver
Differential Revision: https://reviews.freebsd.org/D53292
VOP_BMAP is purely advisory. If VOP_BMAP returns an error during
readahead, cluster_read should still succeed, because the actual data
was still read just fine.
Add a regression test for PR 264196, wherein cluster_read would fail if
VOP_BMAP did.
PR: 264196
MFC with: 62aef3f73f
Reported by: danfe
Reviewed by: arrowd
Differential Revision: https://reviews.freebsd.org/D51316
fvp-base-revc.dtb works with the kernel now interrupt-maps are
supported in more cases.
Reviewed by: mhorne
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D51258
When producing formatted output, trim leading whitespace and trailing
commas from the human-readable time and uptime before emitting them.
The text output remains unchanged.
PR: 290089
Fixes: 6e6febb54d ("w: Fix idle time in json output, add login/idle times to json output")
Reviewed by: marius.h_lden.org
Differential Revision: https://reviews.freebsd.org/D53167
When copying the data in the first mbuf to get rid of the UDP
header, use the correct length. It was copying too much (8 bytes,
the length of the UDP header).
This only applies to handling TCP over UDP packets. The support for
TCP over UDP is disabled by default.
Reported by: jtl
Reviewed by: Peter Lei
MFC after: 3 days
Sponsored by: Netflix, Inc.
With this patch UDP-Lite endpoints are also shown per default.
Reviewed by: Nick Banks
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53252
With this patch UDP-Lite endpoints are also show per default.
Reviewed by: Peter Lei, Nick Banks
MFC after: 3 days
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D53230
Export the list of pcbs for UDP-Lite to be consumed by sockstat and
netstat.
Reviewed by: Peter Lei, Nick Banks
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53229
There may be other issues here but this change certainly seems to
be necessary.
PR: 290394
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D53263
The archive attribute (UF_ARCHIVE) is listed as deprecated
in RFC8881. However, the Windows NFSv4.1 client folk disagree
with this and say they need support for it.
This patch adds support for it, in a manner similar to what
is done for UF_SYSTEM and UF_HIDDEN.
MFC after: 2 weeks
__GLIBC__ is not pre-defined by the toolchain, it comes from features.h,
so we need to make sure that's included by this point.
Fixes: 4dd2b869cd ("krb5: Fix -Wint-conversion when bootstrapping on GNU/Linux")
It was previously disabled when we built for older 32-bit arm targets
which lack 64-bit atomics. As we now support armv7 at a minimum there
is no need to disable LLDB.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52668
It was used for Octeon MIPS and all producers have been removed
from the source tree.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53146
The menu was incorrectly using the fourth column (distname) instead of
the first (dist) of the MANIFEST.
The actual file name is on the first column of the MANIFEST file.
Remove the .txz part of the name to build the menu options.
Reviewed by: jamie
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D53177