Commit graph

19268 commits

Author SHA1 Message Date
Marc Fonvieille
3a0fcdb37d bsdinstall/scripts/docsinstall: Add Indonesian Documentation
Add Indonesian Documentation to docinstall menu.

Approved by:	doceng (implicit) re (gjb, implicit)
MFC after:	1 week

(cherry picked from commit 45ef6b4b5d)
2022-06-17 16:31:01 +02:00
Ed Maste
6678474be7 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.

(cherry picked from commit ec3c01ae72)
2022-06-16 08:49:43 -04:00
Doug Rabson
2dfa77ed70 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

(cherry picked from commit 5e9c888a7a)
2022-06-13 11:03:52 +01:00
Gordon Bergling
95d4d86149 fstype(8): Fix two typos in source code comments
- s/auxillary/auxiliary/

(cherry picked from commit df4da2d6b7)
2022-06-10 14:32:48 +02:00
Gordon Bergling
ebc14d619c ac(8): Fix a typo in a source code comment
- s/chosing/choosing/

(cherry picked from commit 10924c4fc3)
2022-06-10 14:29:35 +02:00
Gordon Bergling
306c6832cb acpi(4): Fix a typo in a debug statement
- s/Efficency/tEfficiency/

Obtained from:	NetBSD

(cherry picked from commit 0b4302aa93)
2022-06-10 14:27:06 +02:00
Rick Macklem
9af6cedd27 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.

(cherry picked from commit 915fc1afe5)
2022-06-04 18:13:07 -07:00
Rick Macklem
365704ad71 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.

(cherry picked from commit 0bf3f379e1)
2022-06-04 18:11:54 -07:00
Rick Macklem
721a597346 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.

(cherry picked from commit e2c72fecfc)
2022-06-04 18:05:20 -07:00
Rick Macklem
be4e16e981 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.

(cherry picked from commit d94358e29d)
2022-06-04 18:04:13 -07:00
Rick Macklem
934aa8b5d0 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.

(cherry picked from commit b387a075d9)
2022-06-04 17:57:56 -07:00
Rick Macklem
927f75933b 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.

(cherry picked from commit f5b40aa0de)
2022-06-04 17:56:51 -07:00
Rick Macklem
e080b609a8 rpc.tlsservd: Delete set but unused variable
(cherry picked from commit 350668eb09)
2022-06-04 17:51:46 -07:00
Rick Macklem
1384d18827 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.

(cherry picked from commit b4fa7fde15)
2022-06-04 17:47:07 -07:00
Rick Macklem
2c59ffb057 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.

(cherry picked from commit 8d098deda3)
2022-06-04 17:45:31 -07:00
Rick Macklem
45f0c52fa1 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.

(cherry picked from commit 72bf76d6b8)
2022-06-02 19:15:40 -07:00
Rick Macklem
81b2ab5113 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.

(cherry picked from commit 0637b12b13)
2022-06-02 19:14:13 -07:00
Rick Macklem
79eb3b3d3f 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.

(cherry picked from commit 15881823b9)
2022-06-02 19:10:58 -07:00
Rick Macklem
146e1dbbf6 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.

(cherry picked from commit 712aac1389)
2022-06-02 19:09:41 -07:00
Mark Johnston
e5b204542f makefs: Remove execute permission from in-tree test scripts
Let the build system set it as needed.  No functional change intended.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 21add93b58)
2022-05-26 09:42:39 -04:00
Mark Johnston
bee87a7381 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.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit cc1a53bc1a)
2022-05-24 09:51:36 -04:00
Rick Macklem
74c4cb9cc3 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.

(cherry picked from commit d71c9f1468)
2022-05-23 18:02:18 -07:00
John Baldwin
263efa6c4a iscsid: Push #ifdef ICL_KERNEL_PROXY into cap_ioctl_limits list.
This reduces duplication in the two lists and makes it clearer which
ioctls are needed in the ICL_KERNEL_PROXY case.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34927

