Commit Graph

19697 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
0a9b374ecc chown: see also chmod.
Sponsored by:	Klara, Inc.
MFC after:	1 week
2022-08-24 20:21:39 +02:00
Brooks Davis
e9ad2964f5 pkg: Add limited --debug/-d support
Add an internal debug level global:
 - Level 1 (-d) currently does nothing.

 - Level 2 (-d -d) enables libfetch debugging (quite verbose) so it's
   possible to see what pkg is attempting to download without having
   to sniff traffic.

Reviewed by:	debdrup, bapt
Differential Revision:	https://reviews.freebsd.org/D35756
2022-08-24 18:32:09 +01:00
Navdeep Parhar
f6cc21e8e1 cxgbetool: remove unnecessary vertical whitespace.
No functional change.

MFC after:	3 days
2022-08-19 15:38:13 -07:00
John Baldwin
baf753cc19 bhyve: Support other schemes for naming pass-through devices.
Permit naming pass through devices using the syntax accepted by
pciconf (pci[<domain>:]<bus>:<slot>:<func>) as well as by device name
(e.g. "ppt0").

While here, fix an error in the manpage that had the bus and slot
arguments for the original /-delimited scheme swapped.

Reviewed by:	imp, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36147
2022-08-19 14:58:55 -07:00
Alexander Motin
3b7935f33b Decode couple arrays in NFIT table.
MFC after:	1 week
2022-08-18 21:30:38 -04:00
Jessica Clarke
c6890399fc makefs: Fix issues building as a cross-tool on non-FreeBSD
This adds missing includes, uses the standard dirent.h rather than the
BSD-specific sys/dirent.h subset (which works on macOS but not Linux)
and works around Linux's lack of st_birthtim.

This allows usr.sbin/makefs to be added to LOCAL_XTOOL_DIRS again on
macOS and Linux so that disk images can be cross-built.

Reviewed by:	markj
Fixes:		240afd8c1f ("makefs: Add ZFS support")
Differential Revision:	https://reviews.freebsd.org/D36135
2022-08-18 02:46:28 +01:00
Jessica Clarke
b0ce7dfc5e makefs: Fix 32-bit issues in ZFS time attributes setting
Currently the code copies a struct timespec's raw bits as a pair of
uint64_t. On 64-bit systems this has the same representation, but on
32-bit issues there are two issues:

1. tv_sec is a time_t which is 32-bit on i386 specifically
2. tv_nsec is a long not a 64-bit integer

On i386, this means the assertion should fire as the size doesn't match.
On other 32-bit systems there are 4 bytes of padding after tv_nsec,
which in practice are probably 0, as this data is ultimately coming from
the kernel, so it's deterministic (though the padding bytes are not
required to be preserved by the compiler, so are strictly unspecified).
However, on 32-bit big-endian systems, the padding bytes are in the
wrong half to be harmless, resulting in the nanoseconds being multiplied
by 2^32.

Fix this all by marshalling via a real uint64_t pair like is done by the
real ZFS_TIME_ENCODE.

Reviewed by:	markj
Fixes:		240afd8c1f ("makefs: Add ZFS support")
Differential Revision:	https://reviews.freebsd.org/D36131
2022-08-18 02:46:27 +01:00
Mark Johnston
8502144d7a makefs tests: Add test cases for handling of multiple staging dirs
Sponsored by:	The FreeBSD Foundation
2022-08-17 17:28:01 -04:00
Mark Johnston
582ce32ff8 makefs tests: Whitespace fixes
Sponsored by:	The FreeBSD Foundation
2022-08-17 17:28:00 -04:00
Mark Johnston
8eca320798 makefs: Handle multiple staging directories when creating ZFS pools
The fsnode tree traversal routines used in ZFS mode assume that all
children of a (directory) fsnode can be accessed using a directory fd
for the parent and the child name.  This is true when populating the
image using an mtree manifest or from a single staging directory, but
doesn't work when multiple staging directories are specified.

Change the traversal routines to use absolute path lookups when an mtree
manifest is not in use.  This isn't ideal, but it's the simplest way to
fix the problem.

Reported by:	imp
Sponsored by:	The FreeBSD Foundation
2022-08-17 17:28:00 -04:00
Jens Schweikhardt
3c405c7e83 Indicate which port gdb.1 and kgdb.1 come from. 2022-08-17 19:13:22 +02:00
John Baldwin
fa46f3704b bhyve e1000: Skip packets with a small header.
Certain operations such as checksum insertion and VLAN insertion
require the device model to rewrite the packet header.  The first step
in rewriting the packet header is to copy the existing packet header
from the source packet.  This copy is done by copying data from an
iovec array that corresponds to the S/G entries described by transmit
descriptors.  However, if the total packet length is smaller than the
headers that need to be copied as the initial template, this copy can
overflow the iovec array and use garbage values as the source pointer
to memcpy.  The PR used a single descriptor with a length of 0 in its
PoC.

To fix, track the total packet length and drop requests to transmit
packets whose payload is smaller than the required header length.

While here, fix another issue where the final descriptor could have an
invalid length (too short) that could underflow 'len' when stripping
the checksum.  Skip those requests instead, too.

PR:		264372
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	grehan, markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36182
2022-08-17 10:01:16 -07:00
John Baldwin
e7439f6aeb bhyve xhci: Cache the value of MaxPStreams when initializing an endpoint.
This avoids type confusion where a malicious guest could rewrite the
MaxPStreams field in an endpoint context after the endpoint was
initialized causing the device model to interpret a guest provided
address (stored in ep_ringaddr of the "software" endpoint state) as a
bhyve host process address (ep_sctx_trbs).  It also prevents a malicious
guest from triggering overflows of ep_sctx_trbs[] by increasing the
number of streams after the endpoint has been initialized.

Rather than re-reading the MaxPStreams value out of the endpoint context
in guest memory on subsequent operations, cache the value in the software
endpoint state.  Possibly the device model should raise errors if the
value of MaxPStreams changes while an endpoint is running.  This approach
simply ignores any such changes by the guest.

PR:		264294, 264347
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36181
2022-08-17 10:00:36 -07:00
John Baldwin
bcab868a65 bhyve: Style fix for read/write_config. 2022-08-17 10:00:09 -07:00
Chuck Tuffli
6391be3089 bhyve nvme: Switch to POSIX standard functions
Switch bzero to memset and bcopy to memcpy

