Commit Graph

19114 Commits

Author SHA1 Message Date
Mark Johnston
42375556e5 bhyve: Use pci(4) to access I/O port BARs
This removes the dependency on /dev/io.

PR:		251046
Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31308
2021-08-14 10:59:04 -04:00
John Baldwin
c7bb0f47f7 nfs tls: Update for SSL_OP_ENABLE_KTLS.
Upstream OpenSSL (and the KTLS backport) have switched to an opt-in
option (SSL_OP_ENABLE_KTLS) in place of opt-out modes
(SSL_MODE_NO_KTLS_TX and SSL_MODE_NO_KTLS_RX) for controlling kernel
TLS.

Reviewed by:	rmacklem
Sponsored by:	Netflix
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D31445
2021-08-10 14:18:43 -07:00
Gordon Bergling
04389c855e Fix some common typos in comments
- s/configuraiton/configuration/
- s/specifed/specified/
- s/compatiblity/compatibility/

MFC after:	5 days
2021-08-08 10:16:06 +02:00
Ed Maste
3e5bff102b bsdinstall: Remove unused sysctl.h header #include 2021-08-07 20:30:29 -04:00
Ka Ho Ng
3676512b60 bhyve: Use fspacectl(2) for BOP_DELETE on regular file images
bhyve can also make use of fspacectl(2) to implement BOP_DELETE with
hole-punching. Since it is not desirable to do zero-filling for large
DEALLOCATE/UNMAP range, candelete is not set if pathconf(2) indicates
that the underlying file system does not support native
VOP_DEALLOCATE(9).

Sponsored by:	The FreeBSD Foundation
Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D28880
2021-08-07 17:10:30 +08:00
Kyle Evans
d35164539b pkg: use specific CONFSNAME_${file} for FreeBSD.conf
Setting CONFSNAME directly is a little more complicated for downstream
consumers, as any additional CONFS that are added here will inherit the
group name by default.  This is perhaps arguably a design flaw in CONFS
because inheriting NAME will never give a good result when additional
files are added, but this is a low-effort change.

While we're here, pull FreeBSD.conf.${branch} out into a PKGCONF
variable so one can just drop a new repo config in entirely with a new
naming scheme. CONFSNAME gets set based on chopping anything off after
".conf", so that, e.g.:

- FooBSD.conf => FooBSD.conf
- FooBSD.conf.internal => FooBSD.conf

Reviewed by:	bapt, manu
Differential Revision:	https://reviews.freebsd.org/D28767
2021-08-06 14:25:45 -05:00
Kyle Evans
40b9f924b1 pkg: allow multiple add arguments again
While pkg(7) add only handles a single 'add' argument, pkg-add(8) fully
handles multiple arguments.

Stop rejecting it, just turn off local-bootstrap mode and proceed to
remote bootstrap if we need it.

While we're here, check if the first argument to pkg add is even a pkg
package. If it's not, also do remote bootstrap instead. Future work
could improve this altogether by picking out a pkg package out of many
and local bootstrap then pass the rest through to the newly installed
pkg.

Reviewed by:	bapt, manu (earlier version)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D28766
2021-08-06 14:25:07 -05:00
Alex Richardson
c826e08841 Fix MK_TESTS build with MK_ASAN/MK_UBSAN
Reviewed By:	markj
Differential Revision: https://reviews.freebsd.org/D31049
2021-08-02 14:33:24 +01:00
Bjoern A. Zeeb
56be282bc9 bhyve: net_backends, automatically IFF_UP tap devices
If you want communications with the outside world and tell bhyve to
create an interfaces then it should be usable as well.
Rather than relying on the sysctl net.link.tap.up_on_open automatically
try to IFF_UP the opened tap device.

MFC after:	10 days
Reviewed by:	markj, grehan
Differential Revision: https://reviews.freebsd.org/D31342
2021-08-01 20:50:53 +00:00
Renato Botelho
95f0da5be1 bsdinstall: Only show menu if there are more items to be installed
MFC after:	3 days
Obtained from:	Rubicon Communications, LLC ("Netgate")
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-22 16:02:34 -04:00
Edward Tomasz Napierala
0634390572 chroot: fix typo in usage
While here also fix typo in a variable name.

Reported By:	oshogbo
2021-07-21 10:16:11 +01:00
Edward Tomasz Napierala
a157196713 sesutil: Fix status checking
Previously we would display "OK, Swapped" for swapped disks,
instead of the usual disk size.

Reviewed By:	allanjude
Differential Revision:	https://reviews.freebsd.org/D31219
2021-07-21 10:14:26 +01:00
Edward Tomasz Napierala
a40cf4175c Implement unprivileged chroot
This builds on recently introduced NO_NEW_PRIVS flag to implement
unprivileged chroot, enabled by `security.bsd.unprivileged_chroot`.
It allows non-root processes to chroot(2), provided they have the
NO_NEW_PRIVS flag set.