(cherry picked from commit f0df722733)
2022-05-17 14:15:13 -07:00
Corvin Köhne
95c6bc5a03 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

(cherry picked from commit 450b4ac23c)
2022-05-16 17:24:56 +02:00
Corvin Köhne
45eb93a964 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

(cherry picked from commit 1f7746d81f)
2022-05-16 17:24:56 +02:00
Corvin Köhne
8c119b3b71 bhyve: avoid uninitialized variable
Reviewed by:	markj
Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
Reported-by: Andy Fiddaman <andy@omniosce.org>
Differential Revision:	https://reviews.freebsd.org/D34688
(cherry picked from commit 8ac8adda8d)
2022-05-16 17:24:33 +02:00
Corvin Köhne
1b3141c630 bhyve: avoid overflow of BAR index
At the moment, writes to BAR registers that aren't 4 byte aligned are
ignored. So, there's no overflow yet. Nevertheless, if this behaviour
changes in the future, it could unintentionally, introduce a buffer
overflow. Additionally, some compiler or tools will detect this
potential overflow and complain about it.

Reviewed by:	markj
Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
Reported-by: Andy Fiddaman <andy@omniosce.org>
Differential Revision:	https://reviews.freebsd.org/D34689
(cherry picked from commit 45ddbf2112)
2022-05-16 17:24:33 +02:00
Corvin Köhne
469a4e669d bhyve: avoid an empty passthru config value
pci_parse_legacy_config splits the options string by comma characters.
strchr returns a pointer to the first occurence of a character. In that
case, it's a comma. So, pci_parse_legacy_config will stop at the first
character and creates a new config node with a name of NULL.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D34600

(cherry picked from commit 3256b7ca36)
2022-05-16 17:24:33 +02:00
Alexander Motin
718cb64a1f 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

(cherry picked from commit bce02a0ea4)
2022-05-16 09:53:02 -04:00
Alexander Motin
9d06207226 mpsutil: fix set but not used warning
MFC after:	1 week

(cherry picked from commit 53c184cf06)
2022-05-16 09:53:02 -04:00
Scott Long
ef303790ef Fix formatting of the usage() output
(cherry picked from commit 638e2a132e)
2022-05-16 09:53:01 -04:00
Corvin Köhne
122f386053 bhyve/usage: memory size is not in MB
For backward compatibility, the memory size will be interpreted in MB if
it's smaller than1 MB and has no suffix. Nowadays, the -m switch accepts
more than just MB. Respect it in the usage message.

Differential Revision:	https://reviews.freebsd.org/D34506
Reviewed by:	grehan
Sponsored by:   Beckhoff Automation GmbH & Co. KG
MFC after:      1 month

(cherry picked from commit afd4f7fa25)
2022-05-16 14:41:14 +02:00
Corvin Köhne
346876412a bhyve: add ROM emulation
Some PCI devices especially GPUs require a ROM to work properly.
The ROM is executed by boot firmware to initialize the device.
To add a ROM to a device use the new ROM option for passthru device
(e.g. -s passthru,0/2/0,rom=<path>/<to>/<rom>).

It's necessary that the ROM is executed by the boot firmware.
It won't be executed by any OS.
Additionally, the boot firmware should be configured to execute the
ROM file.
For that reason, it's only possible to use a ROM when using
OVMF with enabled bus enumeration.

Differential Revision:	https://reviews.freebsd.org/D33129
Sponsored by:   Beckhoff Automation GmbH & Co. KG
MFC after:      1 month

(cherry picked from commit e47fe3183e)
2022-05-16 14:41:14 +02:00
Corvin Köhne
7c6d3eb009 bhyve: export funcs for read/write pci config
Export functions for reading and writing the pci config space from passthru
device to be used by other devices.
This is required for lpc devices to set their vendor/device ids to their
physical values.
Otherwise, GPU passthrough for integrated Intel GPUs won't work properly.