Reviewed by:	imp, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36215
2022-08-16 17:23:27 -07:00
Brad Davis
17f4ded551 bsdinstall: add variables to allow skipping over some phases of the install
Reviewed by:	allanjude, dteske
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35357
2022-08-16 15:11:44 -06:00
Emmanuel Vadot
0c6b2a9179 pkgbase: Put accounting utilities in the acct package 2022-08-16 21:15:19 +02:00
Jens Schweikhardt
1f5e2d569d Oops, wlan(4) is not the removed an(4). Restore that paragraph. 2022-08-16 21:08:17 +02:00
Jens Schweikhardt
1b9ad57f7f The wi(4) and an(4) drivers have been removed. Delete dead xrefs. 2022-08-16 21:05:01 +02:00
Jens Schweikhardt
e1ae2a285a Indicate the port where the referenced man pages come from. 2022-08-16 20:57:30 +02:00
Mark Johnston
d06bf11c06 bhyve: Sprinkle const qualifiers where appropriate
No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Mark Johnston
37045dfa89 bhyve: Mark variables and functions as static where appropriate
Mark them const as well when it makes sense to do so.  No functional
change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Mark Johnston
75ce327a2c bhyve: Use "void" instead of empty parameter lists
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Mark Johnston
c4d26f027b makefs: Style
Reported by:	rpokala
Fixes:		187084dddd ("makefs: Align the block buffer used in ZFS mode")
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Chuck Tuffli
715f82e4f5 bhyve nvme: Support minimal Controller list
Controllers must support the Identify Controller list if they support
Namespace Management. But the UNH NVMe tests use this command regardless
of whether the device under test supports Namespace Management.

This implementation returns an empty Controller list (i.e., Number of
Identifiers is zero).

Fixes UNH Test 1.1.2

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36193
2022-08-16 09:15:53 -07:00
Chuck Tuffli
ec0efe34dd bhyve nvme: Fix reported SANICAP value
The NVMe specification only allows Controllers compliant with the
revision 1.3 and earlier specification to report a value of 0x0 in the
No-Deallocate Modifies Media After Sanitize (NODMMAS) field.

For our revision 1.4 Controller, report that media is not modified after
Sanitize as the implementation does not implement Sanitize.

Fixes UNH Test 1.1.2

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36192
2022-08-16 09:14:43 -07:00
Mark Johnston
0726cde8ea makefs tests: Re-enable the ZFS snapshot test
This reverts commit 35b587464a.

PR:		265849
Sponsored by:	The FreeBSD Foundation
2022-08-16 11:02:52 -04:00
Mark Johnston
4f816f5b11 makefs: Fix space accounting for the root DSL directory
Space used by the MOS is summed after all on-disk data structures are
finalized, so the MOS DSL directory represents a special case when
counting bytes used for each directory.  The DSL layer failed to update
the MOS DSL directory's parent, the root directory, accordingly, so the
root directory reported less space used than was used in reality.  Be
careful to update the root directory after the MOS is finalized.

PR:		265849
Sponsored by:	The FreeBSD Foundation
2022-08-16 11:02:51 -04:00
Mark Johnston
187084dddd makefs: Align the block buffer used in ZFS mode
For some dnode types, particularly ZAPs, we want the buffer to have
uint64_t alignment.

Sponsored by:	The FreeBSD Foundation
2022-08-16 11:02:51 -04:00
Mateusz Piotrowski
f9572577cf exports.5: Clean up EXAMPLES and STANDARDS
There was a missing sentence in the description of the second mount
entry in the example. Fix that and some other bits in the EXAMPLES
section.

Also, make the STANDARDS section a bit more readable.

MFC after:	1 week
Sponsored by:	Klara Inc.
2022-08-16 15:04:44 +02:00
Jens Schweikhardt
20f68c5f2d Indicate that xrefs to *roff,tbl,eqn et al are found in ports/textproc/groff. 2022-08-15 22:15:18 +02:00
Mark Johnston
35b587464a makefs tests: Skip a ZFS regression test in CI
It triggers panics after the latest OpenZFS import.

PR:		265849
2022-08-14 21:37:41 -04:00
Wanpeng Qian
9f678cfcb4 bhyve nvme: Fix firmware read only initialization
Summary:
Code was using the mask value without the shift.

Test Plan: Within FreeBSD/Linux guest, Identify NVMe controller to check the result.

Reviewed by:	chuck, imp
MFC after:	2 weeks
Signed-off-by:	Wanpeng Qian <wanpengqian@gmail.com>
Differential Revision: https://reviews.freebsd.org/D32659
2022-08-14 09:59:36 -07:00
WanpengQian
3cae10048d bhyve nvme: Fix Active Firmware Info
Summary:
Currently Active Firmware Info is not initialized.

Fix is to initialize the Active Firmware Info to Slot 1.

Test Plan: Within FreeBSD/Linux guests, show the Firmware Logpage to confirm.

Reviewed By:	chuck
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D32658
2022-08-14 09:59:36 -07:00
WanpengQian
eae0210cdd bhyve: Fix Number of Power States Supported value
Summary:
Set Number of Power States Supported to indicate 1 power state. Keep the
Power State Descriptor data structures as zero to indicate "Not
reported".

Test Plan:
Within FreeBSD/Linux guests, list the number of power states and check
the Max Power value.

Reviewed By:	markj, chuck
MFC after:	2 weeks
Signed-off-by:	Wanpeng Qian <wanpengqian@gmail.com>
Differential Revision: https://reviews.freebsd.org/D32657
2022-08-14 09:59:36 -07:00
Jens Schweikhardt
016aeb7ca0 The fdformat man page is in section 8 (not 1). 2022-08-14 18:14:52 +02:00
Mark Johnston
b6ecef28bf bhyve: Address uses of uninitialized variables in pci_nvme.c
The debug print in nvme_opc_get_log_page() would print an uninitialized
local variable.

In nvme_opc_write_read(), a failed LBA bounds check would cause
pci_nvme_stats_write_read_update() to be called with an uninitialized
variable as a parameter.  Although the parameter is unused when the
check fails (and so status != 0), LLVM 14 emits some bogus machine code
in this path, which happens to result in a segfault when it gets
executed.

PR:		265749
Reviewed by:	chuck, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36119
2022-08-14 11:59:01 -04:00
Mark Johnston
af86d12c80 bhyve: Address -Wunused* warnings in pci_nvme.c
Currently these are not reported because bhyve is compiled with WARNS=2.
Let's start taking small steps towards enabling more warnings.

No functional change intended.

Reviewed by:	chuck, imp, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36118
2022-08-14 11:56:33 -04:00
Chuck Tuffli
7376c08cc6 bhyve nvme: Fix uninitialized pointer
The Dataset Management code could free an uninitialized pointer if the
device doesn't support the Dataset Management command.

PR:		264548
Reported by:	Robert Morris <rtm@lcs.mit.edu>
2022-08-14 07:53:22 -07:00
Chuck Tuffli
d7d1becad4 bhyve nvme: Fix Controller init error cases
Fuzzing of bhyve uncovered an assertion failure in the NVMe emulation.
Investigation uncovered several corner cases the code did not handle.
This change handles several Controller initialization errors, including
 - bad AQ sizes
 - bad AQ vm_map_gpa
 - doorbell writes prior to RDY
 - doorbell writes to uninitialized queue
 - CSTS.RDY if CFS set

