ports.7: Add the DEVELOPER make variable
make.conf(5) says make variables that are for the ports tree should
be documented in ports(7). Add this from the porters handbook.
MFC after: 3 days
Reviewed by: alven
Event: FreeBSD 2026 Vendor Summit
Differential Revision: https://reviews.freebsd.org/D61272
contrib/bc: remove vs sub-directory
Some of the files in the vs sub-directory are checked out with CRLF
line breaks via .getattributes. This causes issues when checking out
the source tree with other tools that operate on Git repositories like
"got". Remove the vs sub-directory from the contrib tree, since it is
not required on FreeBSD.
(cherry picked from commit 94d4ba04a96f495d635bf246e4d5021eb1faab22)
iSCSI: Fast and per-session timeouts
Support per-session configurable ping (SCSI NOP) and login timeouts
similar to what is supported in the Linux iSCSI initiator configuration file.
Reduce iscsi timer granularity to 0.1 sec.
For backwards compatibility, when all timers are selected on integer numbers,
all status messages are unchanged. If the higher granularity is used, the
log messages include sub-second granularity.
The sysctl(3) interface has changed from pure int to string, in order to
support fractional seconds in a human-readable, dotted notation.
Reviewed By: #netapp, #manpages, jhb, pauamma_chezdork.com, siderop1_netapp.com
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D32540
openssl: restore removed libcrypto symbols as compat symbols
c01c0a27cb82 (D60397) stopped exporting 52 names from libcrypto.so.35 that
upstream does not export. Binaries and libraries linked against the
earlier libcrypto.so.35 can still import them; the libssl.so.35 from
15.0 and 15.1 imports 15 of them, so it fails to load with the new
libcrypto.
Provide all 52 again as non-default (compat) versions, in the version
nodes they had before: OPENSSL_cpuid_setup at OPENSSL_3_0_9, the others
@OPENSSL_3_5_0. Existing consumers resolve them; new links cannot bind
to them. The default exports do not change and still match upstream.
The wrappers live in a new FreeBSD-only file, compat.c. Remove it at
the next SHLIB_MAJOR bump.
Reviewed by: ngie
Fixes: c01c0a27cb82 ("openssl: make libcrypto export the same symbols as upstream")
MFC after: 2 weeks
[3 lines not shown]
openssl: build legacy provider as upstream does
- Build with libcrypto's compile flags: modules/Makefile.inc now
includes libcrypto's Makefile.inc, which brings in Makefile.common
(NDEBUG, the asm dispatch defines, OPENSSL_PIC, the directory
defines). Before this change, assertions were enabled in legacy.so.
- Use upstream's per-architecture source list: the provider's own CPU
capability code (cpuid asm and armcap.c/ppccap.c, or mem_clr.c
without asm), and the MD5, RC4 and DES asm where upstream uses it.
The provider no longer uses libcrypto's exported RC4, SHA1 and
CRYPTO_*128 functions.
- Drop the objects that upstream's linker leaves out of legacy.so
(fcrypt_b.c, md5_one.c, md5_sha1.c, provider_err.c and
ciphercommon_{ccm,gcm}*.c / ciphercommon_hw.c). Without them,
params_idx.c is not needed either.
- Add a version script, a copy of upstream's providers/legacy.ld, so
that only OSSL_provider_init is exported. Around 209 symbols were
exported before.
[5 lines not shown]
ctfconvert: Make the absence of debug info non-fatal
When compiled with gcc14, subr_ticks.o legitimately doesn't contain any
DWARF sections. Just emit a warning in this case. In general we still
want to run ctfconvert on asm files.
Reviewed by: emaste, des
Fixes: e959f2a7d8a8 ("ctf*: exit with error upon terminate()")
Differential Revision: https://reviews.freebsd.org/D61231
amd64/vmm: Don't advertise AMD PerfMonV2 or performance counters
vmm does not handle CPUID leaf 0x80000022, so a FreeBSD guest on a
Family 19h or later host panics on "kldload hwpmc", which trusts the
PerfMonV2 bit and writes AMD_PMC_GLOBAL_CTL.
Tested by: Osvaldo Janeri Filho <ojanerif at amd.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Reviewed by: markj, kib
Differential Revision: https://reviews.freebsd.org/D61141
hwpmc: Decline the AMD PerfMonV2 path when GLOBAL_CTL is absent
The v2 path writes AMD_PMC_GLOBAL_CTL whenever the PerfMonV2 CPUID bit
is set. bhyve passes that bit through from the host but does not emulate
the register, so loading hwpmc in a guest on a Family 19h or later host
panics the kernel.
amd_v2_hwcheck_cpu() already probes EVSEL MSRs, so probe GLOBAL_CTL
there too, in order to reject the v2 path and fall back to the generic
CPU class.
Fixes: 9d3064010590 ("hwpmc_amd: add PerfMonV2 global-control path")
Tested by: Osvaldo Janeri Filho <ojanerif at amd.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Reviewed by: mhorne, afscoelho at gmail.com
Differential Revision: https://reviews.freebsd.org/D61133
inetd: use snprintf() in inetd_setproctitle()
inetd_setproctitle() formats se_service (the service name taken verbatim
from inetd.conf) and the peer address into an 80-byte buffer with
sprintf(). A long service name can overflow it. Bound both calls with
snprintf().
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D60879
(cherry picked from commit 9ab2bf0f4296e8bfafe4dc70f2f200265e6933bd)
vm_glue: Use the right type for size arguments to {user,kern}acc()
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit c525db0c44b7db430b67fdd276f0a22c2f8e9f61)
bhyve: fix integer overflow in qXfer packet parser
doff + dlen overflows unsigned int when both values are close to UINT_MAX,
causing the wrong branch to execute and passing an unbounded length to
append_binary_data(). Rewrite the comparison to avoid the addition.
Reviewed by: markj
Fixes: f81cdf24ba54 ("bhyve: Add support for XML register definitions")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60847
(cherry picked from commit 5ce0ab7355264d38fcde4684f0a64347ec0f5234)
inotify: Open target the directory when adding a watch
When an application uses inotify to watch a directory,
vn_inotify_add_watch() reads the directory entries and does a name
lookup so as to induce the filesystem to create namecache entries.
Some filesystems expect the directory to be opened before VOP_READDIR
can be called, so do that.
PR: 299239
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60782
(cherry picked from commit de80428118101624aaeaae02d59665d1027ff10e)
hv_kvp: Fix some bugs and nits
- Use pending_mutex to synchronize several state flags. In particular,
ensure that two threads can't race to open the device file at the same
time.[1]
- Fix an off-by-one in hv_kvp_dev_daemon_read() that would result in a
one-byte OOB read if the caller supplied a large enough read buffer.[2]
- Change the device permissions to 0600: hv_kvp_dev_daemon_read()
returns an error until the owning process registers itself with a
write, so there's no sense in providing read-only access.
- Use bool instead of boolean_t.
- Don't return negative error numbers to userspace.
- Call seldrain() when closing the device.
Reported by: pixelpop [1][2]
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60387
(cherry picked from commit ebf1041fc854c531a27efd9f979e28d57306777d)
dhclient: Avoid out-of-bounds reads in check_classless_option()
The loop did not verify that the option buffer is large enough before
reading an address.
Reported by: Andrew Griffiths <andrew at calif.io>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60484
(cherry picked from commit 368a1bfcd49315e8dd3e56ca6744ce5d74ef737b)
bhyve: Fix virtio-input event array resizing
Use the new array size when calling realloc(). Note that this queue
stores events read from a host evdev device, i.e., it is not
guest-controlled.
While here, use the cdefs.h __unused macro and use them correctly, i.e.,
don't mark "arg" as unused when it isn't.
Reported by: Brian Delgado from Intel using Anthropic Opus 4.8
Fixes: 054accac71e0 ("Add a virtio-input device emulation.")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60679
(cherry picked from commit f1986e5b88630b1404a202251499bca0f97f5f06)
dhclient: Add some regression tests
Add tests for some recently fixed bugs in dhclient. All of these tests
set up two VNET jails connected by an epair. dhclient runs in one jail,
and the test code runs on the other end. It uses scapy to inject
"interesting" packets in response to DHCPDISCOVER messages from
dhclient, then checks the configured interface and lease file.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60485
(cherry picked from commit a143197801c680b958ab662c88cf086668a1958b)
virtio_p9fs: Mark response buffers as initialized for KMSAN
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit eca7cba74c95c8cd64c0ea4299984484784aa836)
pam_exec: fix the stderr close test and avoid a double close
The cleanup tested cherr[0] when closing cherr[1]. The parent also closed
chin[0]/chout[1]/cherr[1] after pdfork() without clearing them, so the out:
cleanup path closed them again. Clear each fd after closing and test the right
one.
Reviewed by: des, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60924
(cherry picked from commit 06abe08de45d251410949eac1bbb025367275260)
vm_kern: wrap around in kmem_back() when the last domain is empty
kmem_back() picks the domain from the address and, when that domain has
no memory, steps forward until it finds one that does:
domain = (addr >> KVA_QUANTUM_SHIFT) % vm_ndomains;
while (VM_DOMAIN_EMPTY(domain))
domain++;
Nothing stops the walk at vm_ndomains. When the empty domain is the
last one, the loop runs through the unused tail of vm_dom[] (all empty)
and on into whatever follows vm_dom[MAXMEMDOM] in memory, until a word
there happens to look like a non-zero page count; kmem_back_domain()
then allocates from that garbage domain. Ordinary allocations never
get here, because the per-domain arenas and the domainset iterators
skip empty domains. Only the direct callers of kmem_back() do: kinst
(one trampoline per thread, allocated when the module loads) and
memguard.
[8 lines not shown]
amd64/vmm: Port vlapic interface changes from illumos (duplicate)
This is a port of the bits related to vlapic-enablement of the following
bhyve improvement from illumos:
14598 bhyve vlapic should handle APICBASE changes
https://www.illumos.org/issues/14598
A LAPIC can be enabled/disabled in two ways:
- by the global-enable bit in the APICBASE MSR
- by the software-enable bit in the APIC's SVR register
This change allows distinguishing between both forms of enablement where
that matters. The more involved changes to allow guests to modify the
APICBASE MSR are not included at this time.
Reviewed by: corvink, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D56347
[2 lines not shown]
bhyve: Treat BAR registration failures as non-fatal
Some guest operating systems (at least 9front) will leave device I/O
space decoding enabled while probing BAR sizes. In this case, a
sufficiently large 32-bit BAR can overlap with the HPET MMIO region
fixed at 0xfed00000. This results in an assertion failure in
modify_bar_registration(), even though the collision is transient, i.e.,
the guest will promptly map the BAR elsewhere.
Tolerate such overlaps. Keep track of a BAR's registration state and
make sure that modify_bar_registration() doesn't try to unregister an
I/O space if registration failed.
This fixes a problem where a 32MB framebuffer ends up overlapping with
the HPET MMIO region, causing some guests to crash with an assertion
failure when probing BARs during boot.
PR: 290098
Reviewed by: bnovkov
[5 lines not shown]
nfsserver: use the destination export for the COPY/CLONE write check
The write-permission check on the destination file in
nfsrvd_copy_file_range() and nfsrvd_clone() tested
NFSVNO_EXSTRICTACCESS() on the source export instead of the destination
export.
Rick notes:
The change is harmless and mostly meaningless.
NFSVNO_EXSTRICTACCESS() is a placeholder for some site that might
not want to let the file "owner" get access despite mode bits.
The "owner override" is a hack that has existed forever in NFS,
since applications often create files with O_WRONLY, but mode 444.
This works for POSIX, but would make NFS writes fail, since they
check mode on every write, instead of just at POSIX open(). The hack
is to always allow the file owner to have write access.
Without the hack, lots of applications would break over NFS, so I
[8 lines not shown]
malloc: Fix realloc() for large allocations
min() truncates its parameters.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit ca16e7a4920415bf9d09cf76bd2c3cda7447c098)