Differential Revision:	https://reviews.freebsd.org/D33769
Reviewed by:	markj
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	1 month

(cherry picked from commit 563fd2240e)
2022-05-16 14:41:14 +02:00
Alan Somers
f7896015fc ctlstat: add prometheus output
When invoked by inetd, ctlstat -P will now produce output suitable for
ingestion into Prometheus.

It's a drop-in replacement for https://github.com/Gandi/ctld_exporter,
except that it doesn't report the number of initiators per target, and
it does report time and dma_time.

Sponsored by:	Axcient
Relnotes:	yes
Reviewed by: 	bapt, bcr
Differential Revision: https://reviews.freebsd.org/D29901

(cherry picked from commit 1a7f22d9c2)
2022-05-12 14:43:01 -06:00
Alan Somers
e4f508d5a2 prometheus_sysctl_exporter: fix metric aliasing
When exporting sysctls to Prometheus, the exporter replaces "." with
"_".  This caused several metrics to alias, confusing the Prometheus
server.  Fix it by:

* Renaming the "tcp_log_bucket" UMA zone to "tcp_log_id_bucket".  Also,
  rename "tcp_log_node" to "tcp_log_id_node" for consistency.

* Not exporting sysctls with "(LEGACY)" in the description.  That is
  used by ZFS sysctls that have been replaced by others, many of which
  alias to the same Prometheus metric name (like "vfs.zfs.arc_max" and
  "vfs.zfs.arc.max").

PR:		259607
Reported by:	delphij
Sponsored by:	Axcient
Reviewed by:	delphij,rew,thj
Differential Revision: https://reviews.freebsd.org/D34952

(cherry picked from commit 8c47d8f538)
2022-05-12 14:40:05 -06:00
John Baldwin
31649c5850 bhyve: Use vm_get_topology to query kernel's maximum vCPU count.
Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34493

(cherry picked from commit c76e4b89d9)
2022-05-11 11:53:12 -07:00
John Baldwin
27537022c5 bhyve: Don't force an upper bound on vCPUs when parsing pinning.
Even today it is possible to specify pinning for a vCPU higher than
the configured number of CPUs but lower than VM_MAXCPU without raising
an error.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34492

(cherry picked from commit fd6f92946f)
2022-05-11 11:51:56 -07:00
John Baldwin
a4153a7b77 bhyve: Allocate dynamic arrays to hold per-VCPU state.
This avoids hardcoding VM_MAXCPU in userspace.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34491

(cherry picked from commit 7261f82156)
2022-05-11 11:51:41 -07:00
John Baldwin
cc16e0f79d bhyve: Make the MADT dynamically sized.
Use basl_ncpu instead of VM_MAXCPU in MADT_SIZE.  Since several of the
offsets are no longer compile time constants, unroll the loop
generating ACPI tables.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34490

(cherry picked from commit 340a293f91)
2022-05-11 11:48:17 -07:00
John Baldwin
2412b82929 bhyve: Allocate mmio_hint array based on number of guest CPUs.
This avoids an instance of hardcoding VM_MAXCPU in userspace.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D34489

(cherry picked from commit 730510dc1a)
2022-05-11 11:47:58 -07:00
John Baldwin
ecd5ade6dc fstyp: Remove __packed from struct exfat_de_label.
This fixes a -Waddress-of-packed-member warning about a possibly
unaligned pointer from GCC 9 when calling convert_label().

__packed has to be removed from struct exfat_dirent as well to fix an
alignment warning when casting from a struct exfat_dirent pointer to a
struct exfat_de_label pointer.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D32144

(cherry picked from commit 58862c0bea)
2022-05-10 17:04:31 -07:00
John Baldwin
2dfc07d2c6 bhyve: Add an empty case for event types in mevent_kq_fflags().
This fixes a -Wswitch error raised by GCC 9.