PR:		256317,256319,256320,256322
Reported by:	Cheolwoo Myung <cwmyung@snu.ac.kr>
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D35453
2022-08-14 07:47:34 -07:00
Chuck Tuffli
3d3678627c bhyve nvme: Check return value of mapped memory
Fuzzing of bhyve using hyfuzz discovered a way to cause a segmentation
fault in the NVMe emulation. If a guest specifies a physical address in
either the PRP1 or PRP2 field of a command that cannot be mapped from
guest to host, the function paddr_guest2host() returns a NULL pointer.
The NVMe emulation did not check for this error case, which allowed for
the segmentation fault to occur.

Fix is to check for a return value of NULL and indicate an error back to
the guest (Data Transfer error). While in the area, slightly refactor
the write/read blockif function to use a common error exit path.

PR:		256321
Reported by:	Cheolwoo Myung <cwmyung@snu.ac.kr>
Reviewed by:	imp, jhb
Differential Revision:	https://reviews.freebsd.org/D35452
2022-08-14 07:45:21 -07:00
Jens Schweikhardt
4ee44ffcca Indicate that kgdb.1 is from ports/devel/gdb. 2022-08-14 15:17:29 +02:00
Jens Schweikhardt
9356efa8c8 Indicate that X(7) cross refs are satisfied by ports/x11/xorg-docs. 2022-08-14 12:01:30 +02:00
Jens Schweikhardt
7c20397b72 In man page cross refs to sudo, indicate it comes from ports/security/sudo. 2022-08-14 11:44:43 +02:00
Chuck Tuffli
88951aaaee bhyve nvme: Fix out-of-bound IOV array access
Summary:
NVMe operations indicate the memory region(s) associated with a command
via physical region pages (PRPs). Since each PRP has a fixed size,
contiguous memory regions larger than the PRP size require multiple PRP
entries.

Instead of issuing a blockif call for each PRP, the NVMe emulation
concatenates multiple contiguous PRP entries into a single blockif
request. The test for contiguous regions has a bug such that it
mistakenly treats an initial PRP address of zero as a contiguous range
and concatenates it with the previous. But because there is no previous
IOV, the concatenation code corrupts the IO request structure and leads
to a segmentation fault when the blockif request completes.

Fix is to test for the existence of a previous range before trying to
concatenate the current range with the previous one.

While in the area, rename pci_nvme_append_iov_req()'s lba parameter to
offset to match its usage.

PR:             264177
Reported by:    Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	jhb
MFC after:      2 weeks
Differential Revision:	https://reviews.freebsd.org/D35328
2022-08-13 12:16:02 -07:00
Maxim Sobolev
6b3ad1d737 When -u option is used also set USER, HOME and SHELL variables.
This is consistent with what other uid-morphing utilities
do, i.e. jexec(1), su(1) etc.

MFC after:      2 weeks
Reviewed by:    gbe
Differential Revision:  https://reviews.freebsd.org/D36148
2022-08-12 10:07:56 -07:00
Alexander Motin
5244006fea ctladm: Fix typo in command line help.
MFC after:	1 week
2022-08-11 16:53:50 -04:00
Mark Johnston
78d7704b7c makefs: Fix a memory leak in fs_layout_one()
Check the canmount property before building the mountpoint string.

Reported by:	Coverity
Fixes:		240afd8c1f ("makefs: Add ZFS support")
Sponsored by:	The FreeBSD Foundation
2022-08-11 10:18:13 -04:00
Mark Johnston
e225983737 makefs: Fix memory leaks in dsl_dir_finalize_props()
nvstring_get() returns a copy of the string, not a pointer into the
nvlist's internal buffer.

Reported by:	Coverity
Fixes:		240afd8c1f ("makefs: Add ZFS support")
Sponsored by:	The FreeBSD Foundation
2022-08-11 10:18:06 -04:00
Jessica Clarke
febca0e643 etcupdate: Add a -N flag to perform a NO_ROOT build
This is in preparation for including an etcupdate tree when performing a
-DNO_ROOT release image build. Although -DNO_ROOT can be passed via -M,
to be useful we need to mangle the resulting METALOG to mirror the
various cleanups to the tree that are done after the build (removing
generated files, empty files and empty directories), so etcupdate needs
its own flag.

Reviewed by:	jhb, pauamma
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35857
2022-08-09 22:57:47 +01:00
Jessica Clarke
c5e30fbdb7 etcupdate: Prefer POSIX -depth to BSD -d
This is in preparation for building an etcupdate tree on non-FreeBSD
when building release images. The -d option is documented as a
BSD-specific equivalent to the POSIX -depth primary. Whilst GNU find
sort of accepts it in an attempt to be compatible, it still doesn't
permit it coming before the paths, unlike BSD find, and prints a
deprecation warning either way. Thus, use the equivalent POSIX -depth to
ensure it works correctly and without warning everywhere.

Reviewed by:	jhb
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35856
2022-08-09 22:57:22 +01:00
Jessica Clarke
5513d7dee5 etcupdate: Add a -m flag to change the make binary that's run
This will allow release/Makefile to forward on ${MAKE} to allow building
on non-FreeBSD systems where ${MAKE} is something other than make, as
make is typically GNU make in such situations.

Reviewed by:	jhb, pauamma
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35854
2022-08-09 22:56:19 +01:00
Gordon Bergling
75f8dcc831 mfiutil.8: Fix some mandoc warnings
- new sentence, new line
- no blank before trailing delimiter

MFC after:	3 days
2022-08-07 17:24:48 +02:00
Cy Schubert
e34667e449 unbound: Update version to 1.16.2
Chase 790c6b2451 to update the version to 1.16.2.

Reported by:	"Herbert J. Skuhra" <herbert@gojira.at>
MFC after:	3 days
X-MFC with:	790c6b2451
2022-08-06 01:59:22 -07:00
Mark Johnston
240afd8c1f makefs: Add ZFS support
This allows one to take a staged directory tree and create a file
consisting of a ZFS pool with one or more datasets that contain the
contents of the directory tree.  This is useful for creating virtual
machine images without using the kernel to create a pool; "zpool create"
requires root privileges and currently is not permitted in jails.
makefs -t zfs also provides reproducible images by using a fixed seed
for pseudo-random number generation, used for generating GUIDs and hash
salts.  makefs -t zfs requires relatively little by way of machine
resources.

The "zpool_reguid" rc.conf setting can be used to ask a FreeBSD guest to
generate a unique pool GUID upon first boot.

A small number of pool and dataset properties are supported.  The pool
is backed by a single disk vdev.  Data is always checksummed using
Fletcher-4, no redundant copies are made, and no compression is used.
The manual page documents supported pool and filesystem properties.