The chroot(8) utility gets a new flag, -n, which sets NO_NEW_PRIVS
before chrooting.

Reviewed By:	kib
Sponsored By:	EPSRC
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D30130
2021-07-20 08:57:53 +00:00
Dave Fullard
f28f138905 freebsd-update: create a ZFS boot environment on install
Updated freebsd-update to allow it to create boot environments using
bectl should the system support it. The bectl utility was updated in
r352211 (490e13c140) to support a 'check' to determine if the system
supports boot environments.  If UFS is used, the bectl check will fail
then no attempt will be made to create the boot environment.

If freebsd-update is run inside a jail, no attempt will be made to
create a boot environment.

The boot environment function will create a new environment using the
format: current FreeBSD kernel version and date/timestamp, example:

12.0-RELEASE-p10_2019-10-03_185233

This functionality can be disabled by setting 'CreateBootEnv' in
freebsd-update.conf to 'no'.

Discussed with:	allanjude
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21892
2021-07-15 23:07:00 -05:00
Navdeep Parhar
35e62b00c3 cxgbetool(8): Update the register definitions used to decode regdump.
Obtained from:	Chelsio Communications
MFC after:	1 week
Sponsored by:	Chelsio Communications
2021-07-13 17:55:55 -07:00
Jessica Clarke
8b487b8292 Fix bsd.subdir.mk-related issues after 0a0f748641
Since bsd.prog.mk includes bsd.obj.mk, and thus bsd.subdir.mk, we must
ensure all our bsd.subdir.mk-affecting variables are set before
including bsd.prog.mk. Since sbin's various Makefile.arch files add to
SUBDIR this results in those not taking effect, and presumably we also
end up not having buildworld as parallel as it should be due to the fact
that SUBDIR_PARALLEL was not being set before including bsd.prog.mk.

MFC with:	0a0f748641
Reviewed by:	olivier
Differential Revision:	https://reviews.freebsd.org/D31125
2021-07-12 20:54:01 +01:00
Gordon Bergling
4c87085d35 nfsd: Fix some issues found by mandoc
- consider using OS macro: Fx

Reviewed by:	bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31145
2021-07-12 06:31:54 +02:00
Alan Somers
61631b24a1 iostat: fix rounding errors in iostat -x
Better to round numbers instead of flooring them.

MFC after:	3 weeks
Sponsored by:	Axcient
2021-07-08 10:16:32 -06:00
Alan Somers
3874c0abb0 [skip ci] correct a few SPDX license tags
These were all incorrectly labeled as 2-clause BSD licenses by a
semi-automated process, when in fact they are 3-clause.

Discussed with:	pfg, imp
MFC after:	2 weeks
Sponsored by:	Axcient
2021-07-07 13:52:20 -06:00
Li-Wen Hsu
86d0d3aadb
freebsd-update: Update URL of supported platforms information
MFC after:	3 days
2021-07-04 21:45:08 +08:00
Pavel Balaev
24f398e7a1 Add efitable(8), a userspace tool to fetch and parse EFI tables
Only ESRT and PROP tables are handled at the moment.

Submitted by:	Pavel Balaev <pavel.balaev@3mdeb.com>
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D30104
2021-07-03 20:14:16 +03:00
Jose Luis Duran
6ce785c50b bsdinstall: Also copy /var/db/zoneinfo
Per tzsetup(8), /etc/localtime and /var/db/zoneinfo go hand in hand.

Reviewed by:	imp@
Pull Request:	https://github.com/freebsd/freebsd-src/pull/486
2021-06-30 11:08:26 -06:00
Fernando Apesteguía
0a0f748641 man: Build manpages for all architectures
Building and installing architecture-specific man pages only raises a number of
problems:

 * The https://www.freebsd.org/cgi/man.cgi is incomplete. As an
   example, it does not show results for pae(4). The reason for this is
   that the cgi interface runs on FreeBSD amd64.

 * In FreeBSD amd64 some manual pages have broken X-refs. See hptrr(4)
   for an example.

 * Also, we have broken links in our Release Notes. This is a
   consequence of the first point. See
   https://www.freebsd.org/releases/13.0R/hardware/#proc-i386.

Make MAN_ARCH default to 'all' so we build all the man pages for all the
architectures. The difference in disk space is negligible. Also link
architecture-specific man pages to their own section while keeping their own
namespace.

PR: 212290
Reported by:	mj@bsdops.com
Approved by:	ceri@, wosch@
MFC after:	4 weeks
2021-06-30 09:57:51 +02:00
Colin Percival
2ef5995f49 portsnap: Remove superfluous semicolons
Submitted by:	des
2021-06-29 11:00:54 -07:00
Colin Percival
a9f5512f07 portsnap: Shorten 'Skipping' output lines
Portsnap uses patches opportunistically to reduce download bandwidth: It
attempts to fetch patches which could be useful, and then makes use of
whichever patches it actually gets.  (This solves the otherwise O(n^2)
issue for the server to build patches between every pair of versions.)