Differential Revision:	https://reviews.freebsd.org/D31938

(cherry picked from commit 7ecdfc8237)
2022-05-10 15:51:49 -07:00
Ed Maste
ec004c5779 ntp: disable format string warnings in libopts
libopts uses generated format string tables that contain embedded NULs.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34386

(cherry picked from commit 1ffe6d7909)
2022-05-03 14:20:44 -04:00
Ed Maste
85983255c1 fwcontrol: eliminate set but not used warning
The variable was used in an #if 0 block; just move the variable
definition and setting into the same block since Firewire is mainly of
historical interest and is unlikely to see ongoing development in
FreeBSD.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 2d015cffc7)
2022-05-02 10:09:29 -04:00
John Baldwin
1d290d36d8 iscsi: Handle large Text responses.
Text requests and responses can span multiple PDUs.  In that case, the
sender sets the Continue bit in non-final PDUs and the Final bit in
the last PDU.  The receiver responds to non-final PDUs with an empty
text PDU.

To support this, add a more abstract API in libiscsi which accepts and
receives key sets rather than PDUs.  These routines internally send or
receive one or more PDUs.  Use these new functions to replace the
handling of TextRequest and TextResponse PDUs in discovery sessions in
both ctld and iscsid.

Note that there is not currently a use case for large Text requests
and those are still always sent as a single PDU.  However, discovery
sessions can return a text response listing targets that spans
multiple PDUs, so the new API supports sending and receiving multi-PDU
responses.

Reported by:	Jithesh Arakkan @ Chelsio
Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33548

(cherry picked from commit b406897911)
2022-04-29 14:17:43 -07:00
John Baldwin
06a67a1f05 iscsid: Always free the duplicated address in resolve_addr().
If a "raw" IPv6 address (denoted by a leading '[') is used as a target
address, then 'arg' is incremented by one to skip over the '['.
However, this meant that at the end of the function the wrong address
was passed to free().  With malloc junking enabled and given suitably
small strings, malloc() would happily overwrite the correct number of
bytes with junk, but off by one byte overwriting the byte after the
allocation.

This manifested as the first byte of the 'HeaderDigest' key being
overwritten causing the key name on the wire to be sent as
'\x5eaderDigest' which the target rejected.

Reported by:	Jithesh Arakkan @ Chelsio
Found with:	ASAN (via WITH_ASAN=yes)
Sponsored by:	Chelsio Communications

(cherry picked from commit c74ab5ce6f)
2022-04-29 14:17:30 -07:00
John Baldwin
b77f4559d5 ctld: Disable -Wcast-align warnings.
clang complains about the downcasts from struct connection to struct
ctld_connection as the alignment of struct ctld_connection is higher
on 32-bit platforms.  However, the warning is in this case harmless as
the downcasts are on objects originally allocated as instances of
struct ctld_connection with suitable alignment.

Reported by:	npn, gjb
Fixes:		6378393308 Add an internal libiscsiutil library.
Sponsored by:	Chelsio Communications

(cherry picked from commit fa255ab1b8)
2022-04-29 14:16:55 -07:00
John Baldwin
54262b09e5 libiscsiutil: Change keys_load/save to operate on data buffers.
This will be used in future changes to support large text requests
spanning multiple PDUs.

Provide wrapper functions keys_load/save_pdu that operate use a PDU's
data buffer.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33547

(cherry picked from commit 25700db366)
2022-04-29 14:15:45 -07:00
John Baldwin
ec79933e61 Add an internal libiscsiutil library.
Move some of the code duplicated between ctld(8) and iscsid(8) into a
libiscsiutil library.

Sharing the low-level PDU code did require having a
'struct connection' base class with a method table to permit separate
initiator vs target behavior (e.g. in handling proxy PDUs).

Reviewed by:	mav, emaste
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33544

(cherry picked from commit 6378393308)
2022-04-29 14:13:00 -07:00