The implementation uses a few pieces of ZFS support from with the boot
loader, especially definitions for various on-disk structures, but is
otherwise standalone and in particular doesn't depend on OpenZFS.

This feature should be treated as experimental for now, i.e., important
data shouldn't be trusted to a makefs-created pool, and the command-line
interface is subject to change.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35248
2022-08-05 13:42:29 -04:00
Brad Davis
3e1101f29b bsdinstall: allow setting the root password via env variables
Reviewed by:	0mp, allanjude, asiciliano, dteske, pauamma, rpokala, sef
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35588
2022-08-05 09:10:21 -06:00
Gordon Bergling
2bf1b9984f uhsoctl.1: Fix the man page date
- STYLE: normalizing date format to: August 12, 2009

MFC after:	3 days
2022-07-31 12:27:10 +02:00
Gordon Bergling
e24fd6d664 bluetooth(3): Fix a typo in a source code comment
- s/intrrupt/interrupt/

MFC after:	3 days
2022-07-31 12:13:13 +02:00
Kirk McKusick
b21582ee03 Add a flags parameter to the ffs_sbget() function that reads UFS superblocks.
Rather than trying to shoehorn flags into the requested superblock
address, create a separate flags parameter to the ffs_sbget()
function in sys/ufs/ffs/ffs_subr.c. The ffs_sbget() function is
used both in the kernel and in user-level utilities through export
to the sbget() function in the libufs(3) library (see sbget(3)
for details). The kernel uses ffs_sbget() when mounting UFS
filesystems, in the glabel(8) and gjournal(8) GEOM utilities,
and in the standalone library used when booting the system
from a UFS root filesystem.

The ffs_sbget() function reads the superblock located at the byte
offset specified by its sblockloc parameter. The value UFS_STDSB
may be specified for sblockloc to request that the standard
location for the superblock be read.

The two existing options are now flags:

UFS_NOHASHFAIL will note if the check hash is wrong but will still
   return the superblock. This is used by the bootstrap code to
   give the system a chance to come up so that fsck can be run to
   correct the problem.

UFS_NOMSG indicates that superblock inconsistency error messages
   should not be printed. It is used by programs like fsck that
   want to print their own error message and programs like glabel(8)
   that just want to know if a UFS filesystem exists on a partition.

One additional flag is added:

UFS_NOCSUM causes only the superblock itself to be returned, but does
   not read in any auxiliary data structures like the cylinder group
   summary information. It is used by clients like glabel(8) that
   just want to check for possible filesystem types. Using UFS_NOCSUM
   skips the superblock checks for csum data which allows superblocks
   that have corrupted csum data to be read and used.

The validate_sblock() function checks that the superblock has not
been corrupted in a way that can crash or hang the system. Unless
the UFS_NOMSG flag is specified, it will print out any errors that
it finds. Prior to this commit, validate_sblock() returned as soon
as it found an inconsistency so would print at most one message.
It now does all its checks so when UFS_NOMSG has not been specified
will print out everything that it finds inconsistent.

Sponsored by: The FreeBSD Foundation
2022-07-30 22:51:38 -07:00
John Hood
60b92ba932 /usr/sbin/pkg: don't sleep on fetch failure
PR:	263458
2022-07-28 17:55:13 +02:00
Corvin Köhne
50526f522b bhyve: fix spelling mistake in passthru emulation
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D35707
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-07-27 18:20:47 +02:00
Alan Somers
982f980b86 prometheus_sysctl_exporter: ignore ENOENT for mibs specified on the CLI
They might belong to kernel modules not currently loaded, or to other
kernel versions.  Ignoring them allows the configuration to be shared
between multiple hosts.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	rew
Differential Revision: https://reviews.freebsd.org/D35540
2022-07-24 09:19:46 -06:00
Mateusz Piotrowski
adf9cd56fa pw.8: Refernece to openssl-passwd(1) and crypt(3)
It may be unclear how to generate an encrypted password hash for -H,
so point users to openssl-passwd(1) and crypt(3).

MFC after:	2 weeks
2022-07-21 20:08:05 +02:00
Mateusz Piotrowski
203be0938d jail.8: Fix formatting of synopsis and some code examples
MFC after:	3 days
2022-07-18 13:41:35 +02:00
Mateusz Piotrowski
aa35037ba5 beinstall.8: Update example distsites for BSDINSTALL_DISTSITE
MFC after:	1 week
2022-07-18 13:41:35 +02:00
Cy Schubert
752b6daecc unbound: Update version strings to 1.16.1
The last number of unbound upgrades failed to manually update the
version strings in usr.sbin/unbound/config.h. This commit fixes that.

Reported by:	"Herbert J. Skuhra" <herbert@gojira.at>
Fixes:		0a92a9fca7
		a39a5a6905
		9cf5bc93f6
		273016e836
		24e3652200
		5469a99530
MFC after:	3 days
2022-07-17 07:25:06 -07:00
Dimitry Andric
9917049b60 WPA_DISTDIR does not need to end in a slash
Since all uses of the macro also append a slash, this leads to double
slashes.

MFC after:	3 days
2022-07-16 17:45:26 +02:00
Gordon Bergling
d34de8d378 crunchide(1): Fix a typo in a comment
- s/maek/make/

Obtained from:	NetBSD
MFC after:	3 days
2022-07-16 13:32:47 +02:00
Jessica Clarke
232cf6be4b certctl: Introduce a new -d <distbase> option
This will be used by Makefile.inc1 to fix -DNO_ROOT distributeworld,
which needs to split out DESTDIR from DISTBASE so the METALOG file
includes the base/ prefix.

Reviewed by:	kevans
Obtained from:	CheriBSD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35808
2022-07-14 01:23:42 +01:00
Felix Johnson
39ad6e289f swapinfo.8: Mention BLOCKSIZE in the ENVIRONMENT section
Copy the ENVIRONMENT section from df(1) to swapinfo(8), except
that the --si option is removed for swapinfo.

PR:		235225
Reported by:	0mp
MFC after:	3 days
2022-07-08 21:35:33 +02:00
Alexander V. Chernikov
e1c7783e22 ndp(8): add structured output formatting via libxo
Differential Revision:	https://reviews.freebsd.org/D35677
MFC after:	2 weeks
2022-07-08 11:39:34 +00:00
Mateusz Piotrowski
ccee95df52 jail.conf.5: List configuration and example files
MFC after:	3 days
2022-07-08 10:50:31 +02:00
Warner Losh
5c19fabbe3 devinfo: xref devctl
devctl has ways to get the different locator's paths to devices, while
devinfo does not. xref devctl in devinfo(8) as a hint.

Sponsored by:		Netflix
2022-07-05 15:15:08 -06:00
Mateusz Piotrowski
4e3dc91e4c sesutil.8: Polish
- Use right mdoc macros
- Fix synopsis. Some of the optional command modifiers were not optional
  after all.
