This is a rollup commit from upstream to fix:
Improper validation of PBMAC1 parameters in PKCS#12 MAC verification (CVE-2025-11187)
Stack buffer overflow in CMS AuthEnvelopedData parsing (CVE-2025-15467)
NULL dereference in SSL_CIPHER_find() function on unknown cipher ID (CVE-2025-15468)
"openssl dgst" one-shot codepath silently truncates inputs >16MB (CVE-2025-15469)
TLS 1.3 CompressedCertificate excessive memory allocation (CVE-2025-66199)
Heap out-of-bounds write in BIO_f_linebuffer on short writes (CVE-2025-68160)
Unauthenticated/unencrypted trailing bytes with low-level OCB function calls (CVE-2025-69418)
Out of bounds write in PKCS12_get_friendlyname() UTF-8 conversion (CVE-2025-69419)
Missing ASN1_TYPE validation in TS_RESP_verify_response() function (CVE-2025-69420)
NULL Pointer Dereference in PKCS12_item_decrypt_d2i_ex function (CVE-2025-69421)
Missing ASN1_TYPE validation in PKCS#12 parsing (CVE-2026-22795)
ASN1_TYPE Type Confusion in the PKCS7_digest_from_attributes() function (CVE-2026-22796)
See https://openssl-library.org/news/secadv/ for additional details.
Approved by: so
Obtained from: OpenSSL
Security: FreeBSD-SA-26:01.openssl
Security: CVE-2025-11187
Security: CVE-2025-15467
Security: CVE-2025-15468
Security: CVE-2025-15469
Security: CVE-2025-66199
Security: CVE-2025-68160
Security: CVE-2025-69418
Security: CVE-2025-69419
Security: CVE-2025-69420
Security: CVE-2025-69421
Security: CVE-2026-22795
Security: CVE-2026-22796
The SVE signal context needs to be correctly aligned. Fix this by
creating a new macro to calculate the needed size to provide this
alignment, and use it when setting and checking the saved SVE signal
context.
Approved by: so
Security: FreeBSD-EN-26:02.arm64
Reported by: cperciva
Reviewed by: cperciva, markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D54396
(cherry picked from commit a9e77eb701)
(cherry picked from commit 683decf362)
This broke the human output formatting in several ways.
This reverts commit 4cf5878d27.
This reverts commit e8d6b58ef5.
This reverts commit c759aca606.
Approved by: so
Security: FreeBSD-EN-26:01.devinfo
PR: 291511
Reviewed by: imp, des
Differential Revision: https://reviews.freebsd.org/D54196
(cherry picked from commit 43b07bdbc5)
(cherry picked from commit ed6612dea2)
This change fixes two checks that conflated memory mapping and memory
segment idenitifers. In both cases the code iterates over all memory
mappings but passes the index to `vm_memseg_sysmem`, which is wrong.
Fix this by passing the memory mapping's segment identifier instead.
Differential Revision: https://reviews.freebsd.org/D54210
Reviewed by: markj
Fixes: c76c2a19ae
PR: 290920
Approved by: so
Security: FreeBSD-EN-25:20.vmm
(cherry picked from commit f1809eab82)
(cherry picked from commit 4f7436bf29)
FreeBSD: Fix a potential null dereference in zfs_freebsd_fsync()
In general it's possible for a vnode to not have an associated VM
object. This happens in particular with named pipes, which have
some distinct VOPs, defined in zfs_fifoops. Thus, this chunk of
zfs_freebsd_fsync() needs to check for the FIFO case, like other
vm_object_mightbedirty() callers do.
(Note that vn_flush_cached_data() calls are predicated on
zn_has_cached_data() returning true, and it checks for a NULL v_object
pointer already.)
Fixes: ef4058fcdc
Reported-by: Collin Funk <[email protected]>
Reviewed-by: Sean Eric Fagan <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Mark Johnston <[email protected]>
Closes#18015
MFC after: 3 days
Approved by: so
Security: FreeBSD-EN-25:19.zfs
(cherry picked from commit fa259d156d)
(cherry picked from commit d988a0c1fc)
Rather than fetching packages directly from the CDN which currently
backs pkgbase.freebsd.org, requests will go to pkg.freebsd.org mirrors
and be 302ed to the correct servers. This adds ~70 seconds to the
process of installing or upgrading a pkgbase system; it also orphans
systems with 15.0-{PRERELEASE,ALPHA*,BETA*} installed since they are
expecting to see pkgbase files signed with the pkg keys, not the new
pkgbase signing keys.
Approved by: re (cperciva)
Reviewed by: dch, philip
MFC after: immediately (for 15.0-RELEASE)
With hat: re
Requested by: clusteradm, core
Differential Revision: https://reviews.freebsd.org/D53964
(cherry picked from commit a3b0902d73)
(cherry picked from commit 0c87d29a54)
This is a manual page update describing the functionality that was added
to mdo(1) in commit 3ca1e69028 ("mdo(1): Add support and shortcuts for
fully specifying users and groups"). Please either refer to that commit
or the new manual page's content for more information.
While here:
- Add to the introduction a description of process credentials and some
specific vocabulary that is used throughout the page, as well as the
relationship between mdo(1) and mac_do(4).
- Update the HISTORY section.
- Add AUTHORS and SECURITY CONSIDERATIONS sections.
Approved by: re (cperciva)
Reviewed by: ziaee
MFC after: 1 minute
Sponsored by: The FreeBSD Foundation
Sponsored by: Google LLC (GSoC 2025)
Co-authored-by: Kushagra Srivastava <[email protected]>
Differential Revision: https://reviews.freebsd.org/D53905
(cherry picked from commit 73dd00f2fd)
(cherry picked from commit dc75034792)
The patch level is not part of the branch per se and should not be
used in constructing the FreeBSD-base.conf file used by bsdinstall.
Approved by: re (cperciva)
MFC after: 1 day
(cherry picked from commit d45816f369)
(cherry picked from commit 56275b7b06)
Add a fix to apply scrubbing of unsolicited NS RRSets (and their
respective address records) for YXDOMAIN and nodata non-referral
answers. This prevents a malicious actor from exploiting a possible
cache poison attack.
Approved by: so
Approved by: re (cperciva)
Obtained from: NLnet Labs
Security: FreeBSD-SA-25:10.unbound
Security: CVE-2025-11411
The upstream refactoring of ndaregister() to split out ndasetgeom()
accidentally used an uninitialed variable to decide whether or not
to set DISKFLAG_UNMAPPED_BIO. Fix this by moving that portion of
ndasetgeom() back up to ndaregister(). The check for PIM_UNMAPPED
is not really needed because nvme devices always have that set,
so it cannot change in the other path that ndasetgeom() is now called.
Approved by: re (cperciva)
Reviewed by: cperciva, gallatin, imp
Fixes: dffd882d12
Sponsored by: Netflix
MFC After: 1 minute
(cherry picked from commit 2b4dbad2db)
(cherry picked from commit e271f9327f)
For 15.0, apply a minimal fix which at least ensures that inotify can't
trigger the latent race described in commit 99cb3dca47 ("vnode: Rework
vput() to avoid holding the vnode lock after decrementing").
Approved by: re (cperciva)
Reviewed by: olce, kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53774
(cherry picked from commit ebc17879f0)
(cherry picked from commit 1f6e3abf41)
* Always install the manual page as pam_krb5(8) regardless of which
version we're using.
* Regenerate it using pod2mdoc instead of pod2man so it doesn't claim
to be part of “User Contributed Perl Documentation”.
* Put the correct section number in the header and footer.
* Don't cross-reference non-existent pam(7) manual page.
Approved by: re (cperciva)
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D53885
(cherry picked from commit 961b934407)
(cherry picked from commit 4166181675)
Not only does the new pam_krb5 module not have the same allow_kdc_spoof
option that the old one had, its behavior in this matter defaults to
insecure. Reimplement allow_kdc_spoof and switch the default back.
Approved by: re (cperciva)
Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D53884
(cherry picked from commit fe5c8baf25)
(cherry picked from commit 2eb030d1c8)
Contrary to the claim made in a previous commit, removing KDE and
adding all of vim and emacs results in an image which does not fit
into 4.7 GB; to be specific, it lands at 4.722 GB rather than the
claimed 4.689 GB. (This descrepancy resulted from doing test DVD
image builds using an out-of-date tree, and became visible when the
15.0-RC3 images were built.)
Limit the emacs packages shipped on the DVD to the "nox" flavor;
this brings the disk image down to 4.407 GB, aka under the 4.7 GB
limit for standard DVDs.
Approved by: re (cperciva)
Fixes: 6cc6beb4c8 ("release: Remove KDE from dvd1.iso")
MFC after: 1 day (for 15.0-RC4)
(cherry picked from commit c8cf5a99f8)
(cherry picked from commit 815f085600)
This key was generated by gordon@ (aka security-officer@) on an offline
system as a backup key should anything happen to the AWS Key
Management Service that is currently in use for signing pkgbase
repositories for FreeBSD 15.x.
Approved by: re (cperciva)
Reviewed by: cperciva
With hat: so
(cherry picked from commit 12ec49d8fa)
(cherry picked from commit 696b0e2209)
When the source of the copy operation is the root directory, we should
neither append it to the destination path on FTS_D nor trim it back off
on FTS_DP.
Approved by: re (cperciva)
PR: 291132
MFC after: 3 days
Fixes: 82fc0d09e8 ("cp: Partly restore symlink folllowing.")
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D53863
(cherry picked from commit fe836c5012)
(cherry picked from commit c4843e5805)
Begin documenting module loader commands in loader(8), where the reader
would look for them. Segregate them by their availability in individual
loader implementations, like build(7) targets.
These details were graciously donated by kevans.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: kevans
Co-authored-by: Kyle Evans <[email protected]>
Differential Revision: https://reviews.freebsd.org/D50727
(cherry picked from commit 6fb0d67819)
(cherry picked from commit 513b9db1a8)
console=comconsole is for the loader and boot_serial is for the kernel.
I think we should centralize documentation on the loader settings in one
manual, such a loader.8. The current proliferation is not obvious where
to find the documentation. To the user, these are all set in loader.conf
or at the loader prompt.
Approved by: re (cperciva)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53695
(cherry picked from commit 09ffaa4e07)
(cherry picked from commit 3035855815)
Approved by: re (cperciva)
MFC: immediately as 2 llms say this is impossible
Reviewed by: adrian, emaste
Differential Revision: https://reviews.freebsd.org/D53860
(cherry picked from commit a8740ba860)
(cherry picked from commit 2da71ee296)
This is the only place this important debugging tunable is documented.
Mark it up with the Va macro according to style.mdoc(5) so that people
can find it via `apropos Va=kern.msg`, the standard syntax to search
the FreeBSD manual for sysctls and tunables.
Approved by: re (cperciva)
Fixes: 6910fee62e (dmesg: Document kern.msgbuf_show_timestamp)
(cherry picked from commit e13664f6a4)
(cherry picked from commit 1c0668c5b3)
Prior to this commit, we were shipping 2155 MB of packages (from the
ports tree, not counting pkgbase) on dvd1.iso. Due to the amount of
space required by shipping pkgbase packages *and* distribution sets
on the DVD images, we only have 1696 MB available if we want to fit
into the 4.7 GB limit for DVDs. Many users have indicated that this
is indeed important.
It is practically impossible to hit this target without removing KDE;
while KDE and its dependencies narrowly fit (1550 MB), we exceed the
limit as soon as we include either of freebsd-doc-all or gnome. While
we would pick KDE over GNOME (surveys regularly indicate that KDE is
the more widely used of the two), we believe that documentation is the
most important thing to include.
Since removing KDE leaves a bit of extra space, add editors/emacs and
editors/vim. This takes the 15.0 amd64 dvd1.iso up to 4.689 GB. [1]
Approved by: re (cperciva)
Requested by: adamw [1]
MFC after: immediately (for 15.0-RC3)
Differential Revision: https://reviews.freebsd.org/D53800
(cherry picked from commit 6cc6beb4c8)
(cherry picked from commit 142df248ac)
Signal when the namespace is gone so we can tear down the disk when a
nvme drive is removed.
Approved by: re (cperciva)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032
(cherry picked from commit 4640f50089)
(cherry picked from commit b7ffac0454)
Signal the new media size when the namespace changes size.
Approved by: re (cperciva)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032
(cherry picked from commit bd769e73d8)
(cherry picked from commit 96a7ed1e7f)
Register for AC_GETDEV_CHANGED. When we receive a namespace
notification, we only create a new device if it was unconfigured. If it
was configured, generate this async event. Rely on the fact that we
reconstruct namespace to just get the data from the identify data and
call disk_resised.
Approved by: re (cperciva)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032
(cherry picked from commit 86d3ec359a)
(cherry picked from commit 9a465b37ea)
Refactor setting of geometry for the disk to its own function. No
functional changes.
Approved by: re (cperciva)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032
(cherry picked from commit dffd882d12)
(cherry picked from commit 31412fda9f)
When we get a namespace notification, we have to reconstrut the
namespace to get the new identification data from the namespace. For
each namespace in the AEN, we will reconstrict it before we call the
notification. We also flag it as changed for the duration of the change
callback (prior versions of the patch needed to keep track, but we no
longer do, so this bit may be removed). Note when we've seen the
namespace so we can notify when it goes away.
Approved by: re (cperciva)
Co-authored-by: imp
Differential Revision: https://reviews.freebsd.org/D33032
(cherry picked from commit 20e94950c5)
(cherry picked from commit fe6ee00d17)
b21e67875b tested for the good condition, not the error condition, so
we'd never do anything else in this function. This was causing certain
logging not to happen, and also prevented forthcoming namespace size
change code from working as well.
Approved by: re (cperciva)
Fixes: b21e67875b
Sponsored by: Netflix
(cherry picked from commit 27481c2689)
(cherry picked from commit fd737810a1)
OpenZFS 2.4.0 rc4
Notable upstream pull request merges:
#174771e8c96d7d Add knob to disable slow io notifications
#177925582e8b08 Update dnode_next_offset_level to accept blkid
instead of offset
#17872584762617 Pass flags to more DMU write/hold functions
#17875178a8be21 BRT: Round bv_entcount up to BRT_BLOCKSIZE
#17875e3acd0a72 Fix caching of DDT log and BRT
#1787767fc49433 Cleanup ZIO_FLAG_IO_RETRY vs TRYHARD usage
#17824dda711dbb Fix gang write late_arrival bug
#1789041878d57e Add BRT support to zpool prefetch command
#17903aaf374bd4 ZIO: Set minimum number of free issue threads to 32
#17906ac0bc4cc0 spa_misc: add an API for spa_namespace_lock
#17908583db4003 FreeBSD: Add support for _PC_CASE_INSENSITIVE
#17911 -multiple Update library ABI versions for v2.4.0
#17915e305c7d59 BRT: Fix ranges to blocks conversion math
#17916002bc3da6 BRT: Increase block size from 4KB to 8KB
#17921e895c7619 ZAP: Remove dmu_object_info_from_dnode() call
Approved by: re (cperciva)
Obtained from: OpenZFS
OpenZFS commit: 099f69ff5d
OpenZFS tag: zfs-2.4.0-rc4
(cherry picked from commit 155d5b8a19)
Our recent changes to iichid.c has caused us to attempt to read a
full REPORT instead, and at least one keyboard hangs solid when we
do that.
This patch changes us to be spec-compliant.
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D53803
MFC after: 1 day
Approved by: re(ccperciva)
(cherry picked from commit 5d53462af1)
(cherry picked from commit d61be9d994)
The packages for 15.0-RELEASE built without the bug fix needed to make
files created via @sample get properly listed in METALOG. Fix the
cloudware which contain @sample-using packages by adding the necessary
files to METALOG manually.
This should be reverted after the next full package build, and live on
only in releng/15.0.
Approved by: re (cperciva)
Reviewed by: markj
MFC after: immediately (15.0-RC2)
Differential Revision: https://reviews.freebsd.org/D53797
(cherry picked from commit f6e9474ebd)
(cherry picked from commit 96468730a2)
We ship these in order to comply with GCE Marketplace rules about
providing source code and licenses for all the software we ship as
part of images.
Approved by: re (cperciva)
Reviewed by: markj
MFC after: immediately (15.0-RC2)
Differential Revision: https://reviews.freebsd.org/D53796
(cherry picked from commit 0dbb00733c)
(cherry picked from commit 10ef3bf823)
These were forgotten during the METALOGization process earlier.
Approved by: re (cperciva)
Reviewed by: markj
MFC after: immediately (for 15.0-RC2)
Differential Revision: https://reviews.freebsd.org/D53795
(cherry picked from commit 86c63597f2)
(cherry picked from commit 0e737642f2)
Paths all need to start with "./" because that's what newfs wants.
Approved by: re (cperciva)
Fixes: e0c41af925 ("vmimage.subr: Enable FreeBSD-base repo if pkgbase")
MFC after: immediately
(cherry picked from commit aa33b6b820)
(cherry picked from commit e1560c8ba6)
When installing "extra" packages (aka those built from the ports tree),
we record everything being installed in METALOG.pkg; the contents of
that file is appended to METALOG before we generate the filesystem.
There are two cases when files recorded in METALOG.pkg will no longer
exist by the time we create the final disk image:
1. If a pkg bug results in false dependencies being installed which
are later removed by "pkg autoremove", and
2. If the pkg we build and install from /usr/ports is older than the
pkg on pkg.freebsd.org, and pkg gets upgraded automatically as part of
installing extra packages.
The ultimate issue in both cases is that there's no mechanism for
removing entries from METALOG when we run 'pkg delete'.
Address this build breakage by checking, line by line, if filesystem
objects mentioned in METALOG.pkg exist before appending them to METALOG.
Approved by: re (cperciva)
Fixes: 6a13aeac3c ("vmimage.subr: pkg autoremove after pkg install")
MFC after: immediately (needed for 15.0-RC1)
(cherry picked from commit 78fa6965e9)
(cherry picked from commit 0ff7c92517)
Running 'pkg autoremove' without -y results in VM image builds failing
when (bogusly installed) packages are removed.
Approved by: re (cperciva)
Fixes: 6a13aeac3c ("vmimage.subr: pkg autoremove after pkg install")
MFC after: immediately (needed for 15.0-RC1)
(cherry picked from commit 509dfd3690)
(cherry picked from commit 9600598a5c)
When creating a VM image using pkgbase, create a configuration file in
/usr/local/etc/pkg/repos/FreeBSD.conf which enables the FreeBSD-base
repository. (This repository is defined in /etc/pkg/FreeBSD.conf as
being disabled by default.)
Approved by: re (cperciva)
Reported by: Mark Millard
MFC after: immediately (needed for 15.0-RC1)
(cherry picked from commit e0c41af925)
(cherry picked from commit aade340587)
When performing a pkgbase install, create a configuration file in
/usr/local/etc/pkg/repos/FreeBSD.conf which enables the FreeBSD-base
repository. (This repository is defined in /etc/pkg/FreeBSD.conf as
being disabled by default.)
Approved by: re (cperciva)
Reported by: Mark Millard
Reviewed by: markj
MFC after: immediately (needed for 15.0-RC1)
Differential Revision: https://reviews.freebsd.org/D53777
(cherry picked from commit a96230e032)
(cherry picked from commit 5d9062f258)
We were doing this in vm_extra_install_packages but VM images without
any extra packages installed would not get this installed. This
results in a pkgbase system which thinks it doesn't have any packages
installed (even though all the files are right there).
Add a "metalog_add_data ./var/db/pkg/local.sqlite" call to the pkgbase
install code path, and make the call from vm_extra_install_packages
conditional on !PKGBASE.
Approved by: re (cperciva)
Reported by: Michael Dexter
MFC after: immediately (needed for 15.0-RC1)
(cherry picked from commit 10a4f2d016)
(cherry picked from commit 6b15dc234d)
We ingest Makefile.gce even when we're not trying to create GCE images
so we don't want to .error here. Instead, set GCE_ARCH to a dummy
value which should make the problem clear to anyone who attempts to
create GCE images on an unsupported architecture.
Approved by: re (cperciva)
Reported by: Jenkins
Fixes: 0a8ecca4e3 ("GCE: Specify the architecture of images")
(cherry picked from commit 787d09753f)
(cherry picked from commit 375f8df26b)
Without a specified architecture, a user can attempt to create an
arm64 instance with an amd64 image or vice versa. With the change
the API will prevent that mismatch.
Approved by: re (cperciva)
(cherry picked from commit 0a8ecca4e3)
(cherry picked from commit 93769d225f)
GCE image family is meant to be unique per set of image characteristics
so that a user can create instances using the image family instead of the
image name to reliably get a similar image with updated software, but no
other changes.
Without this change, the instances create API would select the most recent
non-deprecated image matching the name, regardless of architecture or
filesystem.
Approved by: re (cperciva)
(cherry picked from commit fc83e6c5e1)
(cherry picked from commit 0005bb76e2)
On -CURRENT and -STABLE this gets bits from pkg.freebsd.org; but we get
base system bits from pkgbase.freebsd.org for BETA/RC/RELEASE.
Note that this repository is disabled by default, but can still be used
by explicitly specifying it, e.g. "pkg upgrade -r FreeBSD-base".
Approved by: re (cperciva)
With hat: re
MFC after: 8 hours (needed in 15.0-RC1)
(cherry picked from commit 8e0b1a1c03)
(cherry picked from commit 91e1c18012)
When installing e.g. 15.0-RC1, we want to get files from the 15.0-RC1
pkgbase repository; but running 'pkg upgrade' after installation should
get the latest bits build from releng/15.0.
Approved by: re (cperciva)
With hat: re
MFC after: 8 hours (needed in 15.0-RC1)
(cherry picked from commit bdfc223c7a)
(cherry picked from commit e4bc038ef8)
For BETA/RC/RELEASE builds, fetch files from the appropriate repository
on pkgbase.freebsd.org, using the appropriate signing keys. Note that
there is a separate repository for each BETA and RC; this ensures that
someone installing from e.g. a 15.0-RC1 ISO will get 15.0-RC1 bits and
not whatever happens to be the most recent build from releng/15.0.
Approved by: re (cperciva)
With hat: re
MFC after: 8 hours (needed in 15.0-RC1)
(cherry picked from commit 51184e38c9)
(cherry picked from commit 2ce97e8003)
These keys were generated by cperciva@ using the AWS Key Management
Service. They will not be used for signing anything other than
FreeBSD 15.x pkgbase repositories.
Keys will be generated for FreeBSD 16 at a later date, and likely in
a different way.
Approved by: re (cperciva)
With hat: re
MFC after: 8 hours (needed in 15.0-RC1)
Differential Revision: https://reviews.freebsd.org/D53768
(cherry picked from commit b05f38262b)
(cherry picked from commit 01ba48e113)
The keys used for pkgbase signing are going to be placed in
/usr/share/keys/pkgbase-N where N is the FreeBSD major version
number; as such it's not sufficient to copy /usr/share/keys/pkg
into the install chroot, but instead we need /usr/share/keys/*.
Approved by: re (cperciva)
With hat: re
MFC after: 8 hours (needed in 15.0-RC1)
Differential Revision: https://reviews.freebsd.org/D53753
(cherry picked from commit 6b0909f940)
(cherry picked from commit 7c98b725a7)
TDE (make EL2 the target EL for debug exceptions) is set both when
setting guest breakpoints and when single-stepping the guest. In some
cases we may configure both capabilities, and when subsequently
disabling one of them we need to take care to avoid clearing TDE if the
other is still configured.
Approved by: re (cperciva)
MFC after: 3 days
Fixes: 75cb949228 ("arm64/vmm: Add breakpoint and single-stepping support")
Sponsored by: CHERI Research Centre (EPSRC grant UKRI3001)
(cherry picked from commit b6f25aca11)
(cherry picked from commit 295f7255a3)
When VHE mode is enabled, this results in a hang on the host. In
particular, when MDSCR_EL2.KDE is set to 1 and the CPU is executing at
EL_D, i.e., EL2, debug exceptions are enabled. In non-VHE mode, we call
into the guest by trapping to EL2, which implicitly masks debug
exceptions by setting PSTATE.D. However, in VHE mode, PSTATE.D remains
clear, so when the guest's MDSCR_EL1 value is loaded, we immediately
begin single-stepping.
In non-VHE mode there is no need to set KDE either, so just stop setting
it.
Approved by: re (cperciva)
Reviewed by: andrew
MFC after: 3 days
Sponsored by: CHERI Research Centre (EPSRC grant UKRI3001)
Differential Revision: https://reviews.freebsd.org/D48965
(cherry picked from commit ac0032344c)
(cherry picked from commit 47fdacee69)
For 32-bit processes on 64-bit architectures, a difference of 'int'
pointers was wrongly used as a number of bytes to copy in a memcpy()
used to internally construct a 64-bit 'struct setcred' from the 32-bit
variant, leading to copying only part of the 32-bit structure, and thus
to requesting credentials with garbage IDs except for the real and
effective user IDs.
This bug was spotted by jhb@, who produced a slightly more invasive fix
in D53757 (a switch to using CP() on all fields). In the interest of
minimizing the diff for possible inclusion in 15.0, the commit here just
limits itself to fixing the number of bytes to copy.
Tested successfully on a VM with 32-bit mdo(1) (and in passing also
tested that the same executable on a kernel without this change exhibits
the bug in practice, in the form of setcred() failing with EINVAL).
Reported by: jhb
Reviewed by: jhb
Fixes: ddb3eb4efe ("New setcred() system call and associated MAC hooks")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53767
(cherry picked from commit 4872b48b17)
For the insta-MFC to stable/15:
Approved by: re (cperciva)
(cherry picked from commit 190e6d6795)
These are user-facing manpages, but were installed in the runtime-dev
package since the PAM modules use bsd.lib.mk. Use MANNODEV instead of
MAN to put them in the base runtime package instead.
Approved by: re (cperciva)
Fixes: 031e711647 ("packages: Install development manpages in the -dev package")
MFC after: 3 days
Reviewed by: bapt
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53601
(cherry picked from commit b1972bd9a0)
Historically, lam(1) closes stdin once we've hit EOF the first time,
which would stop it from doing anything else on subsequent gatherline()
calls with another openfile. However, this doesn't seem to be strictly
necessary- the EOF flag on FILEs is quite sticky, so we can assume that
a subsequent fgetc(stdin) will flag EOF properly.
This 'fixes' the below-referenced commit in the sense that it surfaced
this problem as a fatal error, but the issue was pre-existing. If we
do `lam - -`, then one gatherline() will fclose(stdin) and set `ip->eof`
for *that* openfile, while the next one will then observe that
STDIN_FILENO has been closed and turn it into an EBADF.
Add a few tests that were easy to snipe while I'm here, but I haven't
aimed for anything close to exhaustive because I think re@ would prefer
this fix go in sooner rather than later to land in 15.0.
Minor style adjustment for the previous commit while we're here.
Approved by: re (cperciva)
Reported by: cperciva
Discussed with: jrtc27
Reviewed by: des, jlduran
Fixes: 4472fd66d0 ("lam: fail on I/O errors")
Sponsored by: Klara, Inc.
(cherry picked from commit 6a9452c837)
(cherry picked from commit 1d678ba575)
pccard has been declared obsolete for a long time and also the
support has been removed but the man page still exists. It mentions
being scheduled to be removed before 13.0 but it still exists in the
tree.
[Extracted from review D53434]
Approved by: re (cperciva)
Reviewed by: emaste
Fixes: 31b35400c ("pccard: Remove more of the PC Card infrastructure")
(cherry picked from commit 5b9fba1cb0)
(cherry picked from commit 8bafd2f052)
+ tag SPDX
+ add sysctl to apropos database
+ fix markup of examples and reflow a overly long line
+ add a hardware section for hw relnotes
Approved by: re (cperciva)
MFC after: 3 days
(cherry picked from commit dee8e38f52)
(cherry picked from commit ccf4b4fc42)
Approved by: re (cperciva)
MFC after: 2 days (squashed with fixup commit)
Reviewed by: ziaee
Fixes: 31b35400c (pccard: Remove more of the PC Card)
Discussed with: bsdimp, emaste, jhb
Extracted from: https://reviews.freebsd.org/D53434
(cherry picked from commit 1d9f2db7c0)
(cherry picked from commit 6aaf184dc4)
(cherry picked from commit feb8971db4)
Explain driver loading and application access in the body of the manual.
Crossreference other game controller driver manuals, and devfs.rules to
hint about how to configure application access. Add a common dongle to
supported hardware. Add evdev a few places to make it really clear how
it works.
Approved by: re (cperciva)
MFC after: immediately for inclusion in 15.0R
Reviewed by: wulf
Differential Revision: https://reviews.freebsd.org/D53290
(cherry picked from commit c0c8d812b5)
(cherry picked from commit 31e7ee6bd5)
Only i386 has a four-byte alignment for uint64_t, others have
eight-byte alignment. This causes the structure to mismatch
on armv7 binaries running under aarch64, breaking the aio interface.
Approved by: re (cperciva)
Fixes: 3858a1f4f5
Approved by: markj (mentor)
Reported by: Mark Millard <[email protected]>
Discussed with: jrtc27
PR: 290962
MFC after: immediately (for 15.0)
(cherry picked from commit ea26fd52a9)
There is a pool feature, dynamic_gang_header, that is enabled by default
in new pools. When this feature is active, gang headers may be larger
than 512 bytes. The loader needs to be taught to cope with that.
Try using the vdev ashift to pick the gang block header size. If the
checksum fails, fall back to the old gang block header size.
This is based on a patch by Paul Dagnelie, with testing, bug-fixing and
some simplifications from me.
Approved by: re (cperciva)
PR: 289690
Co-authored by: Paul Dagnelie <[email protected]>
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53578
(cherry picked from commit 4d6801a6b5)
(cherry picked from commit ae17780c71)
We need to specify the correct image names -- *.vhdf, not *.vhd -- in
order for them to upload.
15.0 candidate
Approved by: re (cperciva)
Reviewed by: lwhsu
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D53684
(cherry picked from commit df84867e8a)
(cherry picked from commit eee338692b)
When starting to scan and ending a scan we clear/set the hardware to
idle. Similarly we set the hw to idle when we remove the channel
context but when starting we only set it to non-idle when we went from
assoc to run. This apparently was not a problem most of the time
as the switch from a failed hardware scan to a software scan was
racing against net80211. ad4ddc83eb fixed that specifically for
rtw88 and while we were more consistently scanning, this broke
authentication as the setting of idle at the end of the scan was
now happening reliably. Move the unsetting of idle from assoc_to_run
to scan_to_auth for when we create the chanctx to keep it
symmetrical. This makes authentication work again for rtw88 (though
not for everyone due to other possible problems with net80211).
This likely also fixes the problems in the listed PRs.
iwlwifi(4) mvm and mld driver parts do not use this information at
all and were never affected.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
PR: 290850, 288186, 281979
PR: 272145 (the non skb-mem-limit parts)
(cherry picked from commit b568711f8e)
(cherry picked from commit a77abd53e8)
This is consistent with other operating systems and with bsdinstall's
UFS config and with bsdinstall's ZFS config prior to commit
0b7472b3d8.
Approved by: re (cperciva)
PR: 290857
Fixes: 0b7472b3d8 ("Mount the EFI system partition (ESP) on newly-installed systems.")
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53642
(cherry picked from commit 4109cdf0f8)
(cherry picked from commit 65e347d315)
Transmit segment offloading depends on transmit checksum offloading.
Enforce that constraint. This also fixes a bug, since if_hwassist bits
are from the CSUM_ space, not from the IFCAP_ space.
Approved by: re (cperciva)
PR: 290773
Reviewed by: Timo Völker
Tested by: [email protected]
Differential Revision: https://reviews.freebsd.org/D53629
(cherry picked from commit 4c50ac6816)
(cherry picked from commit 0fb0ba51d8)
According to section 5.1.6.2.1 of version 1.3 of the virtio
specification, the driver MUST NOT set VIRTIO_NET_HDR_F_DATA_VALID in
the flags. So don't do that.
Approved by: re (cperciva)
Reviewed by: Timo Völker
Differential Revision: https://reviews.freebsd.org/D53650
(cherry picked from commit 836b3cd9d7)
(cherry picked from commit 0ef06b5bcc)
When a SYN ACK is received for a listening socket, just drop it
instead of killing the SYN-cache entry and send a RST.
This closes the possibility to kill a TCP connection during its
handling in the SYN-cache.
Approved by: re (cperciva)
Reviewed by: Nick Banks, Peter Lei
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D53540
(cherry picked from commit 239464e993)
(cherry picked from commit e082156ae1)
The second and third members of struct bsddialog_menuitem are `bool on`
and `unsigned int depth`. The newfs dialog options in bsdinstall's
partition tool had these two swapped, so the default selection did not
work.
Approved by: re (cperciva)
PR: 290857
Reviewed by: asiciliano
Fixes: 50e244964e ("bsdinstall/partedit: Replace libdialog with libbsddialog")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53639
(cherry picked from commit 4e36942420)
(cherry picked from commit 980aa8d4cf)
and one that will be with us in the long-term future.
(this helps reduce diffs in the future and for down-stream users
that trim entropy sources). Also, move deprecated (removed in 16.0)
sources to the bottom of the list to reduce changes to 15.x.
Approved by: re (cperciva)
Reviewed by: glebius
Obtained from: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D53311
(cherry picked from commit 9f3886347c1750cf80a82314470fc7186088eb9a)
(cherry picked from commit e224f2c1b9)
Unbootstrapped pkg will ignore -N if -r is specified first. Flip the
order.
Prior to commit 66c75fa63a this worked by accident.
Approved by: re (cperciva)
PR: 290393
Reported by: olgeni
MFC after: 3 days
Fixes: 66c75fa63a ("freebsd-update: Fix the pkgbase check")
(cherry picked from commit 645352316b)
(cherry picked from commit addc0556ce)
We have NO_ROOT here, so we need WITHOUT_QEMU to avoid problems.
15.0 candidate.
Approved by: re (cperciva)
Reviewed by: emaste, markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53637
(cherry picked from commit f89aa18848)
(cherry picked from commit 2e2a460f9a)
The access of vq->vq_ring.used->idx needs to be volatile-qualified,
otherwise the compiler may optimize virtqueue_poll() into an infinite
loop if there is no data available upon the first poll.
Prior to commit ad17789a85 this wasn't a problem since an external
function call after each poll inhibited the optimization.
Approved by: re (cperciva)
PR: 289930
MFC after: 3 days
Sponsored by: Klara, Inc.
Fixes: ad17789a85 ("virtio: Remove the unused poll method")
(cherry picked from commit f999ffdce3)
(cherry picked from commit 72c7604754)
Commit 9065390ddc moved atf to its own package, but mistakenly moved
the tests as well. Put the tests back into the test package.
Approved by: re (cperciva)
Fixes: 9065390ddc ("packages: Remove the tests-dev package")
MFC after: 1 day
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53594
(cherry picked from commit 4b342830ab)
(cherry picked from commit cdfa913977)
libcrypto's Makefile.inc used PACKAGE=openssl, which overrides the
PACKAGE=tests in libcrypto/tests/Makefile. Use PACKAGE?=openssl
instead to avoid this. This puts the OpenSSL tests in the tests
package where they belong.
Approved by: re (cperciva)
MFC after: 1 day
Reviewed by: manu, ngie
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53595
(cherry picked from commit c3b853fe52)
(cherry picked from commit 4e672f6ff0)
Tag SPDX while here. This is not a content change, so do not bump date.
Approved by: re (cperciva)
PR: 274164
MFC after: 3 seconds
(cherry picked from commit 3f0dd77246)
(cherry picked from commit 9a6e6e9edc)
This manual is large enough and well structured enough that we can have
a clickable table of contents. Use that to move some subsections which
should not appear in Hardware Release Note to the description section.
Adjust subsection names so this will work, preserving parentheticals
for search by moving them to the bodies just below.
Strip unnecessary copyright symbols and escaped hyphens. Copyright
symbols never appear in the content of manual pages, including other
Intel manual pages, and appear to break the Hardware Release Notes.
Escaped hyphens were necessary decades ago for manual pages written
in man(7), but this page is written in mdoc(7). Also misc touchups.
Add the recently added E835 devices to the supported HARDWARE list.
Add the speed ranges to description like the other ethernet drivers.
Approved by: re (cperciva)
PR: 290778
MFC after: 1 day
Fixes: 09b48f811b (Add support for E835-XXV-4 adapter)
Fixes: b202176dc7 (Add PCI IDs for E835 devices)
Reviewed by: kgalazka (previous version)
Reported by: kgalazka (additional hardware has been added)
Reported by: [email protected] (HW Relnote is truncating)
(cherry picked from commit f30335c5cb)
(cherry picked from commit 71bd17b879)
The examples only show the usage of `-c <numcpus>`, as did the flag
description, however the -c flag supports more complex cpu topology
specifiers. These were documented correctly in SYNOPSIS, add them to
the body of the DESCRIPTION as well. Someone could go further and do
and example with using them.
Approved by: re (cperciva)
MFC after: 3 days (there was a merge conflict with the date)
Event: OpenZFS Developer Summit '25
Reported by: Levi Worley <[email protected]>
(cherry picked from commit 205af037e3)
(cherry picked from commit 772837c632)
Ensure that the number of elements of random_source_descr[]
and fxrng_ent_char[] matches that of enum random_entropy_source.
Approved by: re (cperciva)
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D53255
(cherry picked from commit 8bd9a9e9e4)
(cherry picked from commit d53618d582)
Approved by: re (cperciva)
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
(cherry picked from commit 93b02f69a6)
(cherry picked from commit 3a9bcf8dee)
This package only exists on amd64, which means on other platforms we
produce an empty package containing nothing but this directory, and
without a base package (libipt) that package fails to install due to
a missing dependency.
For now, fix this by removing the libipt-dev package tag, which moves
this directory to clibs.
Approved by: re (cperciva)
Fixes: 436618a427 ("etc/mtree: Add package tags for /usr/include")
Reported by: cperciva
MFC after: 3 seconds
(cherry picked from commit 2a8a6179eb)
(cherry picked from commit ccd948829c)
We want to fetch distfiles, regardless of whether they contain known
vulnerabilities or we're building images for a different version of
FreeBSD.
Approved by: re (cperciva)
Reviewed by: ivy
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53569
(cherry picked from commit 8234c1899b)
(cherry picked from commit 3b01c7da327853e9f3347ff0cae9d075460f5a27)
In order to comply with the require that GCE images must include their
source code, we fetch distfiles for all of the packages installed into
GCE images. This fails for obvious reasons for packages with an origin
of base/*; filter those out to generate the list to fetch.
Approved by: re (cperciva)
Reviewed by: ivy
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53568
(cherry picked from commit 05b3a45cd0)
(cherry picked from commit 92ab9516c8a5d196b60ac8f6df777de745aaa219)
GCE images are required by Google to include their source code; we do
this by extracting {src,ports}.txz into the images, from the (legacy)
distribution sets.
Make sure those distribution sets actually exist.
Approved by: re (cperciva)
Reviewed by: ivy
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53567
(cherry picked from commit 7f536b1c11)
(cherry picked from commit a1b00e368926198a163015bfe21171f2d582c703)
A bug in pkg, which somehow only surfaced as a consequence of pkgbase,
results in pkg install sometimes pulling in false dependencies. This
problem might be limited to cases when the lib32 pkgbase packages are
not installed. In the case of EC2 "small" images, installing the
ebsnvme-id package results in binutils, gcc12-devel, gmp, indexinfo,
liblz4, mpc, mpfr, and zstd packages being installed.
These false dependencies are however not recorded as dependencies --
at some level pkg does understand that they're not needed -- so running
pkg autoremove immediately after pkg install cleans them up.
Note: This does not remove lines from METALOG corresponding to these
packages, and makefs emits an error when it attempts to create the
filesystem but cannot find the files listed in METALOG -- but makefs
does seem to complete normally despite the error messages.
This change should be reverted once the pkg issue has been located and
fixed.
Approved by: re (cperciva)
Reviewed by: ivy
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53543
(cherry picked from commit 6a13aeac3c)
(cherry picked from commit a21cff76c57089cd357473128d42410d189ca149)
In order to make sure that man pages are all installed before we run
makewhatis to generate mandoc.db files, we have long placed etc at the
end of the list of subdirectories being recursed into by the build.
In order to support installworld -jN, a .WAIT was more recently added
here.
With the recent adoption by the release engineering team of parallel
*release* builds (aka 'make release -jN') it is now also necessary to
add the same .WAIT before recursing for the 'distribute' target, as we
otherwise end up with distribution sets containing incomplete mandoc.db
files.
Approved by: re (cperciva)
Reviewed by: bdrewery
PR: 289683
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53533
(cherry picked from commit dcb6706ba4)
(cherry picked from commit 48dbf763337aea30e29971e751d3aa1044a555ef)
Approved by: re (cperciva)
Reviewed by: markj
MFC after: 3 days
Fixes: f1995d6fc1 ("release: Prepare GCE cloudware images for building as non-root")
Differential Revision: https://reviews.freebsd.org/D53530
(cherry picked from commit c3a3af1346)
(cherry picked from commit 6e47589eb067e5a22cce9f351ecf12bd2ffa9e4d)
When credentials are changed, we need to adjust the sum of resources
associated to the initial and new process' user IDs (and old and new
login classes and jails, but setcred() does not change them) for them to
stay consistent.
Approved by: re (cperciva)
PR: 290352
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53457
(cherry picked from commit 2be5127c4a)
(cherry picked from commit 2e76660cb7)
Affected system calls: setuid(), setreuid(), setresuid(), jail_attach(),
setloginclass().
In these system calls, the crhold() calls that, on RACCT, make the
just-installed process credentials survive a concurrent change of the
same credentials just after PROC_UNLOCK() were not matched by
a corresponding crfree() when RCTL is off. In fact, in that latter
case, they are simply not necessary, so wrap them with '#ifdef RCTL'
stances. 'kern_rctl.c' causes a compile error if RACCT is not defined
but RCTL is, so ease reading by not nesting '#ifdef's.
Approved by: re (cperciva)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53456
(cherry picked from commit f4315ff8b3)
(cherry picked from commit 4db768b01c)
Unterminated strings in the anchor or name could cause crashes.
Validate them, and add a test case.
Approved by: re (cperciva)
Reported by: Ilja Van Sprundel <[email protected]>
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 1da3c0ca5b)
(cherry picked from commit 909528f8a1)
Both for the DIOCADDSTATE ioctl and for states imported through pfsync packets.
Add a test case to exercise this code path.
Approved by: re (cperciva)
Reported by: Ilja Van Sprundel <[email protected]>
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit faacc0d968)
(cherry picked from commit 4891e6f1c0)
We were using the m_quit bit for two similar but distinct uses:
* To instruct the server to quit
* To cope with the kernel forcibly unmounting the fs
Fix the intermittent test failure by adding a separate bit,
m_expect_unmount, to handle cases like the latter.
Approved by: re (cperciva)
Reported by: Siva Mahadevan <[email protected]>
MFC after: 1 week
Revied by: Siva Mahadevan <[email protected]>
Differential Revision: https://reviews.freebsd.org/D53357
(cherry picked from commit d86025c1d4)
(cherry picked from commit f0cf086c05)
This test implicitly depended on the order in which two threads
completed. If the test thread finished first, the test would pass. But
if the mock file system thread did, it would attempt to read from an
unmounted file system, and fail. As a result, the test would randomly
fail once out of every several thousand executions. Fix it by telling
the mock file system's event loop to exit without attempting to read any
more events.
Approved by: re (cperciva)
Reported by: Siva Mahadevan <[email protected]>
MFC after: 1 week
Reviewed by: Siva Mahadevan <[email protected]>
Differential Revision: https://reviews.freebsd.org/D53080
(cherry picked from commit d1bd541b38)
(cherry picked from commit a1c3537148)
FUSE protocol 7.33 extended the FUSE_SETXATTR request format. But the
extension is optional. The server must opt-in by setting the
FUSE_SETXATTR_IN flag during FUSE_INIT. We were wrongly using the
extended format for any server using protocol 7.33 or later.
Approved by: re (cperciva)
PR: 290547
Co-authored-by: CismonX <[email protected]>
Fixes: d5e3cf41e8 ("fusefs: Upgrade FUSE protocol to version 7.33")
MFC after: 3 days
(cherry picked from commit e8449c0e0f)
(cherry picked from commit a23bd71dea)
Set the default package to clibs-dev, since that's where the vast
majority of include files comes from. Add explicit package tags
for the directories which are installed in their own package.
Approved by: re (cperciva)
MFC after: 1 day
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53577
(cherry picked from commit 436618a427)
(cherry picked from commit 736771f631)
As set-base depends on set-optional, so should set-base-dbg depend on
set-optional-dbg. Otherwise, people who install set-base-dbg will be
missing a bunch of debug packages.
Approved by: re (cperciva)
MFC after: 1 day
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53575
(cherry picked from commit 3bcb297770)
(cherry picked from commit 5f1d2ef1f5)
libkadm5clnt_mit installs a symlink from libkadm5clnt.so for backward
compatibility, but it neglected to include the package tags, so the
symlink was missing from pkgbase builds. Add ${DEV_TAG_ARGS} to the
install command.
Approved by: re (cperciva)
Reported by: Mark Millard <[email protected]>
MFC after: 1 day
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53574
(cherry picked from commit 707507c27f)
(cherry picked from commit dd9ba3201b)
The libcasper package exists to contain libcasper, but for some reason
only the libcap_net service was in the package, with libcasper itself
and the rest of the services being in runtime. Move everything to the
libcasper package, except tests which stay in the tests package.
Approved by: re (cperciva)
MFC after: 1 day
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53576
(cherry picked from commit b8697ac70e)
(cherry picked from commit 25eb50f68b)
The contents of the memory is an output, but the pointer to that memory
is an input. This was correct in the original version of D45697, but
when adding appropriate clobbers, the pointer operand was incorrectly
switched to an output rather than left an input for fpe_store.
Approved by: re (cperciva)
Reviewed by: jrtc27
Obtained from: CheriBSD
Fixes: 44d4ee7f3d ("riscv: add FPE code.")
MFC after: 1 day
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D53441
(cherry picked from commit 91f66f9b37)
(cherry picked from commit 0b5e4af65d)
The .pc files generated in the root directory are used as part of the
build; they should never be installed. Use the versions from the
exporters subdirectory--which should be installed--as the .pc files
which are distributed with FreeBSD. This avoids the need for "fixing up"
these files after the fact (see `crypto/openssl/BSDmakefile` for more
details as part of this change).
Garbage collect `secure/lib/libcrypto/Makefile.version`, et al,
as they're orphaned files. They were technically unused prior to this
change as the vendor process properly embeds the version numbers in
various files, but this commit formalizes the removal.
This correction/clarification on the .pc files will be made in an
upcoming release of OpenSSL [1].
References:
1. https://github.com/openssl/openssl/issues/28803
Approved by: re (cperciva)
Suggested by: Richard Levitte (OpenSSL project)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53043
(cherry picked from commit 97388e7215)
(cherry picked from commit 9b84a17c0a)
These files contain build host paths and other configuration details
that can be regenerated via the standard vendor import process. Don't
clutter up the FreeBSD tree with these files.
Add the paths to .gitignore to prevent them from accidentally being
added in a future update.
Approved by: re (cperciva)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53044
(cherry picked from commit d271d2ce15)
(cherry picked from commit 0d5ef734e9)
This change adds a simple smoke test for the legacy provider to ensure
that the provider doesn't break in the future when performing updates.
This is not a functional or system test; the OpenSSL test suite does a
much better job at doing this than we can.
Approved by: re (cperciva)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53045
(cherry picked from commit 3b6442370a)
(cherry picked from commit 9b3c89ce8b)
Approved by: re (cperciva)
MFC with: 046c625e93
Fixes: 046c625e93 ("crypto/openssl: update to 3.5.4")
Reported by: Herbert J. Skuhra <[email protected]>
(cherry picked from commit d4033e6d37)
(cherry picked from commit 505aec2bf3)
This change includes all necessary changes required to update to OpenSSL
3.5.4.
More information about the 3.5.4 release can be found in the relevant
release notes (see 8e12a5c4eb for more details).
Merge commit '8e12a5c4eb3507846b507d0afe87d115af41df40'
Approved by: re (cperciva)
(cherry picked from commit 046c625e93)
(cherry picked from commit 57d1d2c497)
This change updates the build artifacts to match the 3.5.3 release. Much
of the change involves updating version numbers and release dates to
match the release version's metadata.
Approved by: re (cperciva)
MFC after: 1 week
MFC with: 88b8b7f0c4
(cherry picked from commit d9cc3d558d)
(cherry picked from commit 41955f207f)
This change updates the sources for crypto/openssl. The subsequent
commit will update the build artifacts to match the 3.5.3 release.
More details about the update can be found in the related vendor branch
commits.
Approved by: re (cperciva)
MFC after: 1 week
Merge commit 'aed904c48f330dc76da942a8ee2d6eef9d11f572'
(cherry picked from commit 779e075df9)
This change does the following 2 things:
- Makes the build more repeatable by isolating the environment. This
prevents bmake from leaking variables into gmake and makes the overall
process a bit more robust.
- Add debug printouts to make the process more straightforward to the
reader and whoever is executing doing the current vendor import.
Approved by: re (cperciva)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D52420
(cherry picked from commit d18058b7b8)
(cherry picked from commit 22382d9e70)
m_pullup() here will have freed the mbuf chain, but we pass back an
IP_FW_DENY without any signal that the outer loop should finish. Thus,
rule processing continues without an mbuf and there's a chance that we
conclude that the packet may pass (but there's no mbuf remaining)
depending on the rules that follow it.
Approved by: re (cperciva)
PR: 284606
Reviewed by: ae
(cherry picked from commit c0382512bf)
(cherry picked from commit 21d55ae111)
Rather than add more ifdefs, trust the compiler to optimize Aflag away.
Approved by: re (cperciva)
Fixes: 70b72ede98 ("id: Clean up")
PR: 290740
MFC after: 3 days
(cherry picked from commit 92a533ed1d)
(cherry picked from commit 05a3f80efe)
LINKER_EACH_FUNCTION_NAMEVAL() stops processing the symbol table if a
callback function returns a non-zero value.
The fbt_provide_module_function() callback should not return 1 when
ignoring symbols. Instead, always return 0, as in dtrace/x86.
Approved by: re (cperciva)
Fixes: 30b68ecda8 ("Changes that improve DTrace FBT reliability on freebsd/arm64:")
Reviewed by: markj, oshogbo
Approved by: oshogbo (mentor)
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D53399
(cherry picked from commit 2acdec9e4d)
(cherry picked from commit 76a0a5f91d)
After commit 530c2c30b0 we need to set flags to ensure that hop-by-hop
and hop limit options are included.
Approved by: re (cperciva)
PR: 290407
Reviewed by: zlei, markj
MFC after: 3 days
Fixes: 530c2c30b0 ("ip6_output: Reduce cache misses on pktopts")
(cherry picked from commit 5568fba657)
(cherry picked from commit 5c4144fe1f)
ATM support for netgraph was removed in af0cc0b223 ("NgATM: Remove
netgraph ATM support")
Remove the directory from the mtree specification.
Approved by: re (cperciva)
Reviewed by: emaste
Fixes: 21735dfaeb ("include: Remove no longer existing netgraph/atm")
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D53260
(cherry picked from commit 8e8ee8bbe2)
(cherry picked from commit 002ce2c9d0)
static_libpam's Makefile includes libpam's Makefile after setting some
variables (like MAN) to empty to avoid installing the manpages twice.
After commit 031e711647, it neglected to do this for MANNODEVLINKS,
causing pam.d.5.gz to be installed twice. This is harmless for
installworld, but breaks some things that rely on METALOG (NO_ROOT
installs) since it causes two METALOG entries to be generated for
the same file.
Approved by: re (cperciva)
Fixes: 031e711647 ("packages: Install development manpages in the -dev package")
MFC after: 3 days
PR: 290708
Reported by: emaste
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53512
(cherry picked from commit a1806e6ff3)
(cherry picked from commit 92a081bc2d)
parse_vlans() does 's = strdup(str)', then calls strsep(&s, ...), then
attempts to free(s) at the end of the function. For the success case,
this is fine (s is NULL, so it's a trivial memory leak), but in the
error case, we will attempt to free an invalid pointer.
Fix this by storing the original return value from strdup() and freeing
that instead.
Approved by: re (cperciva)
MFC after: 3 seconds
Reported by: David Gwynne <[email protected]>
Reviewed by: zlei, kevans
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53545
(cherry picked from commit 0899f7a3b7)
(cherry picked from commit fe2e534433)
Version for change and feature requests.
* Improve documentation for --alternate-screen and --normal-screen.
Request: https://bugs.freebsd.org/285459. (This PR is not about
bsddialog itself but is used as an example for an official FreeBSD
documentation request.)
* Reduce the number of screen refreshes to improve performance over a
115200 UART connection.
Request: https://gitlab.com/alfix/bsddialog/-/issues/8.
* Change textbox buttons to return distinct values (previously always
returned OK).
Request: https://reviews.freebsd.org/D48668; already committed in
contrib/ 96a241a359
* Change forms navigation key behavior for ENTER and TAB.
Request: https://bugs.freebsd.org/287592.
Refer to /usr/src/contrib/bsddialog/CHANGELOG to know more.
PR: 287592
Reported by: adrian
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
Merge commit '653f765f05b8c7e3908ae92e9bf61522a50cefc9' into YYY
(cherry picked from commit 3e42d7194b)
(cherry picked from commit aa2fe36f5e)
The NVMe spec allows the Table BIR (TBIR) and PBA DIR (PBIR) to
be 0, 4, or 5. The existing NVMe driver basically only has support
for 4, perhaps under the assumption that BAR4 is 64-bit and also
occupies BAR5.
This change adds support for BAR5, covering the case where BAR4
and BAR5 might both be present and 32-bit, where the Table BIR
might be 4 and the PBA BIR might be 5, or vice versa.
The NVMe spec (in the SR-IOV section) also permits VFs to use BIR=2,
so I haven't added stricter checks on which BIR will be permitted
by the driver.
This enables FreeBSD on Google Compute Engine C4 Machines.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: imp
Sponsored by: Google
Co-authored-by: Matt Delco <[email protected]>
Signed-off-by: Jasper Tran O'Leary <[email protected]>
Differential Revision: https://reviews.freebsd.org/D53140
(cherry picked from commit 7b32f4f0a7)
(cherry picked from commit 6c321dc15d)
Add device IDs and branding strings for E835 adapters.
This is a follow up for E830 adapters with Security Protocol
and Data Model (SPDM) support and RDMA support available
on 100 and 200Gbps links.
Signed-off-by: Krzysztof Galazka <[email protected]>
Approved by: re (cperciva)
Approved by: kbowling (mentor), erj (mentor)
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D52782
(cherry picked from commit b202176dc7)
(cherry picked from commit 16004d2a9e)
This change reapplies the improvements from commit 89e7335 and adds
additional fixes and code optimizations on top of it.
The ixl driver supports up to 128 multicast filters in hardware. When this
limit is exceeded, the driver should enable multicast promiscuous mode.
When the count drops below 128, it should disable promiscuous mode and
restore individual filters.
The driver previously had problems that could corrupt multicast filters list.
The main issue was that ixl_dis_multi_promisc() would attempt to disable
promiscuous mode without checking if it was actually enabled, potentially
corrupting existing filters. There was also no state tracking across driver
functions, leading to redundant operations.
This change adds an IXL_FLAGS_MC_PROMISC flag to track the multicast
promiscuous mode state. The flag is set when enabling promiscuous mode and
cleared when disabling it. Early return checks prevent redundant operations
when the mode is already in the desired state, avoiding filter corruption
and unnecessary hardware calls.
Signed-off-by: Yogesh Bhosale [email protected]
Approved by: re (cperciva)
PR: 283820
Approved by: kbowling (mentor)
Tested by: gowtham.kumar.ks_intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D52549
(cherry picked from commit 46a8a1f08f)
(cherry picked from commit f3c442950d)
Virtual Functions have access to a limited number of registers,
and their bus space size is lower. Use KASSERT to detect out-of-bounds
access and eliminate them to avoid kernel panics in production
environment.
Signed-off-by: Krzysztof Galazka <[email protected]>
Approved by: re (cperciva)
Reviewed by: jmg
Tested by: mateusz.moga_intel.com
Approved by: kbowling (mentor), erj (mentor)
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D52976
(cherry picked from commit 2c02e6ca71)
(cherry picked from commit 9d84e9cba1)
We emit a warning if src.conf options WITH_RETPOLINE or INIT_ALL are
in use, and the compiler or linker does not support the feature.
For targets like `cleandir` we skip including bsd.compiler.mk, which
leaves COMPILER_FEATURES unset and spurious warnings were emitted in
early buildworld stages, if these options are in use.
Commit 0837b2ebd5 ("pkg: Die if make -V BRANCH fails") added -W to
usr.sbin/pkg's make flags, causing it to exit on warnings. As a result
buildworld failed when these src.conf options were in use.
Clean this up by omitting the warning if the magic
_NO_INCLUDE_COMPILERMK flag is set, which indicates that
COMPILER_FEATURES is not set.
Approved by: re (cperciva)
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53501
(cherry picked from commit e4f2a35095)
(cherry picked from commit 1471af5110)
A FUSE daemon can send asynchronous notification to the kernel in order
to, for example, invalidate an inode's cache. Fix a page fault that can
happen if the file system isn't yet mounted, or is already unmounted,
when that notification arrives.
Approved by: re (cperciva)
PR: 290519
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53356
(cherry picked from commit 5d42c88139)
(cherry picked from commit 25e368c4da)
libarchive 3.8.2
Important bugfixes:
#2477 tar writer: fix replacing a regular file with a dir for
ARCHIVE_EXTRACT_SAFE_WRITES
#2659 lib: improve filter process handling
#2664 zip writer: fix a memory leak if write callback error early
#2665 lib: archive_read_data: handle sparse holes at end of file correctly
#2668 7zip: Fix out of boundary access
#2670 zip writer: fix writing with ZSTD compression
#2672 lib: fix error checking in writing files
#2678 zstd write filter: enable Zstandard's checksum feature
#2679 lib: handle possible errors from system calls
#2707 lib: avoid leaking file descriptors into subprocesses
#2713 RAR5 reader: fix multiple issues in extra field parsing function
#2716 RAR5 reader: early fail when file declares data for a dir entry
#2717 bsdtar: Allow filename to have CRLF endings
#2719 tar reader: fix checking the result of the strftime (CVE-2025-25724)
#2737 tar reader: fix an infinite loop when parsing V headers
#2742 lib: parse_date: handle dates in 2038 and beyond if time_t is big
enough
Approved by: re (cperciva)
Obtained from: libarchive
Vendor commit: 7f53fce04e4e672230f4eb80b219af17975e4f83
Security: CVE-2025-25724
PR: 290303 (exp-run)
MFC after: 1 week
(cherry picked from commit 401026e482)
(cherry picked from commit f55001cc9f)
The nfsuserd(8) daemon passes user credentials
(uid + gids) into the kernel for users and groups
identified by name (received from a NFSv4 server).
This patch add a sanity check for the number of
groups (nid_ngroup) passed in.
It's only purpose is to protect against a bogus
nfsuserd(8) running in a jail.
Approved by: re (cperciva)
(cherry picked from commit 4672adcea4)
(cherry picked from commit 83a0732a4c)
The "rlen" reply length for a Write operation/RPC
could cause trouble if a broken server replies with
too large a value.
Improve the sanity check for "rlen" to avoid this.
Approved by: re (cperciva)
(cherry picked from commit 2c82cdd2e2)
(cherry picked from commit b5b6ddfc99)
There are two cases in nfs_clrpcops.c where it was possible
for the code to attempt to NFSM_DISSECT() a large size,
which is not allowed by nfsm_dissct().
This patch fixes them.
Reducing the maximum stripecnt should be no problem,
since there in no extant NFSv4.n server that does striped
File Layout pNFS and current development is centered
around the Flex File layout.
Approved by: re (cperciva)
(cherry picked from commit b9e6206f59)
(cherry picked from commit 609c4eb70a)
The reply to CreateSession includes the slot cnt for
both fore and back slots. It should never be larger
than the argument specified and the fore slot cnt
should always be at least 1.
Without this patch, the replied slot cnts were not
being sanity checked.
While here, replace 64 with NFSV4_SLOTS (which is 64).
Approved by: re (cperciva)
(cherry picked from commit 3053b2a3dc)
(cherry picked from commit 14148591b9)
If a client were to send a LayoutCommit (seldom
used and only for a pNFS server) with a bogus
cnt, there could be problems with a malloc() call
that uses it.
This patch adds a sanity check for the cnt. Note
that RFC8881 does not specify any upper bound
on the cnt.
Approved by: re (cperciva)
(cherry picked from commit 1a679fb907)
(cherry picked from commit c69e0be70f)
Otherwise we go out of bounds and keep incrementing endlessly.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
MFC after: 4 days
Differential Revision: https://reviews.freebsd.org/D53337
(cherry picked from commit 364864ea91)
(cherry picked from commit 4eac02b29f)
It was used for Octeon MIPS and all producers have been removed
from the source tree.
Approved by: re (cperciva)
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53146
(cherry picked from commit 283699338c)
(cherry picked from commit b3bf22d70e)
NIST SP800-90B allows for only a single entropy source to be claimed
in a FIPS-140-3 certificate. In addition, only hardware sources that
have a NIST Entropy Source Validation (ESV) certificate, backed by
a SP800-90B Entropy Assessment Report, are usable. Intel has obtained
ESV certificates for several of their processors, so RDSEED is a
FIPS-140-3 suitable entropy source.
However, even though RDRAND is seeded by RDSEED internally, RDRAND
would need a RBG certificate and CAVP testing run on the DRBG in order
to use it for FIPS-140-3 (SP800-90B) purposes. So we need to know
down in the CSPRNG-subsystem which source the entropy came from.
In light of the potential issues surrounding AMD Zen 5 CPU's RDSEED
implementation[*], allow RDSEED to be disabled in loader.conf.
[*] https://www.phoronix.com/news/AMD-EPYC-Turin-RDSEED-Bug
Approved by: re (cperciva)
Reviewed by: cem
MFC after: 3 days
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D53150
Differential Revision: https://reviews.freebsd.org/D53291
(cherry picked from commit 3a12982962)
(cherry picked from commit 38e9d282cd)
(cherry picked from commit 9ca8e09abb)
The BETA4 builds failed on aarch64 with errors which look
suspiciously like this commit is involved.
This reverts commit 4ae6078a60.
Direct commit to releng/15.0.
Approved by: re (cperciva)
We've been mostly POSIX-conforming since r236400 and fully since r240410,
which fixed a corner case where a missing non-leaf directory would be
reported as ENOTDIR instead of ENOENT.
Approved by: re (cperciva)
Sponsored by: Klara, Inc.
Fixes: 7877ed7ce3 ("Avoid mapping ENOENT to ENOTDIR for non-existent path components.")
Reviewed by: ziaee, markj
Differential Revision: https://reviews.freebsd.org/D53027
(cherry picked from commit 7c66667d45)
(cherry picked from commit 50d6a56a19)
If lstat() fails with EACCES or ENOTDIR, the path we need to return in
the caller-provided buffer is that of the parent directory (which is
either unreadable or not a directory; the latter can only happen in the
case of a race) rather than that of the child we attempted to stat.
Approved by: re (cperciva)
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D53025
(cherry picked from commit 1406de21e1)
(cherry picked from commit 6c9b25246d)
* Passing NULL should result in EINVAL
* Passing an empty path should result in ENOENT
* Failure with a non-null buffer should leave a partial result. As
pointed out in a comment in the test case, this reveals a discrepancy
between the documentation and reality.
Approved by: re (cperciva)
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D53024
(cherry picked from commit f3386dfeb4)
(cherry picked from commit 5debbcb6b7)
To facilitate the task, we change the comparison function so that users
with equal filesystem usage are sorted by UID, and add an undocumented
option that prevents quot from replacing numerical UIDs with names. We
also switch from getfsfile(3) to getmntpoint(3) so the first line is
identical regardless of whether we pass quot a mountpoint or a device.
Approved by: re (cperciva)
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D53133
(cherry picked from commit aa870a1935)
(cherry picked from commit b5f3f1a661)
There was probably a time, more than 30 years ago, when the actual
size of a file had to be calculated and this option saved time, but
all it does today is give incorrect results for no benefit.
Approved by: re (cperciva)
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53132
(cherry picked from commit 8209311c51)
(cherry picked from commit c0d4bbcb80)
We've had this code for 30 years, but there has never been a way to
build it. We have no idea if it still works, or if it ever worked.
Approved by: re (cperciva)
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53131
(cherry picked from commit 0eaca4a24b)
(cherry picked from commit 9a7b48fef1)
* Fix numerous style violations.
* Modernize somewhat.
* Don't bother examining errno after calling get_inode(), as it always
exits on error.
* Fix confusing wording in the manual page.
The code remains somewhat idiosyncratic, e.g. in its insistance on
counting down rather than up in simple for loops, but in the absence
of comprehensive automated tests, the risk of introducing bugs exceeds
the benefit of rewriting these into more idiomatic forms.
Approved by: re (cperciva)
Reviewed by: obiwac
Differential Revision: https://reviews.freebsd.org/D53130
(cherry picked from commit 195b00ec45)
(cherry picked from commit 68911bf64e)
If it encounters an inode whose owner does not have a pw entry, quot
allocates a 7-byte buffer (8 in practice, since that is the minimum
allocation size) and uses it to store the numeric uid preceded by a
hash character. This will overflow the allocated buffer if the UID
exceeds 6 decimal digits. Avoid this by using asprintf() instead.
While here, simplify the common case as well using strdup().
Approved by: re (cperciva)
Reported by: Igor Gabriel Sousa e Souza <[email protected]>
MFC after: 3 days
Reviewed by: obiwac, emaste
Differential Revision: https://reviews.freebsd.org/D53129
(cherry picked from commit 5854d1cbab)
(cherry picked from commit 3d680881f6)
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.
Approved by: re (cperciva)
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
(cherry picked from commit 4d5789532a)
(cherry picked from commit ca16a115a0)
* On startup, insert all valid PIDs into a tree.
* In our main loop, whenever a process terminates, remove its PID
from the tree.
* On exit, if the -p flag was specified, print the remaining PIDs.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: bcr, markj
Differential Revision: https://reviews.freebsd.org/D53293
(cherry picked from commit 3d73146bae)
(cherry picked from commit 955650f181)
Instead of sleeping after pwait returns, use its new -p option to
obtain the list of processes that still have not terminated.
Approved by: re (cperciva)
MFC after: 3 days
PR: 290357
Fixes: 5953e7c984 ("rc.subr: Move the sleep in wait_for_pids")
Reviewed by: 0mp, markj
Differential Revision: https://reviews.freebsd.org/D53294
(cherry picked from commit 22cff1f3e9)
(cherry picked from commit 7b375832c2)
These options may not be combined with any other options and print the
current or specified user's home directory and shell respectively.
Approved by: re (cperciva)
Reviewed by: imp, bcr
Differential Revision: https://reviews.freebsd.org/D53301
(cherry picked from commit f41b1eb637)
(cherry picked from commit eff786f236)
If build logic breaks such that we can't figure out which branch we're
on, we should error out rather than shipping a default (and probably
wrong) /etc/pkg/FreeBSD.conf
Approved by: re (cperciva)
Reviewed by: ivy
MFC after: 5 minutes
Suggested by: ivy
Differential Revision: https://reviews.freebsd.org/D53487
(cherry picked from commit 0837b2ebd5)
(cherry picked from commit 1f528e32f5)
Building VMs as non-root requires no-QEMU code paths (installing
packages from outside the VM image rather than inside it) and vice
versa; we have a check for broken combinations.
Unfortunately that check was breaking
make -C src/usr.sbin/pkg NO_ROOT=YES -V PKGCONFBRANCH
because that code reaches into src/release to determine the branch
name (which is then used to determine which /etc/pkg/FreeBSD.conf to
install).
Wrap the no-root/no-qemu check in an .if to only run when we've
asked for VM and/or CLOUD building to be enabled.
Approved by: re (cperciva)
Reviewed by: ivy
MFC after: 5 minutes
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53486
(cherry picked from commit b485322d6b)
(cherry picked from commit 6b2f2e03f1)
The current IPFW version 3 dates to 2010 (commit cc4d3c30ea, "Bring in
the most recent version of ipfw and dummynet, developed").
The compat code for FreeBSD 8 and earlier has a number of issues and is
no longer needed, so remove it.
Approved by: re (cperciva)
Reported by: Ilja Van Sprundel <[email protected]>
Reviewed by: ae, glebius
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53343
(cherry picked from commit c59aab9a5b)
(cherry picked from commit 9657c50cdd)
Commit 53d0b9e438 ("pmc: Provide full path to modules from kernel
linker") made pmcstat's -k option have no effect, but the option was
retained for backwards compatibility (while emitting a warning that
-k is not in FreeBSD 15).
Approved by: re (cperciva)
Reviewed by: jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53397
(cherry picked from commit c6b156e360)
(cherry picked from commit 958659dc94)
It is deprecated but was not removed prior to 15.0.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 9447a40781)
(cherry picked from commit be24d85ec7)
Currently, files in /boot (other than /boot/kernel) are assigned to the
bootloader package using a filename match in mtree-to-plist.awk. This
causes some problems, most notably that debug info for userboot ends up
in the utilities-dbg package instead of bootloader-dbg.
Remove the path handling from mtree-to-plist and instead set PACKAGE
in the appropriate Makefiles to put these in the correct package.
While here, move userboot*.so from bootloader-dev to bootloader.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: cperciva
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53179
(cherry picked from commit 842942be28)
(cherry picked from commit a182020edf)
flua is a standalone third-party component that deserves its own
package. In particular, this means things can use flua without
having to depend on FreeBSD-utilities, which will be useful as
more base utilities use flua.
This saves ~500kB in FreeBSD-utilities for systems which don't
need flua.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: kevans
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53161
(cherry picked from commit 957715f877)
(cherry picked from commit e4ef333917)
This is somewhat widely used in VNET jails, it's fairly small (150kB on
amd64) and it's enough of a core system component that it's reasonable
to include, even if many jails don't require it.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: dch
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53154
(cherry picked from commit 8a9d29beda)
(cherry picked from commit c392cdae9b)
Simplify the Makefile logic by using MANGROUPS.yes for optional
packages. Also, move bluetooth manpages to the correct package,
add the correct conditional for OpenSSH (MK_OPENSSH), and properly
alphabetise the file.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53127
(cherry picked from commit 82f96b2bc9)
(cherry picked from commit 7a572fd52e)
Previously if WITHOUT_TOOLCHAIN was set we'd create a FreeBSD-clang
package that contained only ar.5. As ar.5 describes the ar format
and doesn't come from Clang/LLVM move it to the FreeBSD-toolchain
package and make it conditional on MK_TOOLCHAIN.
Approved by: re (cperciva)
Reviewed by: ivy
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52886
(cherry picked from commit a8d774d970)
(cherry picked from commit 4574a86c52)
Both of these packages use resolvconf for various things. Add a
dependency to make this work.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: des
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53115
(cherry picked from commit bf28c98f14)
(cherry picked from commit 01f1896527)
We use a pkg(8) trigger to run makewhatis for /usr/share/man when
manpages are updated, but this doesn't cover /usr/share/openssl/man.
Rewrite the trigger to process a list of directories instead of a
single directory, and include /usr/share/openssl/man in the list.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53064
(cherry picked from commit 450fb637f4)
(cherry picked from commit 37effd917e)
Add a new per-group SUBPACKAGE option to bsd.man.mk. When MANSPLITPKG
is enabled, this is forced to "-man", otherwise it defaults to empty
but can be overridden by the caller.
Use this in bsd.lib.mk to install library manpages in the -dev package
instead of the base package. This is nearly always preferable, since
library manpages are usually in section 2 or 3 and are only relevant
to people with development packages installed.
For manpages which should be installed in the base package even for
libraries, add a new MANNODEV group in bsd.lib.mk. Update existing
Makefiles to use this where appropriate.
Approved by: re (cperciva)
MFC after: 3 days
Discussed with: olce
Reviewed by: olce
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52832
(cherry picked from commit 031e711647)
(cherry picked from commit e1a6189f96)
zlib is a standalone third-party component, and deserves its own
package rather than living in runtime. For example, this will make
future security updates less invasive. This also means there's no
dependency on runtime for ports that just require zlib, which is
useful for service jails.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: bapt, emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53058
(cherry picked from commit 924c0c60d4)
(cherry picked from commit a02e78a2c9)
[Driver] Enable outline atomics for FreeBSD/aarch64 (#156089)
The compiler_rt helper functions have been built since 12.4, 13.1, 14
and anything newer.
Approved by: re (cperciva)
MFC after: 3 days
(cherry picked from commit 51e8e8b0f3)
(cherry picked from commit 7778507bf9)
Upstream introduced a fix that avoids blocklistd(8) from running into an
endless loop when it tries to delete an address from the database which
has been added multiple times.
Apply the same fix to blacklistd(8).
Approved by: re (cperciva)
Upstream PR: https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=57193
MFC after: 2 days
(cherry picked from commit b502a451cb)
(cherry picked from commit 528e1d1403)
Upstream introduced an extra column in blocklistctl(8) to display the
name of the rule associated in the database entry.
It is intended to avoid confusion when seemingly duplicate locations
appear in the output of the blocklistctl dump command. Especially when
users are transitioning from the old nomenclature to the new one.
The latest patches will not be fully backported to blacklistctl(8), to
avoid breaking current scripts that may be parsing its output. Also we
are slowly preparing to feature-freeze everything related to blacklist.
Approved by: re (cperciva)
MFC: 2 days
(cherry picked from commit eae98e28a0)
(cherry picked from commit cd284c1e17)
Set the number of rulesets (i.e., anchors) directly attached to the
anchor and its path in pfctl_get_ruleset().
While here, add a test to document this behavior.
Approved by: re (cperciva)
PR: 290478
Reviewed by: kp
Fixes: 041ce1d690 ("pfctl: recursively flush rules and tables")
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D53358
(cherry picked from commit a943a96a50)
(cherry picked from commit 1c8a554f75)
When adding jail descriptors, I split sys_jail remove in two, and
didn't properly track jail held between them when a jail was dying.
This fixes that as well as cleaning up the logic behind it.
Approved by: re (cperciva)
PR: 290217
Reported by: David 'equinox' Lamparter <equinox at diac24.net>
Reviewed by: markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53200
(cherry picked from commit 78f70d4ff9)
(cherry picked from commit 2d3c6a06ed)
All of the do_cmd() calls are in dummynet.c and specify the socket
option at compile time; none of these removed cases are used in ipfw
after the v3 work.
Approved by: re (cperciva)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53378
(cherry picked from commit 0e2e0fb955)
(cherry picked from commit 6b1e5d4d20)
IP_DUMMYNET_GET is no longer used in ipfw(1).
Approved by: re (cperciva)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53348
(cherry picked from commit 28e52dea96)
(cherry picked from commit 73c105268c)
The failed allocation in the error pertains to IP_FW_XADD, not
IP_FW_ADD.
Approved by: re (cperciva)
Reviewed by: ae
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53359
(cherry picked from commit 498e561426)
(cherry picked from commit c22437c8b5)
Dummynet v3 switched to IP_DUMMYNET3 but did not update these
warnings/errors.
Approved by: re (cperciva)
Fixes: cc4d3c30ea ("Bring in the most recent version of ipfw and dummynet, developed")
Sponsored by: The FreeBSD Foundation
Differential Revision: sbin/ipfw/ipfw2.c
(cherry picked from commit 1f95a51788)
(cherry picked from commit a5dd21c7dd)
Add 14.2, as this was cherry-picked prior to release.
Approved by: re (cperciva)
Reported by: Harald Eilertsen
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53320
(cherry picked from commit 2387a51af2)
(cherry picked from commit 87795ea454)
It was not actually removed prior to FreeBSD 15.0.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 0cd8754ad5)
(cherry picked from commit 453766184d)
It was not actually removed prior to FreeBSD 15.0.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
(cherry picked from commit cadadd1a03)
(cherry picked from commit 92f169fe0f)
The descriptions for these unmapped_io and rotating sysctls indicated
that they're deprecated and being removed for FreeBSD 15.0. That did
not happen, so update to FreeBSD 16 instead.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
(cherry picked from commit e93db9abc9)
(cherry picked from commit 469ab88d10)
This may include atkbdc, which is not being removed in 15.0.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 46f982122c)
(cherry picked from commit db84583a93)
It did not happen prior to FreeBSD 15.0.
Approved by: re (cperciva)
Reported by: zlei
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 24adb135c5)
(cherry picked from commit 8e276f22bd)
This driver was in fact not removed prior to FreeBSD 15.0.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
(cherry picked from commit e4d6433e9c)
(cherry picked from commit 59ba727849)
Removal did not happen prior to 15.0.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
(cherry picked from commit f817f6e7f4)
(cherry picked from commit 739750ae7c)
(cherry picked from commit 2be4c64a0d)
We bump the object reference count prior to mapping it into the kernel
map, at which point the vm_map_entry owns the reference. Then, if
vm_map_wire() fails, vm_map_remove() will release the reference, so we
should avoid decrementing it in the error path.
Approved by: re (cperciva)
Reported by: Ilja van Sprundel <[email protected]>
Reviewed by: vmaffione
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53066
(cherry picked from commit dfc1041c08)
(cherry picked from commit 6e1f47765d)
This defaults to plain "pkg", but being able to override it is useful
when testing pkg itself.
Approved by: re (cperciva)
Reviewed by: cperciva
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53307
(cherry picked from commit bbe65c5e8c)
(cherry picked from commit 79fbc4ccb6)
The pt hwt(4) backend uses NMIs to receive updates about the latest t
racing buffer offsets from the tracing hardware. However, it uses
taskqueue(9) to schedule the bottom-half handler. This can lead to
a panic since the taskqueue(9) code isn't aware it's being called
from an NMI context and uses the regular scheduling interfaces.
Fix this by scheduling the bottom-half handler using swi(9) and the
SWI_FROMNMI flag.
Approved by: re (cperciva)
Fixes: 310162ea21
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52491
(cherry picked from commit 96d82d2d13)
(cherry picked from commit 56b4719076)
We have provided implementations for hard float of these for
a while now. Add them to the header to make things official.
This is required for a bunch of legacy programs in ports.
Approved by: re (cperciva)
Approved by: markj (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53156
(cherry picked from commit a8079d40ae)
(cherry picked from commit af39e511ee)
It seems like _QUAD_LOWWORD was incorrectly expanded into 1,
which is correct for big endian but not little endian. This
means we always grab the padding word for the syscall number,
which is usually 0, causing SIGSYS to be delivered to the caller.
Reintroduce _QUAD_LOWWORD to fix the syscall.
Approved by: re (cperciva)
PR: 290411
MFC after: 1 week
Discussed with: jrtc27
Reviewed by: cognet, emaste
Approved by: markj (mentor)
Fixes: 8c9c3144cc
Differential Revision: https://reviews.freebsd.org/D53250
(cherry picked from commit 1ca09538d9)
(cherry picked from commit c824960b89)
When adding a syncache entry, take a reference count of the
credentials while the inp is still locked.
Thanks to markj@ for providing a hint regarding the root cause.
Approved by: re (cperciva)
Reported by: David Marker
Reviewed by: glebius
Tested by: David Marker
Fixes: cbc9438f05 ("tcp: improve ref count handling when processing SYN")
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D53380
(cherry picked from commit 44cb1e857f)
(cherry picked from commit 9611bf2fed)
Honor the IPPROTO_IPV6-level cmsg of type IPV6_TCLASS when sending
an UDP/IPv4 packet on an AF_INET6 socket.
Approved by: re (cperciva)
Reviewed by: bz
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D53347
(cherry picked from commit d3a3854fdc)
(cherry picked from commit e31ff080e5)
Honor the IPPROTO_IPV6-level socket option IPV6_TCLASS when sending
an UDP/IPv4 packet on an AF_INET6 socket.
Approved by: re (cperciva)
Reviewed by: bz, glebius
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D53346
(cherry picked from commit 3535546a86)
(cherry picked from commit 8f5162f6fc)
Without this setting, Unbound 1.24.0 and newer will attempt to set the
socket buffer size to 4 MB to mitigate issues that mostly affect servers
with large numbers of clients on local networks, which is not a scenario
local-unbound is intended for. This is not only a waste of resources,
it can also fail, resulting in a warning message on daemon startup.
Approved by: re (cperciva)
Fixes: b2efd602ae ("unbound: Vendor import 1.24.0")
Reviewed by: jlduran, cy
Differential Revision: https://reviews.freebsd.org/D52977
(cherry picked from commit de3faa85d8)
(cherry picked from commit 65629acb4a)
The MCA spin lock is acquired in the hardware interrupt context to
record MCA messages. It is also acquired by a task handler to emit
those messages.
Reduce the amount of time the task handler holds the lock to reduce
the maximum amount of time the hardware interrupt handler may need to
spin on the lock.
Approved by: re (cperciva)
Reviewed by: glebius, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D52938
(cherry picked from commit e770e32aa3)
(cherry picked from commit d83dee356d)
TCP stats are currently incremented for the persist and progress
timeout conditions, but only the persist cause was saved in the
connection end info status, which in turn is logged in the
blackbox "connection end" event.
Approved by: re (cperciva)
Reviewed by: tuexen
Sponsored by: Netflix, Inc.
(cherry picked from commit 1a61a673a3)
(cherry picked from commit 6b81787240)
The TCP_SAD_DETECTION code was removed. Remove the remaining
sysctl-variables and counters.
Approved by: re (cperciva)
Reviewed by: tuexen
Sponsored by: Netflix, Inc.
(cherry picked from commit 04c2642406)
(cherry picked from commit 8856e55b47)
Currently mod_play_vchans() and mod_rec_vchans() run unconditionally,
even if the direction (playback, recording) is not supported by the
device. This results in the "autoconv" (see mod_autoconv()) control
failing when run on simplex devices, because we'll be trying to modify
vchans on an unsupported direction.
Test whether the direction is supported and silently move on if it
isn't.
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
MFC after: 4 days
Differential Revision: https://reviews.freebsd.org/D53233
(cherry picked from commit 70b34fbdbe)
(cherry picked from commit e015e079f9)
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.
Approved by: re (cperciva)
MFC to: stable/15
Fixes: 289785
Thanks to: imp, kib
(cherry picked from commit 2612f1b864)
(cherry picked from commit 44e214f824)
This includes the conflicting changes from previous driver versions
(v6.11/v6.14), mostly being function pointer or function arguments.
Approved by: re (cperciva)
(cherry picked from commit 76aed633b5)
(cherry picked from commit 22eb6e43d0)
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
Approved by: re (cperciva)
(cherry picked from commit 354a030185)
(cherry picked from commit a13158f451)
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
Approved by: re (cperciva)
(cherry picked from commit eb15fdb1b7)
(cherry picked from commit 0272ecf586)
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.
Approved by: re (cperciva)
Obtained from: git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git
branch next, 1b49af228594452206d5c50a33b6a341428edb63
(cherry picked from commit 6b627f8858)
(cherry picked from commit e89beeee25)
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.
Approved by: re (cperciva)
Reported by: jtl
Reviewed by: Peter Lei
Sponsored by: Netflix, Inc.
(cherry picked from commit bfda98a420)
(cherry picked from commit c566953da8)
With this patch UDP-Lite endpoints are also show per default.
Approved by: re (cperciva)
Reviewed by: Peter Lei, Nick Banks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D53230
(cherry picked from commit f48c6390dd)
(cherry picked from commit c10317b0c4)
With this patch UDP-Lite endpoints are also shown per default.
Approved by: re (cperciva)
Reviewed by: Nick Banks
Differential Revision: https://reviews.freebsd.org/D53252
(cherry picked from commit c2b08c13c2)
(cherry picked from commit 372b604226)
Export the list of pcbs for UDP-Lite to be consumed by sockstat and
netstat.
Approved by: re (cperciva)
Reviewed by: Peter Lei, Nick Banks
Differential Revision: https://reviews.freebsd.org/D53229
(cherry picked from commit be93b27483)
(cherry picked from commit da7a90f097)
Provide the IPPROTO_UDP in the arg2 parameter of udp_pcblist() and use
this to determine the inpcbinfo. This allows the same function to be
used in an upcoming commit to provide the list of pcbs for UDP-Lite
just by providing IPPROTO_UDPLITE in the arg2 parameter.
Approved by: re (cperciva)
Reviewed by: rrs
Differential Revision: https://reviews.freebsd.org/D53218
(cherry picked from commit be3c59ff50)
(cherry picked from commit 365378184a)
GCC warns about the sign mismatch in comparisons:
lib/libc/tests/net/inet_net_test.cc: In member function 'virtual void {anonymous}::atfu_tc_inet_net_inet4::body() const':
lib/libc/tests/net/inet_net_test.cc:86:17: error: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Werror=sign-compare]
86 | ATF_REQUIRE_EQ(bits, addr.bits);
| ^~~~~~~~~~~~~~
lib/libc/tests/net/inet_net_test.cc: In member function 'virtual void {anonymous}::atfu_tc_inet_net_inet6::body() const':
lib/libc/tests/net/inet_net_test.cc:205:17: error: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Werror=sign-compare]
205 | ATF_REQUIRE_EQ(bits, addr.bits);
| ^~~~~~~~~~~~~~
Approved by: re (cperciva)
Fixes: 8f4a0d2f7b ("libc: Import OpenBSD's inet_net_{ntop,pton}")
(cherry picked from commit e1aeb58cbb)
(cherry picked from commit 7ffd190ae9)
GCC does not like passing NULL (__null) to std::ostringstream::operator<<
inside of ATF_REQUIRE_EQ:
lib/libc/tests/net/inet_net_test.cc: In member function 'virtual void {anonymous}::atfu_tc_inet_net_ntop_invalid::body() const':
lib/libc/tests/net/inet_net_test.cc:306:9: error: passing NULL to non-pointer argument 1 of 'std::__1::basic_ostream<_CharT, _Traits>& std::__1::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::__1::char_traits<char>]' [-Werror=conversion-null]
306 | ATF_REQUIRE_EQ(ret, NULL);
| ^~~~~~~~~~~~~~
In file included from /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/sstream:317,
from /usr/obj/.../amd64.amd64/tmp/usr/include/atf-c++/macros.hpp:29,
from /usr/obj/.../amd64.amd64/tmp/usr/include/atf-c++.hpp:29,
from lib/libc/tests/net/inet_net_test.cc:33:
/usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/__ostream/basic_ostream.h:338:81: note: declared here
338 | basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long __n) {
| ~~~~~^~~
...
Approved by: re (cperciva)
Fixes: 8f4a0d2f7b ("libc: Import OpenBSD's inet_net_{ntop,pton}")
(cherry picked from commit aa358ce3ca)
(cherry picked from commit 848ca53d3a)
There may be other issues here but this change certainly seems to
be necessary.
Approved by: re (cperciva)
PR: 290394
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D53263
(cherry picked from commit fa240b7ff0)
(cherry picked from commit 8b45854447)
These are known to work if loaded manually by loader(8) (for VF2 at
least). If nothing else, it is useful to provide a DTB closely tied to
the kernel version.
Approved by: re (cperciva)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53117
(cherry picked from commit 96b137c044)
(cherry picked from commit 2257adb848)
These are known to work if loaded manually by loader(8) (for the Nezha
board at least). If nothing else, it is useful to provide a DTB closely
tied to the kernel version.
Approved by: re (cperciva)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53118
(cherry picked from commit 3ed48eb085)
(cherry picked from commit 9a44b56907)
Just like arm64, our DTS comes from Linux and is correctly sorted into
subdirectories by vendor. Enable the logic to preserve these directories
in the installation, for example:
/boot/dtb/sifive/hifive-unmatched-a00.dtb
Approved by: re (cperciva)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53116
(cherry picked from commit cf202819af)
(cherry picked from commit 0cc2448fc2)
The computation of the length was not taking into account that IPv6
endpoints, which are not IPv6 only, have a suffix of 46.
For UDP and TCP this bug was not relevant, since tcp46 and udp46
has the same length as PROTO, but sctp46 is longer. Upcoming
udplite support will also be affected.
Approved by: re (cperciva)
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D53212
(cherry picked from commit 4ee0ddae1d)
(cherry picked from commit 8c197879bf)
The size of an embedded struct has changed and might possibly be a
problem. Allow this change to be detected by bumping __FreeBSD_version.
Approved by: re (cperciva)
(cherry picked from commit 37ad1beaf5)
(cherry picked from commit a4ee95e54a)
This includes some type cleanups as well as some shuffling of structs
and functions to sort dependencies out. Few new functions and defines
as well as new struct members. Minor fixes to style and debug logging.
This is the majority of changes. None of these should conflict with
current in-tree drivers. The final bit of changes will come along with
the driver updates adding an extra argument to function pointers.
Approved by: re (cperciva)
(cherry picked from commit 0567484734)
(cherry picked from commit f2b2d6c18a)
For the moment add skeleton functions for netif_device_attach/detach()
needed by rtw8[89] v6.17.
Approved by: re (cperciva)
(cherry picked from commit 5ea941a4fb)
(cherry picked from commit 4bdd0e51d7)
This likely belongs in socket code which we do not have in LinuxKPI.
Needed by a wirless driver at v6.17.
Approved by: re (cperciva)
(cherry picked from commit 88dbf83345)
(cherry picked from commit 3ad05fa24a)
We do not support Wireless Ethernet Dispatch (wed) on the mt76 (yet).
Add pr_debug calls with TODO in case we run into the calls anyway so
we could deal with them.
Approved by: re (cperciva)
(cherry picked from commit 224ac9d2a0)
(cherry picked from commit b9b571e614)
page_pool headers were not used yet; they were created for mt76 but
are without functionality. Upstream has migrated them for v6.17 and
split them up into multiple files. Also add netmem.h which the little
needed is directly related to page pools.
Approved by: re (cperciva)
(cherry picked from commit 7c31cdfa40)
(cherry picked from commit d388ff8016)
Given we do not yet support "wake" bits in device there is little need
doing it in PCI if we cannot check if we are supposed to do the
operation in first place. Once we would implement this, we would need
to also do the appropriate PCI (pme) checks before enabling (disabling)
it.
Approved by: re (cperciva)
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D53208
(cherry picked from commit 885e8f272f)
(cherry picked from commit be52a81be0)
We do not currently aim to support crypto FIPS compliance in LinuxKPI
so keep this turned off.
Approved by: re (cperciva)
Reviewed by: emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D53207
(cherry picked from commit 98609f4fec)
(cherry picked from commit 3aaaba2078)
The return type now is void; I believe no one ever used this
so we can just chnage it. The only active platform_driver_register()
calls seems to be in ath1[01]k and mt76 and there in unsupported code.
Approved by: re (cperciva)
Reviewed by: dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D53205
(cherry picked from commit 0ae4998423)
(cherry picked from commit 5434a1635e)
We will see how much we will need them and how to fill them at that
point. They are left with a pr_debug("TODO") for now.
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D53204
(cherry picked from commit cc792250ac)
(cherry picked from commit 805038b70a)
The former is needed by a wireless driver at v6.17.
Approved by: re (cperciva)
Reviewed by: dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D53203
(cherry picked from commit 0a4b11ddb2)
(cherry picked from commit 0e30cab0f3)
Our versions of these functions (originally taken from BIND) simply
don't work correctly for AF_INET6. These were removed from BIND itself
quite a while ago, but OpenBSD has made several fixes in the mean time,
so import their code.
Add tests for both functions.
Approved by: re (cperciva)
PR: 289198
Reported by: Nico Sonack <[email protected]>
MFC after: 1 week
Reviewed by: des
Obtained from: OpenBSD (lib/libc/net)
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52629
(cherry picked from commit 8f4a0d2f7b)
(cherry picked from commit ff7a10d0e1)
Using these targets on a pkgbase system will cause the installed system
to become out of sync with the package database, which is almost certain
to cause issues the next time pkg(8) is used.
To prevent users doing this accidentally, disallow install* if we detect
that FreeBSD-runtime is installed in the target. The check can be
overridden with DESTDIR=/ for users who are sure they want to do this.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52879
(cherry picked from commit 74a6bb524e)
(cherry picked from commit ef82bdc864)
tar(1) is not a core runtime utility; in particular, nothing in
/etc/rc.d/* requires it. Move it to utilities, which is also
where cpio(1) lives.
This removes the dependency from runtime to libarchive.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: manu, emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53059
(cherry picked from commit c0f17d637a)
(cherry picked from commit c6a19aed69)
Similar to SUBDIR and CONFGROUPS, this allows the use of
MANGROUPS.${MK_FOO}, simplifying Makefile logic for optional
manpages.
Approved by: re (cperciva)
MFC after: 3 seconds
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53126
(cherry picked from commit e757a92282)
(cherry picked from commit da0e0f755e)
Ensure we always have a non-NULL rule pointer (ctx.rm).
It might have gotten set to NULL by pf_get_translation().
While here also restore the previous rdr behaviour be re-adding the incorrectly
removed 'break' in pf_match_translation_rule.
Approved by: re (cperciva)
PR: 290177
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D53191
(cherry picked from commit cb36bfee25)
(cherry picked from commit 536b07512c)
ISO 8601 allows use of "Z" as the time zone designator. Update the
strptime parser to allow this usage.
While we are at it, update the manpage to reflect that both UTC and Z
are now valid options.
Approved by: re (cperciva)
Reviewed by: des
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53083
(cherry picked from commit 79e57ea662)
(cherry picked from commit 3d368c699b)
In parse_notes we validate that the note name fits within the note
buffer, but we do not do the same for the note data, so there is some
potential for an OOB read in the note handler. Add a bounds check.
Approved by: re (cperciva)
Reported by: Ilja Van Sprundel <[email protected]>
Reviewed by: kib, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53063
(cherry picked from commit c86af2cc4c)
(cherry picked from commit 09ae918e1f)
A string array is represented by a set of nul-terminated strings
concatenated together. For each string, we check to see if there's a
nul terminator at the end, taking care to avoid going past the end of
the buffer. However, the code fails to handle the possibility that
size == 0 at the end of an iteration, leading to underflow.
Fix the length check.
Approved by: re (cperciva)
Reported by: Ilja van Sprundel <[email protected]>
Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53069
(cherry picked from commit 937693fc9e)
(cherry picked from commit c47f9af477)
Note, it looks like this code may be unused since commit 4a77657cbc
("ipfw: migrate ipfw to 32-bit size rule numbers"). In particular, it
looks like the ipfw_nat_*_ptr pointers are unused now.
Approved by: re (cperciva)
Reviewed by: ae
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53068
(cherry picked from commit 2df39ce5d4)
(cherry picked from commit 302c4c540e)
In the non-ASLR case, there is no check for an error from
vm_map_fixed(). Restore it, it was dropped in commit 939f0b6323.
This bug could result in a refcount leak of the object used to map the
VDSO page.
Approved by: re (cperciva)
Reviewed by: kib
Reported by: Ilja Van Sprundel <[email protected]>
MFC after: 1 week
Fixes: 939f0b6323 ("Implement shared page address randomization")
Differential Revision: https://reviews.freebsd.org/D53065
(cherry picked from commit 7117c86fcb)
(cherry picked from commit 6a5f0dc705)
We're correctly recording all of the packages in the dvd METALOG file,
but if we don't record ./packages/repos/FreeBSD_install_cdrom.conf then
users won't be able to install them very easily.
Approved by: re (cperciva)
Reviewed by: markj
Reported by: Lars Tunkrans
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53199
(cherry picked from commit 2b5c62494d)
(cherry picked from commit 52ea1ca18a)
We only need to check for unMETALOGed directories and sort the METALOG
file if we're using it, i.e. if we're doing a NO_ROOT build. This
non-NO_ROOT builds by no longer bogusly writing to /METALOG*.
We only need to add databases (spwd.db etc) to METALOG if we're doing
a pkgbase-enabled NO_ROOT build; but we should always do this before
creating the filesystem, not only if we installed extra packages (in
vm_extra_install_packages, where that code was erroneously placed).
This fixes non-cloud VM images, which in 15.0-BETA2 shipped without
password databases.
Approved by: re (cperciva)
Reviewed by: ivy
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53194
(cherry picked from commit 012014403b)
(cherry picked from commit 962194df83)
While TCP disallows connect()ing a socket with SO_REUSEPORT_LB, UDP does
not. As a result, a connected UDP socket can be placed in the lbgroup
hash and thus receive datagrams from sources other than the connected
host.
Reported by: Amit Klein <[email protected]>
Reported by: Omer Ben Simhon <[email protected]>
Reviewed by: glebius
Approved by: so
Approved by: re (cperciva)
Security: FreeBSD-SA-25:09.netinet
Security: CVE-2025-24934
(cherry picked from commit 320ad3dec5)
(cherry picked from commit ef159100ec)
Sometimes one or the other but not both tools are present; this ensures
that all cases are correctly handled.
Reported by: cperciva
Approved by: cperciva (re)
Sponsored by: SkunkWerks, GmbH
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D53186
MFC after: 2 days
(cherry picked from commit 81d807a906)
MediaTek mt76 WiFi cards are advertising FLR support but after issuing
a FLR the chipset is gone. Add a quirk so we can disable FLR. The
current reset code will automatically fall back to a power reset.
This makes the card show up under bhyve where before it would just not
be discovered at all. That should make wifibox work for it and will help
development for a LinuxKPI based mt76 driver as found in framework laptops
as no dedicated machine and constant reboots are needed anymore.
We will likely need to add more PCI vendor/device IDs once we can test
the other device IDs.
Approved by: re (cperciva)
After a lot of help from: jhb
Really implemented by: jhb (I just typed and tested)
GH issue: github.com/pgj/freebsd-wifibox/issues/73
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D52728
(cherry picked from commit 4c0e53aced)
(cherry picked from commit 3bd015a1a9)
As found on RTEMS the argument to if_foreach_llmaddr() was wrong
causing crashes.
Approved by: re (cperciva)
Fixes: 51e8082055
PR: 290314
(cherry picked from commit 33afdf0e35)
(cherry picked from commit 10c71151ad)
The port is called wifi-firmware-mt76-kmod not "mediatek" in the
moddle.
Approved by: re (cperciva)
Reported by: Lars Tunkrans (drsnx60 gmail.com)
Reviewed by: emaste, jrm, imp
Differential Revision: https://reviews.freebsd.org/D53067
(cherry picked from commit 10d88a7aa6)
(cherry picked from commit e048748627)
All iterators that rely on an object's 'struct domainset_ref' (field
'domain' on 'struct vm_object'), which is the case for page allocations
with objects, are used with the corresponding object locked for writing,
so cannot lose concurrent iterator index's increases even if those are
made without atomic operations. The only offender was thread stack
allocation, which has just been fixed in commit 3b9b644576 ("vm: Fix
iterator usage in vm_thread_stack_create()").
However, the interleaved policy would still reset the iterator index
when restarting, losing track of the next domain to allocate from when
applying round-robin, which all allocation policies do if allocation
from the first domain fails.
Fix this last round-robin problem by not resetting the shared index at
iterator's phase init on DOMAINSET_POLICY_INTERLEAVE.
Add an assertion to check that, when passed, an object is write-locked
in order to prevent the problem mentioned in the first paragraph from
reappearing.
Approved by: re (cperciva)
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52733
(cherry picked from commit 7b0fe2d405)
(cherry picked from commit d7226d1858)
After commit 7a79d06697 we no longer hold the VM object lock when
initializing or advancing the domainset iterator in
vm_thread_stack_create().
We could lift the lock out of vm_thread_stack_back() but that poses
complications since we cannot allocate KVA with a VM object lock held.
Instead of overridding the object's iterator, just borrow that of the
current thread. Kernel stacks are basically always allocated with a
DOMAINSET_POLICY_PREFER policy, so it's not very important to maintain a
global iterator for round-robin allocation.
As a part of this, fix up flag handling: make sure we handle
M_NOWAIT/M_WAITOK from the caller. Delete a comment in vm_thread_new()
which refers to a non-existent consideration (stack swapping has been
removed). I suspect vm_thread_new() can use M_WAITOK but opted not to
make that change here.
Approved by: re (cperciva)
Reported by: olce
Reviewed by: olce, alc, kib
Fixes: 7a79d06697 ("vm: improve kstack_object pindex calculation to avoid pindex holes")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D52982
(cherry picked from commit 3b9b644576)
(cherry picked from commit 511311e4f7)
These map directly onto sysctls under vfs.inotify of the same name.
Approved by: re (cperciva)
Reviewed by: olce, des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53142
(cherry picked from commit 28c0ef7684)
The manpages of linprocfs(5) and linsysfs(5) document incomplete names without
"fs" suffix. Make them identical to other filesystems.
Approved by: re (cperciva)
PR: 283079
MFC after: 3 days
Reviewed by: ziaee, markj
Differential Revision: https://reviews.freebsd.org/D53155
(cherry picked from commit 88b9ca860e)
(cherry picked from commit 6ec0fbd8ff)
Bump the socket buffer limit from 2 MB to 8MB.
In particular, this allows to use larger values for TCP sockets,
which may result in higher throughput values with default settings.
In the review I was proposing using 16 MB, but in the transport
call today we settled on a more conservative value of 8.
Bumping it further will be done in combination with mitigations
for mbuf exhaustion attacks.
Approved by: re (cperciva)
Reviewed by: rscheff, Peter Lei, jtl, thj
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D52873
(cherry picked from commit 1fe6497b48)
(cherry picked from commit 167b9fac60)
This allows in higher throughput values with default settings.
In the review I was proposing using 16 MB, but in the transport
call today we settled on a more conservative value of 8.
Bumping it further will be done in combination with mitigations
for mbuf exhaustion attacks.
Approved by: re (cperciva)
Reviewed by: rscheff, Peter Lei, jtl, thj
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D52871
(cherry picked from commit baeff75122)
(cherry picked from commit c3cc8223dd)
This allows in higher throughput values with default settings.
In the review I was proposing using 16 MB, but in the transport
call today we settled on a more conservative value of 8.
Bumping it further will be done in combination with mitigations
for mbuf exhaustion attacks.
Approved by: re (cperciva)
Reviewed by: rscheff, cc, glebius, Nick Banks, Peter Lei, jtl, thj, rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D52872
(cherry picked from commit 9dd4742ee5)
(cherry picked from commit 7d29554b36)
+ arm/RPI-B.conf no longer exists, adjust for arm64/RPI.conf
+ document default CHROOTDIR, also add to FILES list
+ tag SPDX
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D53078
(cherry picked from commit 8a9f1a2286)
(cherry picked from commit be9b7d8dd0)
When trying to find the address of a VNET variable from a debugger, it
helps to have the original address of the VNET section. In particular,
given the address of a vnet_entry_foo symbol, one wants to easily find
the linker file that the symbol belongs to.
In link_elf_obj.c, the section address for VNET and DPCPU sections is
overwritten in link_elf_link_preload() and link_elf_load_file(). Add an
"origaddr" field to store the original absolute address of the section
base.
In link_elf.c the elf_file_t already has the fields we want, but they
were not getting filled out for the kernel itself. Fix that too, since
that simplifies things for debuggers and improves consistency.
Approved by: re (cperciva)
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D52730
(cherry picked from commit 07747afd51)
(cherry picked from commit 5a926b3cd5)
- Fix a typo.
- Provide the default path.
Approved by: re (cperciva)
Reviewed by: des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53001
(cherry picked from commit ec8e07e8fa)
(cherry picked from commit 1de06221cc)
Only suppress the path state column when producing traditional text
output. When generating html output, always include the column.
Please note that when generating json or xml output, optional fields
like the path state are only generated if they is applicable. This
has not been changed.
The changes in this patch were suggested by asomers.
Approved by: re (cperciva)
Reviewed by: asomers
Fixes: 746eadecaa ("sockstat: show path state column only when useful")
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D53005
(cherry picked from commit 97e858f5b3)
(cherry picked from commit f6923c0a68)
Showing the path state column is only useful, if there is at least one
SCTP endpoint shown, which is not in the state CLOSED or LISTEN.
Don't show it when it is not useful.
Approved by: re (cperciva)
Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D52986
(cherry picked from commit 746eadecaa)
(cherry picked from commit 9a0a114b7f)
Create a chapter on every important socket type: stream, datagram,
seqpacket. Always list what protocol families do support what kinds of
sockets. Improve some statements possessing language from the
specification [1]. Reduce some statements that are mostly specific to
TCP. Provide more external links and references to various important
syscalls that can be used on sockets.
Add a paragrph on non-blocking mode.
The big factual change is documentation of SOCK_SEQPACKET. In FreeBSD 15
this socket now fully follows the specification and is a stream socket
with record boundaries.
[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_10_06
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D52771
(cherry picked from commit 86d1723923)
(cherry picked from commit ad13fd5a8f)
(cherry picked from commit a091d6919c)
The send operations are waiting on the peer's socket buffer, but we shall
use our timeout value. Provide a test for that.
Approved by: re (cperciva)
Reported by: phk
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D53081
Fixes: d157927807
(cherry picked from commit ead7219352)
(cherry picked from commit bbfaff26bf)
Theoretically METALOG should include everything which needs to go
into disk images; unfortunately there are still a few bugs which
are resulting in directories not being listed -- and if METALOG
has files in unrecorded directories, the directories end up being
created with 000 permissions.
Oddly enough, systems where / has 000 permissions are not very
usable.
As a temporary hack, compare the staging tree against METALOG and
add entries for any unrecorded directories. This will hopefully
be reverted before 15.0-RELEASE.
Approved by: re (cperciva)
Reviewed by: bapt, emaste, ivy
Sponsored by: https://www.patreon.com/cperciva
MFC after: 5 minutes
Differential Revision: https://reviews.freebsd.org/D53153
(cherry picked from commit 71b2f98535)
(cherry picked from commit 7ce5d908fd)
Include /packages in the METALOG used to create dvd1.iso. Previously
we used an expression ^./packages/ (with a trailing /) which did not
match /packages itself, and then with no METALOG entry /packages on
dvd1.iso ended up with mode d---------.
Approved by: re (cperciva)
PR: 290222
Reviewed by: cperciva
MFC after: 1 minute
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 2db11dda84)
(cherry picked from commit ecd943a5af)
Normally in BETAs the DVD images get packages from the latest
quarterly package build; but aarch64 does not yet have a quarterly
package set built for 15.x, and this made the BETA1 aarch64 builds
fail. Switch back to using packages from the "latest" package set.
Direct commit to releng/15.0; will be reverted before the release.
Approved by: re (cperciva)
Sponsored by: https://www.patreon.com/cperciva
As recently fixed in sockstat (9934558460), having tests/Makefile
include files from the parent directory with SRCS= ../foo.c results
in a race condition as the parent build and the tests build try to
produce the same object file but contain different paths.
Use .PATH to tell make to find sockstat.c in the parent directory
but place the object file in the current object directory.
Approved by: re (cperciva)
Reviewed by: emaste, jrtc27, kevans
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53075
(cherry picked from commit 3c9a2f383f)
(cherry picked from commit a7c1d6b72a)
The FreeBSD-base pkg repository is currrently dominated by a handful of
large packages: Out of a compressed repository size of ~960 MB, about
160 MB is taken up by the FreeBSD-src package, 128 MB (on amd64) is
used by the FreeBSD-kernel-generic-dbg package, and 91 MB is used by
the FreeBSD-src-sys package. Consequently, running 'make packages -jN'
provides less benefit than one might hope, as most of the packages
finish building quickly, ultimately leaving the FreeBSD-src package
building by itself for a couple minutes while all the other CPUs are
idle.
Pass -T${PKG_CTHREADS} to the 'pkg create' commands (with a default
of -T0) in order to instruct pkg's zstd compression to use multiple
threads.
Testing on an EC2 r7i.48xlarge instance with -j192, this reduces the
time taken by 'make packages' from 6m17s to 1m39s; package creation
time itself (excluding the initial process of installing into world
and kernel staging directories) dropped from 5m37s to 59s.
Approved by: re (cperciva)
Reviewed by: ivy
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53053
(cherry picked from commit 16155cccc4)
(cherry picked from commit 3d8ec3273d)
Remove the printf() stances added in commit d4cc791f3b ("sys/rpc: UNIX
auth: Fix OOB reads on too short message").
Even if it can be helpful to know why an authentication message is
rejected, printing explanatory messages on each request attempt is
a remote log filler that could be triggered by accident, and the generic
RPC code generally does not do that. These printf() calls should be
restored only after some limiting or configuration mechanism is devised.
Approved by: re (cperciva)
MFC with: d4cc791f3b ("sys/rpc: UNIX auth: Fix OOB reads on too short message")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 2110ae0ef9)
(cherry picked from commit fb8a978ebf)
Approved by: re (cperciva)
MFC after: 2 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit a4105a5d4e)
(cherry picked from commit d06658b806)
xdr_authunix_parms() does not allocate any auxiliary memory, so we can
simply support XDR_FREE by just returning TRUE.
Although there are currently no callers passing XDR_FREE, this makes us
immune to such a change in a way that doesn't cost more but is more
constructive than a mere KASSERT().
Approved by: re (cperciva)
Suggested by: rmacklem
MFC after: 2 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 4ae70c3ea4)
(cherry picked from commit b27688a8b5)
In the inline version (_svcauth_unix()), fix multiple possible OOB reads
when the credentials part of a request is too short to contain mandatory
fields or with respect to the hostname length or number of groups it
advertises. The previously existing check was arriving too late and
relied on possibly wrong data coming from earlier OOB reads.
While here, use 'uint32_t' as the length/size type, as it is more than
enough and removes the need for conversions, explicit or implicit.
While here, factor out setting 'stat' to AUTH_BADCRED and then jumping
to 'done' on error, through the new 'badcred' label. While here,
through comments, refer to what the non-inline version is doing
(xdr_authunix_parms() in 'authunix_prot.c') and the reasons.
Approved by: re (cperciva)
Reviewed by: rmacklem
Fixes: dfdcada31e ("Add the new kernel-mode NFS Lock Manager.")
MFC after: 2 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52964
(cherry picked from commit d4cc791f3b)
(cherry picked from commit 45e671c9cd)
Remove local defines from 'svc_auth_unix.c' and use the new limit
macros instead.
Approved by: re (cperciva)
Reviewed by: rmacklem
MFC after: 2 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52963
(cherry picked from commit e665c0f6f7)
(cherry picked from commit 9763e76ccc)
Consistently with the XDR_INLINE() variant of xdr_authunix_parms()
(_svcauth_unix() in 'svc_auth_unix.c'), reject messages with credentials
having a machine name length in excess of AUTH_SYS_MAX_HOSTNAME or more
than AUTH_SYS_MAX_GROUPS supplementary groups, which do not conform to
RFC 5531. This is done mainly because we cannot store excess groups
anyway, even if at odds with the robustness principle ("be liberal in
what you accept").
While here, make sure the current code is immune to AUTH_SYS_MAX_GROUPS
changing value (in future RFCs?) even if that seems improbable.
Approved by: re (cperciva)
Reviewed by: rmacklem
Fixes: dfdcada31e ("Add the new kernel-mode NFS Lock Manager.")
MFC after: 2 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52962
(cherry picked from commit b119ef0f6a)
(cherry picked from commit 34fc20503f)
As, respectively, the maximum number of "supplementary" groups and the
maximum hostname size allowed in the credentials structure for AUTH_SYS
(aka, AUTH_UNIX).
Will be used in subsequent commits.
Approved by: re (cperciva)
Reviewed by: rmacklem
MFC after: 2 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52961
(cherry picked from commit f7c4f800cc)
(cherry picked from commit 37aeac4464)
When the received authentication message had more than XU_NGROUPS, we
would write group IDs beyond the end of cr_groups[] in the 'struct
xucred' being filled (as 'ngroups_max' is always greater than
XU_NGROUPS).
For robustness, prevent various OOB accesses that would result from
a change of value of XU_NGROUPS or a 'struct xucred' with an invalid
'cr_ngroups' field, even if these cases are unlikely.
Approved by: re (cperciva)
Reviewed by: rmacklem
Fixes: dfdcada31e ("Add the new kernel-mode NFS Lock Manager.")
MFC after: 2 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52960
(cherry picked from commit 47e9c81d4f)
(cherry picked from commit 9492a1e27f)
Approved by: re (cperciva)
MFC after: 2 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit bda3b61512)
(cherry picked from commit 5e482104ec)
The introduction of OpenZFS moved some sysctls, and legacy compat shims
were added. For example:
Old (legacy) name: vfs.zfs.min_auto_ashift
New name: vfs.zfs.vdev.min_auto_ashift
Upstream OpenZFS removed these, but we've temporarily restored them in
FreeBSD.
Note that l2arc sysctls use generic sysctl functions (e.g. SYSCTL_UQUAD)
and thus cannot trivially have warnings added, so they are not handled.
Approved by: re (cperciva)
PR: 266374
Reviewed by: jlduran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53033
(cherry picked from commit 654a3aa9a1)
(cherry picked from commit f0033878b9)
Make sure the entirety of x is zero before flipping the sign bit.
Otherwise the sign would be wrong for small values of x when x is
negative and |n*y| > |x|
Approved by: re (cperciva)
Reported by: alfredo
PR: 251091
Reviewed by: kargl
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53023
(cherry picked from commit 25cca51ed2)
(cherry picked from commit 583e976d6d)
BLOCKLIST_NOTIFY() is called within a signal handler for the alarm after
the grace period has expired that may only take async-signal safe
actions.
Approved by: re (cperciva)
Reviewed by: emaste
Fixes: e02003bce7 ("openssh: blocklist: Use NetBSD probes")
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D53109
(cherry picked from commit 9c82c17c2a)
(cherry picked from commit 7161c525ab)
After commit 900bc02063, zpool depends on mountcritlocal. zpoolreguid
and zpoolupgrade depend on zpool and want to run before mountcritcycle,
so we have a pair of cycles.
Update zpoolreguid and zpoolupgrade to avoid this.
Approved by: re (cperciva)
Reviewed by: des
MFC after: 3 days
Fixes: 900bc02063 ("rc.d/zpool: change mountcritlocal dep from BEFORE to REQUIRE")
Differential Revision: https://reviews.freebsd.org/D52953
(cherry picked from commit ae6db60ff5)
(cherry picked from commit 8e957b78e6)
Enabled qat driver support for 402xx device with
ID 0x4944/0x4945. This is an additional device supported
under the existing qat_4xxx driver. Firmwares specific to
the 402xx device are added.
Signed-off-by: Hareshx Sankar Raj <[email protected]>
Approved by: re (cperciva)
Relnotes: yes
Sponsored by: Intel Corporation
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D52488
(cherry picked from commit 7fbd362c09)
(cherry picked from commit 88c0ce38bc)
This more accurately reflects its purpose, and its contents, since
everything in the package is prefixed with "local-".
While here, add a message on upgrade about regenerating the config.
Approved by: re (cperciva)
MFC after: 3 seconds
Requested by: des
Reviewed by: des
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53056
(cherry picked from commit bf84861460)
(cherry picked from commit f1b0e00d56)
Set LIB_PACKAGE= in lib/ncurses/Makefile.inc so the ncurses libraries
go into the ncurses-lib subpackage rather than the base package. This
means applications that depend on ncurses can be installed without
needing to install the various utilities and manpages.
This removes a dependency from runtime to ncurses (it now depends on
ncurses-lib instead).
Approved by: re (cperciva)
MFC after: 3 seconds
Reviewed by: kevans
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53060
(cherry picked from commit bde703e8b6)
(cherry picked from commit 9dab0e61a9)
Have the button labels refer to the artifact type directly (distribution
sets / packages), and use "Tech Preview" as packaged base is no longer
experimental.
Approved by: re (cperciva)
Reviewed by: ivy, cperciva
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52999
(cherry picked from commit abd9424590)
(cherry picked from commit dbd1e32296)
When creating VM images from pkgbase, the METALOG may not be in order;
in particular, files may be listed before the directories which contain
them. This causes makefs to create directories with 000 permissions.
Interestingly, such VM images boot just fine, since root ignores those
permissions; the first sign of trouble was sshd refusing logins with an
error message which said absolutely nothing about /etc/ having
incorrect permissions or being unable to read files inside it.
Immediately prior to running makefs, sort the METALOG file. While
we're here, uniquify as well; this does not guarantee that we do not
have duplicate paths, but if there are duplicate paths with different
settings something else has gone wrong and we don't really have any
good way of solving the problem anyway.
Approved by: re (cperciva)
Reviewed by: ivy
Hint from: imp
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53046
(cherry picked from commit 0cc81b375e)
(cherry picked from commit ad2ca1c5c1)
Fix the format when the output for a socket spans multiple lines.
Approved by: re (cperciva)
Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D52984
(cherry picked from commit 98b2a2265f)
(cherry picked from commit 7e567f51ff)
No functional changes intended.
Approved by: re (cperciva)
Sponsored by: Netflix, Inc.
(cherry picked from commit ab837a2eed)
(cherry picked from commit 3dac4b92ec)
Both use the same 16 bit var to store their locked and waiters bits,
then this in file_v_unlock:
state = atomic_load_16(flagsp);
if ((state & lock_wait_bit) == 0 &&
atomic_cmpset_rel_16(flagsp, state, state & ~lock_bit))
return;
can fail if for example foffset is being unlocked while setfl is getting
locked.
Afterwards the code assumes there are blocked waiters on foffset.
Approved by: re (cperciva)
Reviewed by: kib, markj
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D52915
(cherry picked from commit f43e19db6c)
Add an UPDATING entry about the renaming of blocklist.
Approved by: re (cperciva)
Approved by: emaste (mentor)
Fixes: 7238317403 ("blocklist: Rename blacklist to blocklist")
MFC after: 1 day
(cherry picked from commit ffa8165009)
(cherry picked from commit f22ca25404)
Previously, blacklist man pages were just a symlink to their blocklist
counterpart, this in turn installed blocklist man pages twice, and
resulted in a duplicate error when running metalog_reader.lua -c.
Take advantage of the duplication to document nuances in blacklist, such
as the fact that it uses the new database and socket name (blocklist).
Also, note that it has been renamed to blocklist. In the future, it
will help to document its deprecation.
Approved by: re (cperciva)
Approved by: emaste (mentor)
Fixes: 7238317403 ("blocklist: Rename blacklist to blocklist")
MFC after: 2 days
(cherry picked from commit c624004553)
(cherry picked from commit f935c0f66f)
Silence a bogus warning about (an ethernet) anchor not being found.
It has been reported as PR 280516. In the meantime, just sweep under
the carpet.
Approved by: re (cperciva)
Approved by: emaste (mentor)
MFC after: 2 days
(cherry picked from commit 2347ca21d6)
(cherry picked from commit ba5768504b)
Follow up upstream rename from blacklist to blocklist.
- Old names and rc scripts are still valid, but emitting an ugly warning
- Old firewall rules and anchor names should work, but emitting an ugly
warning
- Old MK_BLACKLIST* knobs are wired to the new ones
Although care has been taken not to break current configurations, this
is a large patch containing mostly duplicated code. If issues arise, it
will be swiftly reverted.
Approved by: re (cperciva)
Reviewed by: ivy (pkgbase)
Approved by: emaste (mentor)
MFC after: 2 days
Relnotes: yes
(cherry picked from commit 7238317403)
(cherry picked from commit 7f6f2139ee)
Upstream commit ddf6d71 ("implement BLOCKLIST_BAD_USER as a "one-count"
failure") introduced BLOCKLIST_BAD_USER with a one-count failure
mechanism. BLOCKLIST_AUTH_FAIL was implemented with a two-count failure
mechanism. Since we have been utilizing BLOCKLIST_AUTH_FAIL, the number
of failed attempts now doubles towards the maximum limit (nfails),
giving system administrators the impression that the number of failed
authentication attempts is inaccurate.
Revert this commit until a consensus has been reached. We do not want
to introduce yet another breaking change with the renaming of the
library.
Approved by: re (cperciva)
Approved by: emaste (mentor)
MFC after: 2 days
(cherry picked from commit 4d56eb007b)
(cherry picked from commit a719ef67e8)
Merge commit '70f30afd4e9af5a51ee324d97e4d8c5f2124ec15'
Breaking changes:
- Upstream commit 24932b6 ("blocklistd: log the conf file line number
with bad protocol errors") breaks backward database compatibility.
An error will be displayed:
Key size mismatch 296 != 288
A new and compatible database, with the new name, will be created when the
service starts (committed separately).
- Upstream commit ddf6d71 ("implement BLOCKLIST_BAD_USER as a
"one-count" failure") introduced BLOCKLIST_BAD_USER with a one-count
failure mechanism. BLOCKLIST_AUTH_FAIL was implemented with a
two-count failure mechanism. Since we utilize BLOCKLIST_AUTH_FAIL, the
number of failed attempts now doubles towards the maximum limit
(nfails). This commit will be reverted separately.
Changes:
https://github.com/zoulasc/blocklist/compare/7093cd9...8aa81bf
Approved by: re (cperciva)
Approved by: emaste (mentor)
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D52869
(cherry picked from commit 48e64ca13d)
(cherry picked from commit 1a08326c6f)
The file /usr/local/etc/ssl/cert.pem is not present on "small" and
"builder" AMIs, so we don't need to add it to METALOG.
Approved by: re (cperciva)
Fixes: 2b0ffc0ee4 ("EC2: metalog_add missing files from packages")
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
(cherry picked from commit 8a7ac88aa3)
(cherry picked from commit e9010214e9)
To build set-src, we first need to build the source packages. Add a
.ORDER to ensure this happens. Otherwise, in a parallel build, sets
might be built before the src-* packages have finished building, and
set-src will be mysteriously missing.
Approved by: re (cperciva)
MFC after: 3 seconds
Reported by: cperciva
Actually diagnosed by: jrtc27
One-line fix by: ivy
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D53076
(cherry picked from commit ea5685ba79)
(cherry picked from commit 3b5ec539be)
Add generation of a bzip2.pc file for use with pkg-config and create
a basic template as bzip2.pc.in.
This allows other software to easily locate and link against libbz2
using standard pkg-config mechanisms instead of manual compiler and
linker flags.
The version number is extracted automatically from bzlib.h to keep
it consistent with the library sources.
Approved by: re (cperciva)
Tested: pkg-config --exists --print-errors "bzip2 >= 1.0.9" (fail, expected)
pkg-config --exists --print-errors "bzip2 >= 1.0" (succeeded)
pkg-config --libs bzip2 (-lbz2)
pkg-config --cflags bzip2 ()
(cherry picked from commit 5863197933)
(cherry picked from commit f139a644d3)
Move the library, but not any of the runtime. This allows executables
to link against libbluetooth without having to pull in the entire BT
stack.
Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: dch, emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53016
(cherry picked from commit 426891e0f8)
(cherry picked from commit dced18c770)
This is the correct place for them, and also issues an incorrect
dependency from utilities to sound.
Approved by: re (cperciva)
Fixes: 1b806e607f ("packages: Add a sound package")
MFC after: 3 days
Reviewed by: christos, dch
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53015
(cherry picked from commit 419dcdc2c9)
(cherry picked from commit 861225fbe3)
PR#289734 reports a crash in tcp_use_close() when the rpc.tlsservd
daemon is being used. Although I have no, as yet, had time to track
down/fix the race, it turns out setting rpctls_maxthreads to 1
avoids the problem.
This patch pins rpctls_maxthreads to 1 to avoid the problem,
until there is a proper fix.
Approved by: re (cperciva)
PR: 289734
(cherry picked from commit 7a289fe3cd)
(cherry picked from commit a7fc4e326c)
This didn't show up in testing on main or stable/15 because it only
applies for "release" (BETA and onwards) builds.
Approved by: re (cperciva)
Fixes: afdc022deb ("release: Publish pkgbase-repo.tar")
MFC after: 30 seconds
Sponsored by: https://www.patreon.com/cperciva
(cherry picked from commit 474ae083b1)
(cherry picked from commit 5de7bdab32)
The files
/usr/local/etc/dhclient.conf
/usr/local/etc/ssl/cert.pem
are created in EC2 images by installed packages, but are not being
registered in METALOG. The reason for this is not immediately clear,
but may be related to the handling of "sample" files.
Approved by: re (cperciva)
Reviewed by: dch
MFC after: 5 minutes
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53035
(cherry picked from commit 2b0ffc0ee4)
(cherry picked from commit 63da8d2639)
The files /etc/login.conf.db, /etc/passwd, /etc/pwd.db, /etc/spwd.db,
and /var/db/services.db are generated at install time. When VM images
are built using installworld, there is Makefile code which emits the
necessary METALOG lines; but the pkgbase triggers do not do this. This
resulted in VM images which lacked these essential database files.
VM images are currently the only place where this matters, since this
issue is specific to non-root image builds uusing pkgbase. (In some
point in the future we will start building release ISO iamges from
pkgbase, at which point it will be a problem there as well.)
The long-term solution for this is probably to teach the relevant
database-creating tools to emit METALOG lines; but for now, just log
the necessary files from vmimage.subr.
Approved by: re (cperciva)
Reviewed by: dch
MFC after: 5 minutes
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53034
(cherry picked from commit 6081365c27)
(cherry picked from commit b3c5c7d6f1)
Update from ALPHA5 to BETA1
Switch pkg(8) configuration to use the quarterly repository
Bump __FreeBSD_version
Approved by: re (implicit)
Sponsored by: https://www.patreon.com/cperciva
2025-10-09 23:59:00 +00:00
2464 changed files with 132457 additions and 89226 deletions
Loaded 100 of 2464 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.