During the process of applying patches, portsnap prints lines of the
form "Skipping XXX-YYY (123 of 4567).\r", where the \r serves to allow
each of these (potentially many) lines to overwrite the previous one
on the console.  Unfortunately, XXX and YYY here are SHA256 hashes,
resulting in these lines wrapping on reasonable-width consoles.

Replace the hashes with abbreviations of the form "0123...cdef"
(cutting 64 characters down to 11) in order to keep lines to a
reasonable length.

The rather ugly shell code here is used to avoid forking additional
processes; it would be much cleaner using sed(1), but in my testing
the sed-based alternative increases CPU time consumption by 50%.

Requested by:	des
2021-06-29 11:00:54 -07:00
Chuck Tuffli
91064841d7 bhyve: Fix NVMe iovec construction for large IOs
The UEFI driver included with Rocky Linux 8.4 uncovered an existing bug
in the NVMe emulation's construction of iovec's.

By default, NVMe data transfer operations use a scatter-gather list in
which all entries point to a fixed size memory region. For example, if
the Memory Page Size is 4KiB, a 2MiB IO requires 512 entries. Lists
themselves are also fixed size (default is 512 entries).

Because the list size is fixed, the last entry is special. If the IO
requires more than 512 entries, the last entry in the list contains the
address of the next list of entries. But if the IO requires exactly 512
entries, the last entry points to data.

The NVMe emulation missed this logic and unconditionally treated the
last entry as a pointer to the next list. Fix is to check if the
remaining data is greater than the page size before using the last entry
as a pointer to the next list.

PR:		256422
Reported by:	dave@syix.com
Tested by:	jason@tubnor.net
MFC after:	5 days
Relnotes:	yes
Reviewed by:	imp, grehan
Differential Revision:	https://reviews.freebsd.org/D30897
2021-06-27 15:14:52 -07:00
Chuck Tuffli
a11ca79cd9 bhyve: fix NVMe MDTS comment
Removes an obsolete comment and adds parenthesis around the macro while
in the area. No functional change.
2021-06-25 08:02:28 -07:00
Ryan Moeller
b50db44f02 bsdinstall: Avoid double-mounting /dev
After 34766aa8cb we are mounting and
unmounting devfs elsewhere already.

Reviewed by:	nwhitehorn
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D30877
2021-06-23 21:24:53 +00:00
Mark Johnston
2bbeada0f7 rpc.lockd: Use libc strnlen() instead of reimplementing it
No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-06-23 10:06:57 -04:00
Emmanuel Vadot
af5e40770e pkgbase: Put the mibs and defs in the bnsmp package
Differential Revision:	https://reviews.freebsd.org/D30756
Sponsored by:	Diablotin Systems
2021-06-19 17:50:03 +02:00
Emmanuel Vadot
c42e9af5f1 pkgbase: Move ctld/ctladm to iscsi package
While here only compile both of them if WITH_ISCSI is set (this is the default).

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D30755
Sponsored by:	Diablotin Systems
2021-06-19 17:49:57 +02:00
Emmanuel Vadot
081fb64492 pkgbase: Create a FreeBSD-nfs package
And move all the nfs related commands there.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D30754
Sponsored by:	Diablotin Systems
2021-06-19 17:49:50 +02:00
Jamie Gritton
5bf6dca2c6 jail: Don't allow substitution of valueless jail parameters.
PR:		256544
Reported by:	cryptogranny at gmail.com
2021-06-18 09:44:37 -07:00
Alan Somers
fcf2227a55 periodic: by default, skip 221.backup-gpart in jails
It can still be enabled as usual in /etc/periodic.conf

PR:		256253
Reported by:	delphij
Submitted by:	Miroslav Lachman <000.fbsd@quip.cz>
MFC after:	2 weeks
2021-06-18 08:36:09 -06:00
Ceri Davies
64e6e1e463 secure/caroot, certctl: Rename secure/caroot/blacklisted
Old certctl commands still work for compatability, but are deprecated.

Approved by:	secteam (gordon)
Differential Revision: https://reviews.freebsd.org/D30807
2021-06-18 13:38:07 +01:00
Warner Losh
6a836ea741 config(8): Remove obsolete 'config' directive.
The "config" line in config files has been obsolete since FreeBSD 4.x
when we moved to having the boot loader pass in the root device. Remove
it.

MFC After:		1 week
Sponsored by:		Netflix
2021-06-17 15:17:18 -06:00
Philip Paeps
7daa45becf bsdinstall: add a new mirror in Bulgaria
Provided by Telepoint Mirror Service.