- Sort options

MFC after:	1 week
2022-07-05 16:39:01 +02:00
KUROSAWA Takahiro
d80d734937 arp(8): use getifaddrs(3) instead of ioctl(SIOCGIFCONF)
The original code had used a fixed-size buffer for ioctl(SIOCGIFCONF),
that might cause the target ifreq spilled from the buffer.  Use the handy
getifaddrs(3) to fix the problem.

Reviewed by:		glebius
Differential revision:	https://reviews.freebsd.org/D35536
2022-07-04 20:56:29 -07:00
Andrew Gallatin
0aa1507751 pmcstat: fix log analysis
pmcstat has been broken for analyzing logs since D35342 / b6e28991bf.

This is because the pmc for the first CPU is not added when reading logs
because unlike its clones, its event id is not invalid. That causes us
to fail the assertion at lib/libpmcstat/libpmcstat_logging.c:293
when encountering samples from cpu0.

Fix this by removing the check that the PMC is invalid

Reviewed by: tsoome
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D35709
2022-07-04 12:42:39 -04:00
Cy Schubert
7999a7f2a8 wpa: Enable WEP by default
As of hostap 2.10, WEP is disabled by default. This of course is not a
bad thing but requires some planning and an announcment to remove WEP
support by default. A possible src.conf knob or letting users know they
should use the port instead might different options.

MFC after:	3 days
2022-07-03 14:19:38 -07:00
Gordon Bergling
c7b9006af5 snmp_hostres(3): Fix a typo in a debug message
- s/atempt/attempt/

MFC after:	3 days
2022-07-03 14:57:12 +02:00
John Baldwin
e5ed417bb4 bhyve: Document the "type" config variable for network device models. 2022-06-30 15:14:36 -07:00
Yan Ka Chiu
b9c3e544c4 bhyve virtio-net: Allow backend type to be explicitly specified.
Surrently virtio-net uses the prefix of the backing interface to
choose the backend.  This patch adds an additional option "type" to
choose the backend type explicitly.  This allows greater flexibility
for end users to manage bhyve specific resources (such as by naming
the tap interfaces to more descriptive names).  The option "type" is
optional.  When it is not presented, the backend is derived from the
name of the backend interface.

For example, the line `-s 3,virtio-net,bsdvm0,type=tap` will create a
virtio-net device for the guest using the tap interface "bsdvm0".

Adding a new "type" option preserves the current legacy format in which
the first value after virtio-net names an instance of a backend.

Note that tap interfaces not following the pattern "tap*" will not be
created on demand via devfs cloning but must be created explicitly.

Reviewed by:	vmaffione, jhb
Differential Revision:	https://reviews.freebsd.org/D35143
2022-06-30 10:29:45 -07:00
Michael Tuexen
61a73acd88 tcpsso: improve man page
Describe explicitly the handling of TCP endpoints in the TIME-WAIT and
SYN-RCVD state.

Reported by:		glebius@
Reviewed by:		glebius@
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D35651
2022-06-30 18:37:09 +02:00
Mateusz Piotrowski
3beedc3840 pkg.7: Clean up mdoc
MFC after:	1 week
2022-06-30 16:22:02 +02:00
Fernando Apesteguía
4a3c598f35 Bump .Dd for recently modified manual pages
During the removal of named(8) references, some pages were modified but their
.Dd where not updated accordingly.

Reported by:	lwhsu@
Fixes:	942e234d86
2022-06-27 18:20:03 +02:00
Fernando Apesteguía
942e234d86 Remove references to named(8)
named(8) hasn't been in base for some time. Remove all references to it in
manual pages.

Approved by:	manpages (Pau Amma)
Differential Revision:	https://reviews.freebsd.org/D35586
2022-06-26 18:53:08 +02:00
Aleksandr Rybalko
b6e28991bf System wide and NUMA domain wide counters support. PMC classes for ARM DMC-620 and CMN-600.
Add support for system wide and NUMA domain wide counters support.
Add 3 new PMC classes for ARM DMC-620 and CMN-600 controllers PMU.

Reviewed by:	mhorne
Sponsored By:	ARM
Sponsored By:	Ampere Computing
Differential Revision: https://reviews.freebsd.org/D35342
2022-06-26 08:31:03 +03:00
Vitaliy Gusev
a85bbbea91 bhyve: Enable suspend/resume support for virtio-blk.
Reviewed by:	jhb
Sponsored by:	vStack
Differential Revision: https://reviews.freebsd.org/D26267
2022-06-23 11:46:06 -07:00
Vitaliy Gusev
cd9618bdb2 bhyve: Snapshot impovements for 'blockif' backend
When pausing a block I/O device model as part of suspending a VM, wait
for all active block I/O requests to finish before saving snapshot
data.  This avoids having to save information about in-flight requests
both in the block_if layer and in storage device models.

For the AHCI device model, the queues are now guaranteed to be idle
when taking a snapshot, so remove the code to save queue state and
rely on the initial state in a resumed VM having all queues already
idle.

This will also simplify adding NVMe snapshot support in the future.

Reviewed by:	jhb
Sponsored by:	vStack
Differential Revision: https://reviews.freebsd.org/D26267
2022-06-23 11:46:06 -07:00
Brad Davis
a320e9dd51 bsdinstall: improve zfsboots ability to handle datasets under a BE
Currently we only set canmount=noauto on the root of the BE, this
change makes it so we set it on all datasets under the BE as well.

Reviewed by:	allanjude
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35422
2022-06-23 09:21:08 -06:00
Cy Schubert
3e8eb5c7f4 wpa: Disable P2P in WPS
Disable P2P in WPS as it is not supported by FreeBSD. Also, it is not
enabled in wpa_supplicant so the WPS P2P code is redundant.

PR:		264238
Reported by:	adrian
MFC after:	3 days
2022-06-22 20:57:27 -07:00
Kyle Evans
4014365e42 mixer: remove volume backwards compat, add % interpretation
The current situation is fairly confusing, where an integer is interpreted
as a percent until you slap a decimal on it and magically it becomes an
absolute value.

Let's have a flag day in 14.0 and remove this shim entirely.  Setting with
percent can still be useful, so allow a trailing '%' to indicate as such.
As a side effect, we tighten down the format allowed in the volume a little
bit by ensuring there's no trailing garbage after the value once it's
separated into left and right components.

Reviewed by:	christos, hselasky, pauamma_gundo.com (manpages)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D35101
2022-06-17 22:50:58 -05:00
James Mintram
e16b709e2d bhyve: Report an error for invalid UUIDs.
Reviewed by:	rgrimes, grehan, jhb
Differential Revision:	https://reviews.freebsd.org/D30050
2022-06-16 13:18:01 -07:00
John Baldwin
73702c3980 pmcannotate: Don't increment end address passed to objdump -d.
libpmc already returns an end address that is after the end of the
last instruction of a function (on both amd64 and arm64) as the end
address written to the annotate map file is computed as the start
address of the symbol plus the size.

