Link with --no-undefined-version by default. Will detect and prevent
the accidental removal of symbols from versioned libraries.
(cherry picked from commit 4510f2ca91)
This reverts commit b25ceb97ed.
Reviewed by: arichardson, kib, dim, emaste
Differential Revision: https://reviews.freebsd.org/D44216
The current check is never false and if nvlist_unpack() fails, we might
panic later down the road.
PR: 266144
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D45237
SNDSTIOC_ADD_USER_DEVS* expects a user-supplied sndstioc_nv_arg->nbytes,
however we currently do not check whether this size is actually valid,
which results in a panic when SNDSTIOC_ADD_USER_DEVS* is called with an
invalid size. sndstat_add_user_devs() calls
sndstat_unpack_user_nvlbuf(), which then calls malloc() with that size.
PR: 266142
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D45236
If dsp_unit2name() fails, we'll get to out2 with b, bs and devinfo
uninitialized, which will result in a panic.
Reported by: Pierre Pronchery <pierre@freebsdfoundation.org>
Reported by: Coverity Scan
CID: 1545029, 1545025
Pull-request: https://github.com/freebsd/freebsd-src/pull/1240
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D45272
c is allocated with M_ZERO.
Reported by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D45273
Currently, if the prefix of the new home directory is a subdirectory
of a ZFS dataset, adduser will create a new dataset up one or more
levels from the intended destination. "pw useradd" will then create
a normal directory in the desired location, leaving an unused dataset.
Check for this situation when determining whether to create a dataset,
and let pw create the directory.
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D45229
MFC after: 3 days
If a memory-mapped file is truncated before we get to the end, the
atomizer may catch SIGBUS. Detect that, reduce the input length to
what we were actually able to read, and set a flag so the caller can
take further action (e.g. warn the user and / or start over).
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D45217
User misconfiguration, either tunnel loops, or a large number of
different nested tunnels, can overflow the kernel stack. Prevent that
by using if_tunnel_check_nesting().
PR: 278394
Diagnosed by: markj
Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45197
Make these consistent. Some files weren't even consistent with
themselves. Make them all either return <space> ( <value> ); or
return;
Sponsored by: Netflix
Move the initialization of hostfs_root to be a bit sooner. While it
doesn't matter for the default case, we may want to use hostfs files
sooner.
Also, while we're here, remove kboot.conf. It duplicates the command
line and has proven difficult to use. It will be replaced by an early
script that can influence the state of the boot loader before we select
a device to boot from (including strongly suggesting which one to boot
from).
Sponsored by: Netflix
Create interp_preinit() to initialize the scripting language to run
scripts. Make sure you can call it multiple times, but only the first
one has effect, After it's call, you can run scripts in the scripting
language. At the moment, no functional change.
Sponsored by: Netflix
Move the console probing to as early as possible. There's no real
support for anything but hostcons, and setting it up early will show
other error messages.
ACPI and SMBIOS probing can be done just after we have the console, so
move it there. This allows other parts of the early code to use info
from that, as well as overriding and env vars set by these things on the
command line (smbios data may be wrong during initial development phases
as the automated way to populate per-board data may not be established,
etc).
Sponsored by: Netflix
This local variable s is for iterating characters of global variable
`version`. The content of `version` is not going to be altered by
function freebsd4_uname().
MFC after: 1 week
and apply the consistent format for device ids used in other IVRS
elements. The field seems to be the PCI Device ID of the IOMMU itself,
instead of an abstract unit ID.
Sponsored by: Advanced Micro Devices (AMD)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Moreover, if we attempt an L2 promotion on the kernel pmap from
pmap_enter_quick_locked(), this change eliminates the recomputation of
the L2 entry's address.
MFC after: 1 week
The functions g_eli_init_uma and g_eli_fini_uma are used to trace
the number of devices in GELI. There is an issue where the g_eli_create
function may fail before g_eli_init_uma is called, however
g_eli_fini_uma is still executed in the fail path. This can
incorrectly decrease the device count to zero, potentially leading to
the UMA pool being freed. Accessing the device after the pool has been
freed causes a system panic.
This commit resolves the issue by ensuring devices count is increassed
eariler.
PR: 278828
Reported by: Andre Albsmeier <mail@fbsd2.e4m.org>
Reviewed by: asomers
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45225
Loading modules via kld_list is no longer substantially faster than via
loader.conf.
[skip ci]
MFC after: 2 weeks
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D45242
With the commit of D44903 we no longer need the SAD option. Instead all stacks that
use the sack filter inherit its protection against sack-attack.
Reviewed by: tuexen@
Differential Revision:https://reviews.freebsd.org/D45216
The usb bus code (uhub) doens't present the same information to devctl
as it does to the NOMATCH events it generats. As such, devmatch fails to
find USB devices on boot when NOMATCH events are optimized out. Since
the savings of boot time is relatively trivial for all but the most
demanding boot environments, disable it by default until this issue is
fixed.
Fixes: 6437872c1d
MFC After: 1 minute
Sponsored by: Netflix
Mark powerpc* and riscv broken.
Refactor and add a TRY_GCC_BROKEN option to build anyway. This
simplifies things for people trying to get gcc builds working
while letting other developers know that they aren't expected to work.
Reviewed by: jhb, emaste
Improves: 4c0dfd5959 arm: fail early on gcc builds
Differential Revision: https://reviews.freebsd.org/D45230
GCC 13 supports _Float16 and __int128 on fewer architectures than clang
and thus libcxxrt compiled with gcc13 is sometimes missing related
symbols. Hack around this by explicitly appending --undefined-version
to LDFLAGS in problematic cases.
Reviewed by: theraven, dim
Differential Revision: https://reviews.freebsd.org/D45233
An assert() was setting the error variable instead of checking it.
Reported by: Coverity Scan
CID: 1521431
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Pull Request: https://github.com/freebsd/freebsd-src/pull/1244
The !DXR2 code corresponds to the original DXR encoding proposal from
2012 with a single direct-lookup stage, which is inferior to the more
recent (DXR2) variant with two-stage trie both in terms of memory
footprint of the lookup structures, and in terms of overall lookup
througput.
I'm axing the old code chunks to (hopefully) somewhat improve readability,
as well as to simplify future maintenance and updates.
MFC after: 1 week
DXR lookup table encoding has an inherent structural limit on the amount
of binary search ranges it can accomodate. With the current IPv4 BGP views
(circa 1 M prefixes) and default DXR encoding we are only at around 5% of
that limit, so far, far away from hitting it. Just in case it ever gets
hit, make sure we free the allocated structures, instead of leaking it.
MFC after: 1 week
In e820_finalize(), the e820_fwcfg_item variable, containing the
etc/e820 file (for the e820 table from the BIOS) is not free()'d when it
could not be added to the QEMU firmware configuration device (fw_cfg).
Reported by: Coverity Scan
CID: 1522761
Reviewed by: corvink, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45223
When calling dxr_init(), the FIB_ALGO infrastructure may provide a
pointer to a previous dxr instance, which permits reuse of auxiliary
dxr structures, i.e. incremental lookup structure updates. For dxr this
is a crucial feature provided by FIB_ALGO, since dxr incremental updates
are typically several orders of magnitude faster than full lookup table
rebuilds.
However, the auxiliary dxr structure caches a pointer to struct fib_data and
relies upon it for performing incremental updates. Apparently, incremental
rebuild requests from FIB_ALGO, i.e. a calls to dxr_init() with a pointer
old_data set, may (under not yet fully understood circumstances) be invoked
within a different fib_data context than the one cached in the previous
version of dxr auxiliary structures. In such (rare) events, we ignore the
offered old dxr context, and proceed with a full lookup structure rebuild
instead of attempting an incremental one using a fib_data context which
may or may not no longer be valid, and thus lead to a system crash.
PR: 278422
MFC after: 1 week
When booting the kernel with VHE it will be running at EL2. The current
config register values only enable the reaces at EL1 when tracing the
kernel.
Set the HMC flag to also trap from EL2.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D45121