Reported by:	Valentin Nikolov <mirror@telepoint.bg>
MFC after:	3 days
2021-06-17 21:07:37 +08:00
Philip Paeps
1c9605fe1e bsdconfig: add a new mirror in Bulgaria
Provided by Telepoint Mirror Service.

Reported by:	Valentin Nikolov <mirror@telepoint.bg>
MFC after:	3 days
2021-06-17 21:07:37 +08:00
Kristof Provost
67cef6d411 bsnmp: Fix incorrect use of libpfctl
When we introduced libpfctl in bnsmpd this was done incorrectly, and a
GETRULE call was replaced by pfctl_add_rule().
Change it to pfctl_get_rule().

Reviewed by:	donner
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-06-17 10:53:40 +02:00
Chuck Tuffli
3a4ab18377 bhyve: Fix cli regression with NVMe ram
The configuration management refactoring inadvertently removed support
for a RAM-backed NVMe Namespace (i.e. -s X,nvme,ram=16384). This adds it
back.

Reported by:	andy@omniosce.org
Reviewed by:	jhb, andy@omniosce.org
Fixes:		621b509048
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30717
2021-06-16 14:19:01 -07:00
Nathaniel Filardo
7ef082733b makefs: Cast daddr_t to off_t before multiplication
Apparently some large-file systems out there, such as my powerpc64le
Linux box, define daddr_t as a 32-bit type, which is sad and stymies
cross-building disk images.  Cast daddr_t to off_t before doing
arithmetic that overflows.

Reviewed by:	arichardson, jrtc27, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27458
2021-06-15 01:22:04 +01:00
Dan Nelson
87799c5f85 cpucontrol: fix extended signature matching code to avoid fallthough
PR:		256502
MFC after:	1 week
2021-06-14 17:34:07 -04:00
Cy Schubert
dc9d54b5c1 wpa: The ap library is not needed by wpa_supplicant or wpa_cli
The ap library is not needed by wpa_supplicant or wpa_cli. It is only
used by hostapd.

MFC after:	2 months
2021-06-13 22:55:07 -07:00
Robert Crowston
efec757b20 bhyve: enhance debug info for memory range clash
Explain what the two clashing regions are.

Reivewed by:		grehan, jhb
Differential Revision:	https://reviews.freebsd.org/D29696
Pull Request:		https://github.com/freebsd/freebsd-src/pull/463
2021-06-13 16:41:45 -06:00
Artem Khramov
f06fa6f887 syslogd: fix WITHOUT_INET builds
Since 2d82b47 syslogd can't be built with `WITHOUT_INET` or
`WITHOUT_INET6` build variables set, because `iovlist_truncate` is not
defined but used.

This change wraps the problematic `iovlist_truncate` call within ifdef
directive.  It's compiled out in this situation...

Pull Request:	https://github.com/freebsd/freebsd-src/pull/475
Reviewed by:	imp@ (commit message slightly tweaked)
2021-06-12 22:25:35 -06:00
John Baldwin
2349cda44f bhyve vtblk: Inform guests of disk resize events.
Register a resize callback with the blockif interface.  When the
callback fires, update the size of the disk and notify the guest via a
configuration change interrupt.

Reviewed by:	grehan, markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30506
2021-06-11 18:00:25 -07:00
John Baldwin
c06676bee3 bhyve: Split out a lower-level helper for VirtIO interrupts.
This allows device models to assert VirtIO interrupts for reasons
other than publishing changes to a VirtIO ring such as configuration
changes.

Reviewed by:	grehan, markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30505
2021-06-11 18:00:25 -07:00
John Baldwin
8794846a91 bhyve: Add support for handling disk resize events to block_if.
Allow clients of blockif to register a resize callback handler.  When
a callback is registered, register an EVFILT_VNODE kevent watching the
backing store for a change in the file's attributes.  If the size has
changed when the kevent fires, invoke the clients' callback.

Currently resize detection is limited to backing stores that support
EVFILT_VNODE kevents such as regular files.

Reviewed by:	grehan, markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30504
2021-06-11 18:00:24 -07:00
John Baldwin
67d60dcce6 bhyve: Add support for EVFILT_VNODE mevents.
This allows registering an event to watch for changes to a file's
attributes.  This is a bit imperfect as it would be nice to have a way
to determine if an fd can use EVFILT_VNODE successfully.  mevent's
current structure does not permit that and a failure to register a
single kevent impacts several other kevents.

Reviewed by:	grehan, markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30503
2021-06-11 18:00:24 -07:00
John Baldwin
e8424e2947 bhyve: Register new kevents synchronously.
Change mevent_add*() to synchronously add the new kevent.  This
permits reporting event registration failures to the caller and avoids
failing the registration of other, unrelated events queued up in the
same batch.

Reviewed by:	grehan, markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30502
2021-06-11 18:00:24 -07:00