Adding one could result in a curious failure where an entire
function's contents in assembly was reduced instead to only the first
instruction.  The reason is that when the end instruction is bumped by
one, objdump -d can append the first instruction of the next function
in its output.  However, since pmcannotate concatenates all of the
objdump -d output from various functions into a single file which it
then searches to find the assembly for a given file, if this
additional trailer was earlier in the file than the full function, the
trailer was chosen to represent the entire function resulting in the
truncated listing of the function.

Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D35399
2022-06-14 10:52:54 -07:00
Mitchell Horne
ec1a13df03 Remove mips-specific Makefiles for /sbin and /usr/sbin
They are no longer needed, but were likely missed simply because they
don't show up in a grep for 'mips'.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D35475
2022-06-14 10:15:03 -03:00
Alan Somers
6a02539959 bsdinstall: allow an install script to access packages on the DVD
If installing from the DVD, mount its packages in the chroot at
/dist/packages.  That way they'll be accessible to an install script.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	gjb
Differential Revision: https://reviews.freebsd.org/D35330
2022-06-13 13:27:51 -06:00
Ed Maste
f92e0d6acd pkg-bootstrap: use latest package set on arm64 stable branches
As with i386 and amd64, "latest" packages are available on stable
branches for arm64/aarch64.

Reviewed by:	manu
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35445
2022-06-13 14:57:10 -04:00
Dmitry Ovsyannikov
9f48eea366 rpcbind: get contact addr from xprt members
Addition to D31491 in order to actually resolve the top root cause.

Currently rpcbind gets contact address from connectionless xprt->xp_p2
member of a transport and will fail to get it when working over
connection oriented transport, leading to a guess game in terms of
contact address on rpcinfo requests like RPCBPROC_GETVERSADDR or
RPCBPROC_GETADDRLIST and poor returns which may influence a user
of a call and specifically reported on OSX clients, which tend to
not provide address hint from rpcinfo request to a server.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D35220
2022-06-13 08:54:08 -05:00
Baptiste Daroussin
0a9541d9f3 pw: reinitialize struct tm before every call to strptime
This prevents corrupted result due to leftover of previous failed
call to strptime
2022-06-07 22:32:35 +02:00
Marc Fonvieille
45ef6b4b5d bsdinstall/scripts/docsinstall: Add Indonesian Documentation
Add Indonesian Documentation to docinstall menu.

Approved by:	doceng (implicit) re (gjb, implicit)
MFC after:	1 week
2022-06-06 13:44:43 +02:00
Brad Davis
3bcd261265 bsdinstall: allow overriding DISTRIBUTIONS in the normal auto mode
Reviewed by:	dteske
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35355
2022-06-05 19:04:04 -06:00
Gordon Bergling
0b4302aa93 acpi(4): Fix a typo in a debug statement
- s/Efficency/tEfficiency/

Obtained from:	NetBSD
MFC after:	3 days
2022-06-04 15:17:09 +02:00
Gordon Bergling
10924c4fc3 ac(8): Fix a typo in a source code comment
- s/chosing/choosing/

MFC after:	3 days
2022-06-04 12:41:20 +02:00
Gordon Bergling
df4da2d6b7 fstype(8): Fix two typos in source code comments
- s/auxillary/auxiliary/

MFC after:	3 days
2022-06-04 10:38:48 +02:00
Doug Rabson
5e9c888a7a pkgbase: Move pw to the runtime package
This allows building a container image with enough functionality for
downloading and installing packages without having to include the
utilities package.

Reviewed by: manu
MFC after:   2 weeks
2022-05-30 15:23:00 +01:00
Corvin Köhne
8284799a23 bhyve: use bhyve_config for SMBIOS strings
Some software uses SMBIOS entries to identify the system on which it's
running. In order to make it possible to use such software inside a VM,
SMBIOS entries should be configurable. Therefore, bhyve_config can be
used. While only a few SMBIOS entries might be of interest, it makes
sense that all SMBIOS entries are configurable. This way all SMBIOS
tables are build the same way and there's no special handling for some
tables.

Reviewed by:	jhb
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34465
2022-05-30 10:03:43 +02:00
Alan Somers
77d678b7a4 Fix a memory leak from caf73e5857
Don't shadow an already-local variable with another local declaration.

Reported by:	dteske
MFC after:	13 days
MFC with:	caf73e5857
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D35331
2022-05-28 13:17:37 -06:00
Alan Somers
caf73e5857 bsdinstall: fix prepopulating the ZFS disk menu with ZFSBOOT_DISKS
If the ZFSBOOT_DISKS variable is set to one or more disk names, then
those disks should be preselected in the disk menu.  However, the code
wasn't correctly setting the variable, leaving all disks unselected.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	dteske
Differential Revision: https://reviews.freebsd.org/D35331
2022-05-27 09:09:33 -06:00
John Baldwin
f8287caae4 etcupdate: Preserve permissions when installing a resolved file.
Similar to the change in 1a04446f08, use
cat to overwrite the contents of the existing file rather than cp so
that metadata of the existing file such as permissions and ownership
is preserved.

PR:		255514
Reported by:	uqs
MFC after:	1 week
2022-05-25 14:20:40 -07:00
John Baldwin
431944fb5f etcupdate: Don't rotate trees for a dry run.
When performing a dry run, remove the temporary tree created rather
than rotating the trees.  Rotating the trees meant that etcupdate
thought the latest changes were already merged and would not merge
them on the next real run.

PR:		260281
Reported by:	Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
Fixes:		0611aec3cf etcupdate: Always extract to a temporary tree.
MFC after:	1 week
2022-05-25 14:02:51 -07:00
Alan Somers
7919c76dbd bsdinstall: use gpt/efiboot0 label in /etc/fstab
Otherwise, boot will hang if the numbering of disks has changed since
initial install.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	brd
Differential Revision: https://reviews.freebsd.org/D35309
2022-05-24 13:17:10 -06:00
Brad Davis
cc42ef5328 bsdinstall: allow whitelabeling the scripts
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35197
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-24 09:49:06 -06:00
Brad Davis
33005c89c6 bsdinstall: break list of scripts out to one per line to make adding/removing entries easier
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35249
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-24 09:30:31 -06:00
Alfonso S. Siciliano
6368dcb292
bsdinstall hostname: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.
Add --hline info because bsddialog requires TAB to switch the focus on
buttons for an inputbox, dialog differs.
Delete f_dialog_inputbox_size() using libbsddialog autosizing.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35285
2022-05-24 14:20:22 +02:00
Rick Macklem
b387a075d9 rpc.tlsclntd: Add the -2 option to the usage line
Commit 72bf76d6b8 added the -2 option to use
TLS 1.2 NFS-over-TLS mounts.  It did not add -2
to the usage message.

