The f_menu_wpa_scan_results() function returns a list of networks
discovered by a scan. The untrusted network names are evaluated in
f_dialog_menu_wireless_edit. The quoting applied in
f_menu_wpa_scan_results() protects against evaluation of something like
"$(whoami)" but one can add single quotes to defeat that.
Pass the SSID names through f_shell_escape to work around this. Escape
single quotes in f_dialog_wireless_edit() and f_menu_wireless_configs()
too for consistency.
I note that this module doesn't seem to actually work, see e.g.,
bugzilla PR 229883.
Approved by: so
Security: FreeBSD-SA-26:23.bsdinstall
Security: CVE-2026-45255
Reported by: Austin Ralls
Reviewed by: dteske, des
Differential Revision: https://reviews.freebsd.org/D56974
The wlanconfig utility is not careful about handling untrusted network
names, which can contain shell metacharacters. Factor network selection
into a subroutine and use the `set -- "$@"` trick to build up a list of
positional parameters for bsddialog without evaluating them.
Approved by: so
Security: FreeBSD-SA-26:23.bsdinstall
Security: CVE-2026-45255
Reported by: Austin Ralls
Reviewed by: dteske, des, asiciliano
Differential Revision: https://reviews.freebsd.org/D56973
We already run `certctl rehash` at the end, there is no point in asking
users upgrading from 15.0 to 15.1 to manually merge the trust store.
Approved by: so
Security: FreeBSD-EN-26:13.freebsd-update
MFC after: 3 days
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D57028
(cherry picked from commit 2509ddee9bdb2240ba2f622e3a55a98ebc2aa4ae)
(cherry picked from commit 7d9c1d3895b307085131f922d7e46a4812f04675)
pcap-int.h now references SIZEOF_TIME_T from libpcap's config.h, which
is not available to consumers of the internal header outside of the
libpcap build. Switch to the public <pcap.h> header and replace the
direct FILE* casts and ferror()/fflush() calls with pcap_dump_flush(3),
which is the correct public API for flushing a pcap dump file.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit a0b3ef1952603ebf0307ca723b03e5a71598dd5a)
download.freebsd.org is backed by project mirrors and a CDN, which
should benefit most users.
Sponsored by: The FreeBSD Foundation
Reviewed by: delphij (releng)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D54849
(cherry picked from commit 45079cdf8b517adf803db7dc7aa85e5728cfeb2f)
update_uefi_bootentry assumes that the caller sets FREEBSD_BOOTNAME and
mntpt, which isn't the case anymore. The result is that there is no
"FreeBSD" boot entry created/updated after install. Most machines manage
to boot from the removable media path (if the loader is installed there
too), but some don't.
Take the loader's path as an argument and rename the variable used in
the ZFS mirror loop so mntpt can be reused below.
Also mark nentries as a local variable so it doesn't leak out of the
function.
PR: 293385
Fixes: 494de51bc0074472d1b01604f085daea0844f240
MFC after: 2 days
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55469
(cherry picked from commit 0fd91c489134643ac9e38c0f55ba7464fe892c5e)
Replace CD-ROMs with "discs, USBs, or network boot environments"
to both modernize aesthetic and also nudge youths to think at scale.
Since I'm disrupting the flow of these lines anyway, expand the VM
acronym because I think this is one of the first manuals people will
be looking at.
Reset list alignment to seven characters. It was at 19 characters,
and that was not enough to align them all, wasting many extra lines
by crunching all the words over. Seven actually bought us some lines
from six due to avg item size. Tag SPDX.
MFC after: 3 days
Discussed with: ivy, zi
(cherry picked from commit 81d9e08a4df42079d5e163b5991d5d6f3a28d4f0)
Normally after partitions are created by the installer, the 'mount'
script is used to mount the target disk partitions under /mnt. The
tail end of this script also mounts a couple of additional filesystems
under /mnt so that chrooted programs can work such as devfs and
/packages.
When the "Shell" option is used to permit the user to manually mount
the destination filesystem, the "mount" script is not used as the user
is instructed to mount the target filesystems and construct
/mnt/etc/fstab, etc. However, this means that the user is responsible
for mounting devfs (which is not included in /etc/fstab) and /packages
as well. The help message for the "Shell" option doesn't mention
these requirements, so users may not know to do so. This can lead to
confusing errors as chrooted commands can fail to find needed /dev
entries. For example, running fwget to fetch wireless firmware fails
because /dev/pci doesn't exist.
To make this less painful for users using this option, split out the
bottom half of the 'mount' script that mounts these non-fstab-related
filesystems into a separate 'mount_aux' script. Invoke 'mount_aux'
after using "Shell" to create the filesystem to ensure that these
filesystems are always present.
PR: 290901
Reported by: Peter <freebsd@peterk.org>
Tested by: Peter <freebsd@peterk.org>
Differential Revision: https://reviews.freebsd.org/D53770
(cherry picked from commit f63a8c0a0915a3eceac179d4d18b2c03b1319fa2)
Historic context: rtsold is used by *sense to get a router address which
wasn't originally the daemon's purpose. We only ever get the first address
per interface lifetime so if the RA contains an invalid router with a zero
lifetime and we catch it we cannot get a valid one ever again.
This is suboptimal in a number of ways, but the obvious way to deal with
this is to ignore all RA messages from routers that do not advertise a
default route.
PR: https://github.com/opnsense/core/issues/9551
1 GiB is a convenient disk image size for testing. It is also the
installer's minimum size, but the minimum applies to the partition
rather than the whole disk. Testing with a 1 GiB image resulted in the
counterintuitive error "There is not enough free space on <disk> to
install FreeBSD (1.0 GB free, 1.0 GB required)."
Reduce the installer's minimum size slightly to support this case.
Reviewed by: brd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38881
(cherry picked from commit 57e12d3973)
This is consistent with other operating systems and with bsdinstall's
UFS config and with bsdinstall's ZFS config prior to commit
0b7472b3d8.
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 4109cdf0f817162cf3032aa589dd180dfa910025)
(cherry picked from commit 65e347d315)
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.
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 4e36942420712c2ab6ebc2c646e61d47b2b68e7b)
(cherry picked from commit 980aa8d4cf)
It hasn't worked for some time -- as reported in review D40816
"Installing FreeBSD with Auto ZFS + MBR has been broken ever since the
move to OpenZFS with FreeBSD 13." It relied on the partition table and
ZFS data overlapping in a very fragile way and is not a good idea.
Reviewed by: jhb
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51028
(cherry picked from commit ee110941e3)
For proper redundancy, add copies of loader.efi to each of the ESPs we
create when we create multi-volume ZFS datasets. zfsboot creates a list
of secondary ESPs, while bootpart doesn't create any (it's the UFS
partitioning tool) because we don't supporg UFS over gmirror. The
primary ESP is mounted and is what we use efibootmgr to boot from. The
redundant copies allow the system to boot if the primary disks fails.
Sponsored by: Netflix
MFC After: 2 days
PR: 208802
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D52780
(cherry picked from commit 494de51bc0074472d1b01604f085daea0844f240)
All datasets on zroot pool are compressed by default since FreeBSD 11.0 [1],
no need to mention that on some specific datasets these days.
[1] 47206692f2
Reviewed by: jrm (mentor), ziaee
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52304
(cherry picked from commit f304c5bb8be65df83b86f8a50e1c7982b266262d)
Upgrading from 14.x to 15.x with freebsd-update broke because libc
depends on the new libsys library; freebsd-update installed the new
libc before creating libsys, and every step after that failed because
all the tools (including gunzip and install) are dynamically linked
and need a working libc.
Enforce ordering when installing shared objects: First libsys, then
libc, then libthr, and then all the rest of the shared object files.
This is a candidate for an Errata Notice since the issue this fixes
breaks upgrades.
PR: 289769
Reported by: Graham Perrin
Reviewed by: kib
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D52688
Approved by: so
Security: FreeBSD-EN-25:18.freebsd-update
(cherry picked from commit 7ece602e00e85195fc426a2401c49921cd39735e)
(cherry picked from commit e26928669f39c8683aea74040b9e2472e944c43a)
When reinstalling FreeBSD bsdinstall reported "There are multiple
FreeBSD EFI boot entries." This sounds like something went wrong in the
past. Clarify that there may be only one existing entry, which is not
surprising for a reinstall.
Reviewed by: manu, ziaee
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51527
(cherry picked from commit ebc6ff8db1)
According to zfsprops(7), the canonical property for the compression
algorithm is "compression", with "compress" accepted as an alternate
name. Use the canonical name in bsdinstall.
While here, change "lz4" to "on" so we pick up any future changes in
the default compression algorithm.
MFC after: 1 week
Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D51572
(cherry picked from commit 16045420e7)
It is possible to restart the installation process upon errors, when
installing normally through the `auto` script, or when installing a jail
with the `jail` script. However, some values obtained interactively from
the user or guessed by some scripts were kept in the environment when
restarting the process; this made it impossible to re-run some steps as
expected after the restart.
For instance, if a bad choice of mirror was made in the `mirrorselect`
phase, restarting the installer remembered the choice made, and would
never prompt for a different one again. Rebooting was then the only easy
way out of this situation.
This change restores a pre-defined list of environment variables when
restarting the installation process.
PR: 266987
Reviewed by: emaste
Approved by: philip (mentor)
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D42281
(cherry picked from commit 9de72af2cc)
Without the extra '\n' the dual-column ('REGD' '') are not properly
separated for dialog which leads to an [misleading] error hidden on
the command line:
Error: --menu bad arguments items number.
[Writing this I wonder why the dual-column input is needed].
It is still unclear as to where the error message quoted in PR287538
suddenly came from for 14.3-RELEASE given the code was broken since 2016
(or noone ever noticed or reported).
Looking at manual ifconfig output:
ifconfig wlan0 country GB regdomain Expected
-> ifconfig: unknown regdomain Expected
and "ifconfig: " gets stripped by the script, which means the regdomain
variable would have to be set to "Expected" or more likely to
"Expected eval: Use: not found" which looks like a concatination of
errors.
Sponsored by: The FreeBSD Foundation
Fixes: 95ee591e83
PR: 287538
Reviewed by: emaste, thj
Differential Revision: https://reviews.freebsd.org/D51313
(cherry picked from commit 5a1e2927d6)
Update the script to support all the sub-drivers we compile now.
Some minor polishing as well.
Update fwget(8) as more IDs were added.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 91f53f4e06)
if allow.routing is set, the jail can modify the system routing table
even if it's not a VNET jail.
Reviewed by: kevans, des, adrian
Approved by: kevans (mentor), des (mentor)
Differential Revision: https://reviews.freebsd.org/D49843
(cherry picked from commit 3a53fe2cc4)
This allows 'certctl rehash' to do the right thing when ca_root_nss is
installed, instead of linking the entire bundle to the hash of the
first certificate it contains.
MFC after: 3 days
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D42087
(cherry picked from commit a401c8cb26)
certctl: Fix recent regressions.
- If an untrusted certificate is also found in the list of trusted
certificate, issue a warning and skip it, but don't fail.
- Split on -+BEGIN CERTIFICATE-+ instead of "Certificate:" since
that's what we're really looking for.
Also fix a long-standing bug: .crl files are not certificates, so we
should not include them when searching for certificates.
Reported by: madpilot, netchild, tijl
Reviewed by: netchild, allanjude
Differential Revision: https://reviews.freebsd.org/D42276
(cherry picked from commit 87945a0829)
certctl: Convert line endings before inspecting files.
This ensures that certificate files or bundles with DOS or Mac line
endings are recognized as such and handled identically to those with
Unix line endings.
PR: 274952
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D42490
(cherry picked from commit f7d16a627e)
certctl: Revert to symlinks.
Unfortunately tar will not be able to extract base.txz to a system where
/etc and /usr are not on the same filesystem if the certificates are
hard links.
PR: 277828
Reviewed by: mp
Differential Revision: https://reviews.freebsd.org/D44496
(cherry picked from commit 3fed4f0db5)
(cherry picked from commit 9c34a6876a60dc10fda6ad6a0cbe8f99a372aadc)
Approved by: re (cperciva)
The kmod repositories were added shortly after 14.2-RELEASE. Point at
them here so that users don't need to manually add the configuration
in order to get e.g. working graphics.
Approved by: re (cperciva)
MFC after: 1 minute
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D50583
(cherry picked from commit 29f076ae0c)
(cherry picked from commit 8a2ce9f9dd6745e77bdfe78f03e96ddc8ad1b9d7)
If the user accepts our offer of a shell to perform final configuration
tasks before rebooting, start a login shell. This ensures it will have
the correct PATH and be able to install packages without issues.
Approved by: re (cperciva)
PR: 286722
MFC after: 3 days
Reviewed by: jrtc27, allanjude, emaste
Differential Revision: https://reviews.freebsd.org/D50297
(cherry picked from commit 5870d6a1ef)
(cherry picked from commit 242b52ba3c38108f2c2af4194a031ed495b95dbc)
Mountd reloads the exports(5) file(s) when it receives a SIGHUP
and then compares the old and new exports, updating any ones that
have changed in the kernel.
Without this patch, mountd failed to recognize that a network/host(s)
had changed, if there was no other change to the exports line.
As such, the change of network/hosts(s) did not take effect until
the mountd daemon was (re)started.
This patch fixes the code so that it checks for changes in
the network/host(s) list for an exports line.
PR: 286260
Approved by: re (cperciva)
(cherry picked from commit 68daa781c1)
(cherry picked from commit 37abcf06f2100eeca41dbd67f8ca8228903ce5e8)
Disk offset values must always be 64-bit, not size_t.
PR: 214874
Submitted by: pprocacci@gmail.com
Event: January 2025 Bug-busting session
(cherry picked from commit f26fe2c666)
pfInterfacesIfRefsState was described as 'Null', which upset bsnmpwalk's attempt
to resolve OIDs to symbolic names:
> bsnmpwalk: Error adding leaf pfInterfacesIfRefsState to list
This was done back in d6d3f01e0a, because we don't return this value any
more. Return it to 'Unsigned32', which fixes things, even if we still don't
actually return this value.
While here update the ORGANIZATION to reflect current ownership.
Reviewed by: philip
MFC after: 2 weeks
Event: Tokyo Hackathon 202503
Differential Revision: https://reviews.freebsd.org/D49413
(cherry picked from commit 712309a645)
- Fix allocation size in config_get_repositories().
- Fix a memory leak in read_conf_file().
- Avoid a null pointer dereference in an error path in
verify_pubsignature().
Fixes: e3b4a51580 ("pkg(7): expand VERSION_MAJOR, VERSION_MINOR, RELEASE and OSNAME")
Fixes: dc4581589a ("pkg: clean support for repositories")
(cherry picked from commit c1557708f1)
This handles copying in install-boot.sh and bsdinstall's bootconfig.
install-boot.sh:
make_esp_file now optionally takes extra arguments so it can copy
multiple files. This is used by the amd64 release scripts.
make_esp_device also takes an extra optional argument for efibootname.
This is currently unused, but it can be used in the future to do
something like:
make_esp_device loader.efi bootx64
make_esp_device loader_ia32.efi bootia32
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
(cherry picked from commit 599273f942)
PR#284616 reported that --maxthreads did not
obey the 256 thread limit defined as MAXNFSDCNT in nfsd.c.
This is actually a feature and not a bug, since many NFS
servers will now want to run more than 256 threads and
--maxthreads can be used to set the upper bound on the
number of threads. (MAXNFSDCNT was used long ago to
define how many daemons would be forked, before daemons
were replaced by kernel threads.)
However, the nfsd.8 man page was misleading, since it
indicated that "-n" was the equivalent to setting both
--minthreads and --maxthreads to the same value.
This patch fixes the man page.
This is a content change.
PR: 284616
(cherry picked from commit f27afbd850)
Some device models, LPC in particular, will call pci_host_read_config()
when probing for devices. Currently this results in pcifd_init()
opening /dev/pci, and thus bhyve holds the fd open even when it's not
needed.
Modify pci_host_{read,write}_config() to open /dev/pci independent of
the global pcifd. This means that these routines can only be used
during VM initialization, as capsicum will prevent further opens
afterward. Introduce internal wrappers which use the global pcifd,
intended for the passthru code.
Reviewed by: jhb
MFC after: 3 weeks
Fixes: 563fd2240e ("bhyve: export funcs for read/write pci config")
Differential Revision: https://reviews.freebsd.org/D48908
(cherry picked from commit 649a910e34)
Catchup with pkg(8) by expanding more variable when parsing repositories
The only missing variable now is ARCH, this will have to wait for
pkg 2.0 to be the lowest supported version.
(cherry picked from commit e3b4a51580)
with pkg(8) it is possible to overwrite a configuration like adding
FreeBSD {
enabled: false
}
in /usr/local/etc/pkg/repo/overwrite.conf which allows to change any
value which can have been reviously configured in anything in
/etc/pkg/*.conf
now the bootstrap supports the same
MFC After: 3 weeks
(cherry picked from commit 5c341fe512)
Rework the way the bootstrap fetches pkg, by implementing a full support
for the repositories, the boostrap will now loop over all available repo
and try to fetch the full package from there. It will at the first valid
package found.
Fallback to packagesite (which has been deprecated for a while) if needed, by
transforming it into a repo, if no repo is found.
MFC After: 3 weeks
(cherry picked from commit dc4581589a)
Rock Ridge extensions include an inode field:
"POSIX File Serial Number" shall have the same meaning as and may be
used for the st_ino field of POSIX:5.6.1. This field shall be
recorded according to ISO 9660:7.3.3. Directory Records which share
the value of this field are defined as links (see POSIX:2.2.2.17)
and, by definition, point to the same file or directory.
Previously we'd store the source file's st_ino (except that in metalog
mode we'd record 0 for files with nlink = 1). This had two issues: the
generated ISO image was nonreproducible due to the arbitrary inode
numbers, and files without hard links would falsely be detected (by
certain tools) as hard links to each other.
Note that the kernel's cd9660(5) file system ignores the Rock Ridge
PX File Serial Number, so this issue isn't observed by mounting such a
file system.
Instead of using the source inode directly, assign target inode numbers
sequentially. Use a map so that files with the same source inode (hard
links) still receive the same target inode number.
PR: 284795
PR: 285027
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49141
(cherry picked from commit 518cdd344e)
(cherry picked from commit 337f5e7a44)
(cherry picked from commit a18be39aaf)
Seems like there was an intention to use command line switches
-m, -p and -v (each with argument), but there is no handling
for them.
Also, some enhancements to the usage()/manpage:
- use FreeBSD manpage style -- square brackets -- for denoting
optional arguments in usage();
- show default directory path in usage();
- update manual: -f is the optional flag;
- show descriptions for -I/-D together: they are logically related.
Signed-off-by: Eygene Ryabinkin <rea@FreeBSD.org>
Reviewed by: wulf
MFC after: 1 month
(cherry picked from commit 0feaf865ce)