[ToolChains][FreeBSD] Set default Linker to LLD for FreeBSD (#190596)
When the linker is specified as ld, toolchain applies special handling
by invoking (triple)-ld instead of resolving ld via standard PATH
lookup. This causes GNU ld installed via the system package manager to
take the precedence (since (triple)-ld appears earlier in the search
path), effectively overriding ld.lld.
As a result, we set the default Linker on FreeBSD to ld.lld to indicate
we want to use lld by default.
PR: 292067
MFC after: 3 days
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@cismon.net>
Reviewed by: asomers
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1729
In some cases having a src tree in a VM image is convenient
for development or debugging. Add a WITH_SRC variable,
which, when set, will cause the vm-release target to include
FreeBSD-set-src in the list of packages installed in an image.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Sponsored by: Intel Corporation
Reviewed by: cperciva
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D57143
_loopback entry in `static_routes` ensures a loopback route
exists in all routing tables.
However, loopback routes may already be added by the kernel.
Therefore, re-adding them triggers an `EEXIST` error on every boot.
This change suppresses those harmless errors.
PR: 259553
MFC after: 1 week
Reviewed by: glebius, jlduran, markj
Differential Revision: https://reviews.freebsd.org/D57470
When interface was connected to a link partner with a cable
type limitting maximum supported speed, e.g. SFP+ cable
in 25G port, driver incorrectly saved a supported speed
as the user configured speed. This prevented interface
from using all supported speeds after switching cable to SFP28.
Link was established at 10G as supported by previously used
SFP+ cable. Don't set user requested speed unless actually
configured by an user, to allow automatic selection of highest
available speed. Only when user sets custom config
using advertise_speed sysctl save it and try
to apply after cable is changed.
Also don't save initial supported speeds if FW supports
reporting default PHY config.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: kbowling, erj, mateusz.moga_intel.com
Sponsored by: Intel Corporation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D53611
When we snl_init_writer() we allocate memory in the struct snl_state in the struct pfctl_handle.
This memory was never released again, leading to a memory leak. We still
had a reference to the memory and would release it on pfctl_close()
(so valgrind did not detect it as a leak), but long-lived users (e.g.
bsnmpd) would eventually run out of memory.
Explicitly reset the snl_state when we're done to prevent this.
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Look up the pfctl family id when we open the handle, rather than for
every function call.
This saves us a lot of netlink calls, at the expense of storing one
extra int in the handle.
Sponsored by: Rubicon Communications, LLC ("Netgate")
This change documents the recently introduced changes to -p
that allow users to specify CPU ranges instead of having to
specify each individual mapping.
While we're here, move the -p examples to the EXAMPLES section.
Reviewed by: bcr
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D57480
This particular change didn't come from upstream. It was added locally
in 7a991ecd1 when attempting to enable the fips provider with 3.0.
Given the fact that we no longer build the fips provider and the fips
provider build process (including sources) is very prescribed to
specific build steps and source versions, there's no reason why we need
to continue carrying around this diff anymore.
MFC after: 1 week
Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
only those originated by mouse. Because the terminal surrounds
requests to vt(4) with locking.
Reported by: bz, adrian
Reviewed by: adrian, glebius
Approved by: glebius (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D57442
Add kernel and userland support for Zen6 IBS extensions per AMD pub
69205 (rev 1.00, March 2026): alternate fetch/op disable via ctl2[0],
fetch latency filtering, virtual address bit 63 filtering, and
streaming-store filtering. Decode the new IbsOpData2 StrmSt and
RmtSocket bits. Update libpmc, pmcstat and manpage.
Pre-Zen6 systems work unchanged with ibs_ctl2 == 0.
Signed-off-by: Andre Silva <andasilv@amd.com>
Reviewed by: Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne
Sponsored by: AMD
Differential Revision: https://reviews.freebsd.org/D56914
FreeBSD's USB framework supports detaching kernel drivers to allow
user space applications to exclusively claim USB interfaces. However,
it lacked support for reattaching the kernel driver afterward.
This commit adds the missing functionality, enabling user space
to return control of the device back to the kernel.
Reviewed by: lwhsu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52122
This test runs with rights of an un-privileged user writing to a file
system only writable by the owner. Since no UID was provided in the
mount command, the owner of the file system was "root", and thus
writing was not allowed for $testuser. Fix this issue by mounting
with "-u $testuser".
MFC after: 3 days
This patch aligns the return values of freebsd32_{set,swap}context()
with their counterparts on amd64 and powerpc64, fixing the setcontext()
and swapcontext() calls in armv7 applications running on aarch64.
In particular, this fixes random crashes in armv7 Ruby applications
running on aarch64 hosts.
Tested by: fuz
MFC after: 1 week
Remove test for UFC-16 surrogate pairs in file names from this exclude
list, since kernel support has been committed and the test can be now
expected to succeed.
MFC after: 3 days
On my ZFS based systems, no allocations occur with tags "newblk" or
"freework". This leads to errors executing the tests that check for
memory leaks. Skip the checks if the output of wmstat -m does not
contain lines corresponding to those allocations.
MFC after: 3 days
Multipath routes can be added via both RTM_F_CREATE and RTM_F_APPEND.
Therefore, it's possible to have mpath routes without calling
add_route_flags_mpath.
Instead of checking V_fib_hash_outbound for every route append,
check it during nhgrp_ctl initialization, which is only called for
the first multipath request per rib_head.
PR: 293136
Reviewed by: glebius
Tested by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Differential Revision: https://reviews.freebsd.org/D57469
There is no reason to have per-profile copies, plus this way we open
/dev/sndstat multiple times if more than 1 profile is created.
Also close the FD on exit to avoid leaking.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: jrm
Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/41
virtual_oss(8) does not currently keep track of the cuse(3) it creates,
nor does it destroy any of them on exit, except for the control device.
This is harmless if virtual_oss(8) is killed after all audio streams
have been shut down, but if it's killed during I/O, the process hangs
and/or goes into uninterruptible sleep state.
To fix this, have pointers to all cuse(3) devices, and explicitly
destroy them on exit. Also make sure we don't leak memory in
dup_profile().
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: jrm
Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/41
Removes the file size limit for -C comparisons. The limit was
meant to prevent oversized mmap allocations, which is no longer
relevant as mmap is no longer used here (removed by
a0439a1b82, review D44809).
Credit to bdrewery.
See: https://reviews.freebsd.org/D57230
Reviewed by: bdrewery, glebius, ziaee
Approved by: glebius (mentor)
Obtained from: Fudo Security
MFC after: 2 weeks
Sponsored by: Fudo Security
Differential Revision: https://reviews.freebsd.org/D57503
Regenerate gd_qnan.h on riscv using the qnan.c
config tool found in contrib/gdtoa.
This fixes the following tests in CI:
lib/libc/stdio/scanfloat_test:infinities_and_nans
lib/libc/stdlib/strtod_test:strtold_nan
Reviewed by: jrtc27
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D57405
Eliminate panic when re-setting a paused failpoint to pause
(address of feq_mtx changes whilst in mtx_sleep, triggering
assertion when reacquiring mtx).
Reviewed by: rlibby
Pull Request: https://github.com/freebsd/freebsd-src/pull/2267
While here, use the more specific "pidfile" consistently instead of
ambiguous "filename".
Reviewed by: ziaee
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D57531
Replace the `(bool(*)(bool))` probe in `__assert_sanitize()` with an unevaluated
conditional expression, so types with `explicit operator bool()` that require a
contextually converted constant expression of type `bool` are handled correctly.
Ergo, arity check is now performed separately via `__assert_sanitize_arity()`, a
unary template whose parameter pack must bind to exactly on argument after
`__VA_ARGS__` is substituted into the call.
Also align NDEBUG with C23 requirements.
Reported by: dim, aokblast
Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: aokblast, fuz
MFC after: 1 week
Fixes: 867b51452e
Pull Request: https://github.com/freebsd/freebsd-src/pull/2265
This change is a security release which resolves several issues with OpenSSL 3.5,
the highest severity issue being ranked "High". Users are strongly encouraged to
update to this release.
More information about the release (from a high level) can be found in
the release notes [1].
1. https://github.com/openssl/openssl/blob/openssl-3.5.7/NEWS.md
All conflicts were resolved with `--theirs`, taking the release diff
over the local diff; the conflicts occurred due to preemptive security
fixes applied by so@ in e508c343.
MFC after: 3 days (the important security issues have been
preemptively addressed)
Merge commit '3a71a35ad9dad0e5d2cad8efecc8ba9d57c42d43'
Conflicts:
crypto/openssl/include/internal/quic_channel.h
crypto/openssl/ssl/quic/quic_channel_local.h
crypto/openssl/ssl/quic/quic_rx_depack.c
crypto/openssl/test/cmsapitest.c
crypto/openssl/test/evp_extra_test.c
The Book-E watchdog is effectively a state machine based around an AND
mask of the timebase register. A single bit (0-63) is watched in the
timebase register, and when it transitions (by counting *or* by
programmatically setting) an exception is triggered. The first
exception triggers a core interrupt. The second is programmable.
In our case, we panic on the first and reset on second.
* Force the type of the literal `1` passed to nstosbt() to ensure it's a
64-bit type (or larger). Otherwise it gets inconveniently typed to
int, resulting in truncation.
* Use `flsll()` when converting sbt to power-of-2-nanoseconds to fix
32-bit compatibility.
PR: 292616
Obtained from: Hewlett Packard Enterprise
Fixes: 26d6617f3 ("watchdog: Convert to using sbintime_t format")
MFC after: 3 days
RFC 1994 does not place any limit on the length of the value field in
challenge messages except that the length is a single octet which
bounds the maximum length to 255.
NB: I'm not sure why the local[] and peer[] arrays contain room for an
authentication name (AUTHLEN) in addition to a challenge value/response,
but I've just left that in place.
PR: 271955
Reported by: Robert Morris <rtm@lcs.mit.edu>
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D57138
Only fetch the optional mode argument to ID0open to pass to open(2) if
O_CREAT is present in the flags argument. It is UB to fetch an
argument that doesn't exist. On CHERI this UB results in a fault.
Reviewed by: brooks
Obtained from: CheriBSD
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D57137
The man page incorrectly stated that hdestroy() calls free(3) for
each comparison key. The implementation (hdestroy_r.c) only frees
the internal table structure, not the user-provided keys or data.
This matches POSIX, which says hdestroy "shall dispose of the
search table" without mentioning key deallocation.
Update the description to clarify that the caller is responsible
for freeing any memory associated with table entries.
PR: 291240
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2095