This patch adds -2 to the usage message.

MFC after:	2 weeks
2022-05-22 14:41:20 -07:00
Rick Macklem
b4fa7fde15 rpc.tlsservd: Add the -2 option to the usage line
Commit 0637b12b13 added the -2 option to allow
TLS 1.2 NFS-over-TLS mounts.  It did not add -2
to the usage message.

This patch adds -2 to the usage message.

MFC after:	2 weeks
2022-05-22 14:36:20 -07:00
Rick Macklem
915fc1afe5 rpc.tlsclntd: Add the -2 option to the man page
Since the KTLS now supports TLS1.3, the daemons default
to version 1.3, since the draft (to be an RFC someday)
requires TLS1.3.

However, since FreeBSD 13,0, 13,1 uses TLS1.2 for
NFS-over-TLS, the "-2" option is added to both daemons
for compatibility with FreeBSD 13.0, 13.1.

This patch updates the man pages for this.

This is a content change.

Reviewed by:	pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35290
2022-05-22 14:20:14 -07:00
Rick Macklem
e2c72fecfc rpc.tlsservd: Add the -2 option to the man page
Since the KTLS now supports TLS1.3, the daemons default
to version 1.3, since the draft (to be an RFC someday)
requires TLS1.3.

However, since FreeBSD 13,0, 13,1 uses TLS1.2 for
NFS-over-TLS, the "-2" option is added to both daemons
for compatibility with FreeBSD 13.0, 13.1.

This patch updates the man pages for this.

This is a content change.

Reviewed by:	pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35290
2022-05-22 14:17:06 -07:00
Rick Macklem
0bf3f379e1 rpc.tlsclntd: Update the man page for the -C option
Commit f5b40aa0de modifies the -C command line option
for rpc.tlsclntd to use the TLS 1.3 SSL_CTX_set_ciphersuites().

This patch updates the man page for this modified command
line option.

This is a content change.

Reviewed by:	jhb, pauamma_gundo.com (same change for rpc.tlsservd.8)
MFC after:	2 weeks
2022-05-22 13:58:59 -07:00
Rick Macklem
f5b40aa0de rpc.tlsclntd: Modify the -C option to use SSL_CTX_set_ciphersuites
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
This patch replaces SSL_CTX_set_cipher_list() with
SSL_CTX_set_ciphersuites(), since that is the function
that is used for TLS1.3.

The man page will be updated in a separate commit.

MFC after: 	2 weeks
2022-05-22 13:49:08 -07:00
Rick Macklem
8d098deda3 rpc.tlsservd: Modify the -C option to use SSL_CTX_set_ciphersuites
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
This patch replaces SSL_CTX_set_cipher_list() with
SSL_CTX_set_ciphersuites(), since that is the function
that is used for TLS1.3.

The man page has already been updated.

MFC after: 	2 weeks
2022-05-22 13:44:31 -07:00
Rick Macklem
d94358e29d rpc.tlsservd: Update the man page for the -C option
Commit 712aac1389 adds a new -C command line option
to rpc.tlsservd.

This patch updates the man page for this new command
line option.

This is a content change.

Reviewed by:	jhb, pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35136
2022-05-21 15:44:29 -07:00
Alfonso S. Siciliano
58c63d5e37
bsdinstall netconfig_ipv6: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35270
2022-05-21 18:04:28 +02:00
Alfonso S. Siciliano
90943fbfeb
bsdinstall netconfig_ipv4: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35267
2022-05-21 17:40:34 +02:00
Alfonso S. Siciliano
4effc38819
bsdinstall jail: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35274
2022-05-21 17:14:03 +02:00
Alfonso S. Siciliano
8cfbeb56aa
bsdinstall services: Improve mouse configuration
bsdinstall(8) has an option to enable moused support.
However, if it is not selected, moused is still started
through the configuration of nondefault devices.
So, automatically add the moused_nondefault_enable="NO"
setting to rc.conf unless moused support is selected.

PR:			227999
Reported by:		bcran
Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35193
2022-05-21 16:42:23 +02:00
Rick Macklem
72bf76d6b8 rpc.tlsclntd: Add an option to force use of TLS version 1.2
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
Since FreeBSD 13.0, 13.1 use TLS version 1.2 for
NFS-over-TLS mounts, this command line option
may be used so that NFS-over-TLS mounts to 13.0, 13.1
servers will still work.

Without the command line option, NFS-over-TLS mounts
will use TLS version 1.3.

The man page update will be a separate commit.

MFC after: 	2 weeks
2022-05-20 14:57:42 -07:00
Rick Macklem
0637b12b13 rpc.tlsservd: Add an option to allow TLS version 1.2
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
Since FreeBSD 13.0, 13.1 use TLS version 1.2 for
NFS-over-TLS mounts, this command line option
may be used so that mounts from 13.0, 13.1 will still work.

Without the command line option, only TLS version 1.3
mounts are permitted.

The man page update will be a separate commit.

MFC after: 	2 weeks
2022-05-20 14:47:36 -07:00
Mark Johnston
21add93b58 makefs: Remove execute permission from in-tree test scripts
Let the build system set it as needed.  No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-05-19 11:46:02 -04:00
Gleb Popov
7eb6a92e3f jexec man: Explain how PATH is adjusted.
Add a sentence that explains that PATH is set to `/bin:/usr/bin`.
I had to dive into `jexec.c` to find this out.

Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D35251
2022-05-19 16:58:32 +03:00
Andrew Turner
190abf86bb Fix the name of Makefile.aarch64
Makefile.arm64 relies on being included via Makefile.${MACHINE}. This
only works when arm64 is the only aarch64 architecture. Switch to
Makefile.aarch64 so downstream CheriBSD can use the file when building
for Morello which uses a differen ${MACHINE} value.

Sponsored by:	Innovate UK
2022-05-19 11:30:21 +01:00
Ed Maste
ec3c01ae72 makefs: sort cd9660 sysid entries in man page
"efi" was added at the end of the sysid list rather than in alpha
order.  Move it as a diff reduction against NetBSD.
2022-05-18 15:42:12 -04:00
Alan Somers
ecdc04d006 makefs: fix calculation of file sizes
When a new FS image is created we need to calculate how much space each
file is going to consume.
Fix two bugs in that logic:

1) Count the space needed for indirect blocks for large files.
1) Normally the trailing data of a file is written to a block of frag
   size, 4 kB by default.

However for files that use indirect blocks a full block is allocated,
32kB by default.  Take that into account.

Adjust size calculations to match what is done in ffs_mkfs routine:

* Depending on the UFS version the superblock is stored at a different
  offset. Take that into account.
* Add the cylinder group block size.
* All of the above has to be aligned to the block size.

Finally, Remove "ncg" variable. It's always 1 and it was used to
multiply stuff.

PR:		229929
Reviewed by:	mckusick
MFC after:	2 weeks
Sponsored by:	Semihalf
Submitted by:	Kornel Dulęba <mindal@semihalf.com>
Differential Revision:	https://reviews.freebsd.org/D35131
Differential Revision:	https://reviews.freebsd.org/D35132
2022-05-16 16:32:10 -06:00
Brad Davis
147585b489 bsdinstall: allow whitelabeling the installer
Override OSNAME to change the name of the OS in the installer.

This is a first step, the shell changes will be separate.

Reviewed by:		allanjude
Approved by:		allanjude
Differential Revision:	https://reviews.freebsd.org/D34878
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-13 10:35:43 -06:00
Brad Davis
2c4499dcd7 bsdinstall: add missing init of fd variable
Missed breaking this commit into smaller pieces

Approved by:		kp
2022-05-13 09:06:02 -06:00
Brad Davis
964ad27f1e bsdinstall: Filter out devices that cannot be opened
Devices that cannot be opened are most likely the install media and
should not be listed as destinations.

Reviewed by:		allanjude
Approved by:		allanjude
Differential Revision:	https://reviews.freebsd.org/D34879
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-13 08:33:21 -06:00
Mark Johnston
cc1a53bc1a makefs: Fix warnings and reset WARNS to the default
Leave -Wcast-align disabled, at least for now, since there are numerous
instances of that warning in places where buffer pointers are cast to
pointers to various filesystem structures.  Fixing this properly would
be too much work for too little gain.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-05-10 17:38:23 -04:00
Alexander Motin
bce02a0ea4 mpsutil: Fix device speed reporting.
Report controller SAS phy speed only for directly attached devices.
For others try to read and report parent expander phy speed.

MFC after:	1 week
2022-05-09 18:03:24 -04:00
Alexander Motin
53c184cf06 mpsutil: fix set but not used warning
MFC after:	1 week
2022-05-09 18:03:24 -04:00
Rick Macklem
d71c9f1468 rpc.tlsservd: Add logging of TLS version and cipher used
This patch adds logging of the version of TLS and cipher
negotiated successfully by the TLS handshake for each client,
if the "-v" command line option has been specified.

This information may be useful for monitoring and debugging
NFS-over-TLS mounts.

MFC after:	2 weeks
2022-05-06 14:03:43 -07:00
Yan Ka Chiu
3cdfaefa4b bhyve: Fix virtio-console legacy configuration parsing
virtio-console is currently missing .pe_legacy_config, which prevents any
portN configuration from being parsed, and therefore no sockets will be
created.

Reviewed by:	khng
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35142
2022-05-06 15:34:17 -04:00
Rick Macklem
15881823b9 rpc.tlsclntd, rpc.tlsservd: Fix getopt_long argument
The "C" option in the argument to getopt_long() was
missing a ":" for both rpc.tlsclntd.c and rpc.tlsservd.c.
This patch fixes this.

MFC after:	2 weeks
2022-05-05 16:22:12 -07:00
Rick Macklem
712aac1389 rpc.tlsservd: Add a -C command line option for preferred_ciphers
rpc.tlsclntd has a -C command line option for setting
preferred_ciphers.  Testing at a recent IETF NFSv4 testing
event showed that setting preferred_ciphers is not normally
needed for the rpc.tlsservd.

This patch modifies rpc.tlsservd to not specify preferred_ciphers
by default, but provides the same -C option as rpc.tlsclntd to
set preferred_ciphers, in case it is needed.

The man page update will be done as a separate commit.

MFC after:	2 weeks
2022-05-05 15:54:14 -07:00
Corvin Köhne
450b4ac23c bsdinstall/script: umount before zpool export
When running zpool export first, boot/efi and dev is still mounted so
zpool export fails. By running bsdinstall umount first the pool can be
cleanly exported.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D35114
Sponsored by:		Beckhoff Automation GmbH & Co. KG
MFC After:		3 days
2022-05-03 16:02:39 +02:00
Corvin Köhne
1f7746d81f bsdinstall: stop messing with file descriptors
Throughout the bsdinstall script fd 3 is used by f_dprintf (set through
$TERMINAL_STDOUT_PASSTHRU). By closing file descriptor 3 here, the
final f_dprintf "Installation Completed ... does not work anymore.

By putting the code into a subshell, file descriptors can be edited
without interference with the calling script.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D35113
Sponsored by:		Beckhoff Automation GmbH & Co. KG
MFC after:		3 days
2022-05-03 16:02:27 +02:00
Ed Maste
6cd1bc5316 freebsd-update: restart sshd after upgrade
Sometimes the parent-child sshd protocol changes during an upgrade, and
when this happens sshd will not accept new connections until it is
restarted.

PR:		263489
Reviewed by:	kevans, gjb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35109
2022-05-02 14:38:19 -04:00
Alfonso S. Siciliano
1ad9134e11
bsdinstall netconfig_ipv4: Fix resolv.conf rebuild
After an installation restart (for error or choice) dhclient does not
rebuild resolv.conf so `dialog --mixedform' of "Resolver Configuration"
in bsdinstall/scripts/netconfig draws empty forms. It causes a bad UX,
to see PR262262. Fixed resetting the interface before to run dhclient.

PR:			262262
Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35094
2022-04-30 17:34:53 +02:00
Alfonso S. Siciliano
9b4c606b96
bsdinstall/partedit: Fix UFS auto partitioning
Fix bsdinstall "Auto (UFS) Guided Disk Setup" and sade(8) "Auto".
The problem is a string comparison failure, it arose during the
dialog(3)/bsddialog(3) form conversion:

 * dialog uses only form.text while bsdialog differentiates between
   form.init and form.value.
 * dialog always allocates memory for form values while bsddialog only
   when a button is pressed.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35033
2022-04-30 01:24:23 +02:00
Robert Wing
690b7ea081 bhyve/snapshot: ..back to SOCK_STREAM
Now that nvlist_send()/nvlist_recv() are being used, ditch the datagram
socket.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D34863
2022-04-28 07:43:01 -08:00
Rick Macklem
350668eb09 rpc.tlsservd: Delete set but unused variable 2022-04-26 19:29:01 -07:00
Mateusz Piotrowski
460ad988a9 freebsd-update.8: Note availability of updates for ALPHA, BETA, and RC
While here, restructure the section about the binary updates
availability.

MFC after:	1 week
2022-04-22 14:37:14 +02:00
Mateusz Piotrowski
f69f064483 freebsd-update.8: Add --currently-running to synopsis
While here, sort flags in synopsis.

MFC after:	3 days
2022-04-22 13:57:11 +02:00