Commit Graph

259075 Commits

Author SHA1 Message Date
Robert Wing
0e6549c874 bectl(8): don't allow creation of boot environments with spaces
Boot environment datasets that contain spaces are not bootable.

When a user attempts to create a boot environment with a space, abort
the creation and print an error message.

PR:             254441
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D30194
2021-06-03 08:36:11 -08:00
Maksym Stetsyuk
5c447fe677 usb: reduce verbosity of logging about unsuccessful port reset
Reviewed by:		imp@,hselasny@
Pull Request:		https://github.com/freebsd/freebsd-src/pull/385
Differential Revision:	https://reviews.freebsd.org/D30621
2021-06-03 09:52:52 -06:00
Kristof Provost
70dd30d49c pf tests: Make killstate:match more robust
The killstate:match test starts nc as a background process. There was no
guarantee that the nc process would have connected by the time we check
for states, so this test occasionally failed without good reason.

Teach the test to wait for at least some states to turn up before
executing the critical checks.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-06-03 15:22:19 +02:00
Kristof Provost
ea3eca5cb6 netpfil tests: Basic dummynet pipe test
Test dummynet pipes (i.e. bandwidth limitation) with ipfw. This is put
in the common tests because we hope to add dummynet support to pf in the
near future.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30380
2021-06-03 09:02:58 +02:00
Kristof Provost
1b2dbe37fa dummynet: free(NULL, M_DUMMYNET); is safe
There's no need to check pointers for NULL before free()ing them.

No functional change.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30382
2021-06-03 09:02:53 +02:00
Kristof Provost
51d73df18e dummynet: Fix schedlist and aqmlist locking
These are global (i.e. shared across vnets) structures, so we need
global lock to protect them.  However, we look up entries in these lists
(find_aqm_type(), find_sched_type()) and return them. We must ensure
that the returned structures cannot go away while we are using them.

Resolve this by using NET_EPOCH(). The structures can be safely accessed
under it, and we postpone their cleanup until we're sure they're no
longer used.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30381
2021-06-03 09:02:49 +02:00
Tom Jones
fe3bcfbda3 VNETify dummynet
This moves dn_cfg and other parameters into per VNET variables.

The taskqueue and control state remains global.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D29274
2021-06-03 09:01:56 +02:00
Peter Holm
8682abbf7b stress2: Remove thr_new() from the ignore list after 6cda627556 2021-06-03 07:23:01 +02:00
Navdeep Parhar
5104dfbeff bsdinstall: Fix typo (Instalation -> Installation). 2021-06-02 21:44:11 -07:00
Priit Trees
cfae21201a mmc-fdt: fix mmc_fdt_gpio_get_{present,readonly}
Currently, mmc_fdt_gpio_get_{present,readonly} return all time true.
	true   ^ 100b = true
	false  ^ 100b = true
since that's done after promotion to integers. Use !! to convert
the bit to a bool before xor.

Reviewed by:	imp@ (converted to (bool) to !! for portability)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/461
2021-06-02 21:58:30 -06:00
wiklam
43521b46fc Correcting comment about "sched_interact_score".
Reviewed by:	jrtc@, imp@
Pull Request:	https://github.com/freebsd/freebsd-src/pull/431

Sponsored by:		Netflix
2021-06-02 21:50:57 -06:00
Ed Maste
dd41de95a8 Cirrus-CI: retry pkg installation on failure
Pkg installation failed somewhat frequently, always at:

[62/104] Fetching jpeg-turbo-2.0.6.txz: .......... done
pkg: http://pkgmir.geo.freebsd.org/FreeBSD:13:amd64/quarterly/All/jbigkit-2.1_1.txz: No route to host

Move pkg installation to a script and retry once upon failure as a
(hopefully temporary) workaround.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30613
2021-06-02 22:41:20 -04:00
Robert Wing
441e69e419 fsck_ufs: fix segfault with gjournal
The segfault was being hit in ckfini() (sbin/fsck_ffs/fsutil.c) while
attempting to traverse the buffer cache. The tail queue used for the
buffer cache was not initialized before dropping into gjournal_check().

Initialize the buffer cache before calling gjournal_check().

PR:             245907
Reviewed by:    jhb, mckusick
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D30537
2021-06-02 18:30:20 -08:00
Austin Shafer
e7dc08415a mmc: ignore CRC errors from CMD13 (status) when changing rates
Update mmc_switch_status to ignore a few CRC errrors when asking for the
card status after setting the new rate with CMD6. Since the card may
take a little while to make the switch, it's possible we'll get a
communications error if we sent the command at the wrong time. Several
low end laptops needs this workaround as they have a window that seems
longer than other systems. This is known to fix at least the Acer Aspire
A114-32-P7E5.

Reviewed by:		imp@, manu@
Differential Revision:	https://reviews.freebsd.org/D24740
2021-06-02 19:46:23 -06:00
Cy Schubert
9a0f822853 wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload
Incorrectly linked built-in wpa functions resulted in overwriting
sm->ctx->set_rekey_offload with garbage. It was initialized correctly
however it changed after wpa_supplicant became a daemon.

No SIGBUS violations reported by dhw@ were experienced during testing
of the original commit by msyelf or philip@.

Reported by:	dhw
Tested by:	dhw
MFC after:	2 months
X-MFC with:	25ecdc7d52
2021-06-02 17:25:37 -07:00
Cy Schubert
48b11217bf libradius: fix no SSL build
int alen is only used with SSL.
2021-06-02 17:25:37 -07:00
Ed Maste
903526542a Cirrus-CI: Add descriptive task name
Previously it appeared only as "main" in places like GitHub's list
of checks run as part of a pull request.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-06-02 19:58:40 -04:00
Jung-uk Kim
29cd0d7200 hptrr: use BLOB_OBJS for pre-built .o's 2021-06-02 19:07:38 -04:00
Konstantin Belousov
e3149e0a02 rtld: Rename -t option to -u (ignore LD_ vars)
Requested by:	arichardson
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2021-06-03 01:55:08 +03:00
Rick Macklem
984c71f903 nfsd: Fix the failure return for non-fh NFSv4 operations
Without this patch, nfsd_checkrootexp() returns failure
and then the NFSv4 operation would reply NFSERR_WRONGSEC.
RFC5661 Sec. 2.6 only allows a few NFSv4 operations, none
of which call nfsv4_checktootexp(), to return NFSERR_WRONGSEC.
This patch modifies nfsd_checkrootexp() to return the
error instead of a boolean and sets the returned error to an RPC
layer AUTH_ERR, as discussed on nfsv4@ietf.org.
The patch also fixes nfsd_errmap() so that the pseudo
error NFSERR_AUTHERR is handled correctly such that an RPC layer
AUTH_ERR is replied to the NFSv4 client.

The two new "enum auth_stat" values have not yet been assigned
by IANA, but are the expected next two values.

The effect on extant NFSv4 clients of this change appears
limited to reporting a different failure error when a
mount that does not use adequate security is attempted.

MFC after:	2 weeks
2021-06-02 15:28:07 -07:00
Noah Bergbauer
56fd97660a gconcat: Add new lock to allow modifications to the disk list in preparation for online append
In addition, rename existing sc_lock to sc_append_lock

Reviewed by:		imp@
Pull Request:		https://github.com/freebsd/freebsd-src/pull/447
Sponsored by:		Netflix
2021-06-02 15:59:25 -06:00
Noah Bergbauer
e61e072f3b gconcat: Switch array to TAILQ to prepare for online append
Reviewed by:		imp@
Pull Request:		https://github.com/freebsd/freebsd-src/pull/447
Sponsored by:		Netflix
2021-06-02 15:50:27 -06:00
sebastien.bini
e5be21d19b sbin/veriexec: fixed parameter parsing of option -x
The -x parameter doesn't take any arguments. It says that all further
arguments are paths to check.

Reviewed by:	imp@
Sponsored by:	Netflix
Pull Request:	https://github.com/freebsd/freebsd-src/pull/443/files
2021-06-02 15:37:51 -06:00
Leandro Lupori
4a66b8083c powerpc: fix boot on pseries without hugepages
Commit 49c894ddce introduced an issue that prevented pseries boot,
when hugepages were not available to the guest. Now large page
info must be available before moea64_install is called, so this change
moves the code that scans large page sizes before the call.

Reviewed by:	jhibbits (IRC)
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
2021-06-02 16:27:36 -03:00
Warner Losh
9f3d1a98dd regen after tweaks to getgroups and setgroups
Sponsored by:		Netflix
2021-06-02 13:24:50 -06:00
Warner Losh
bf26ea7755 t_getgroups: No longer expected to fail
Sponsored by:		Netflix
2021-06-02 13:24:47 -06:00
Moritz Buhl
4bc2174a1b kern: fail getgroup and setgroup with negative int
Found using
https://github.com/NetBSD/src/blob/trunk/tests/lib/libc/sys/t_getgroups.c

getgroups/setgroups want an int and therefore casting it to u_int
resulted in `getgroups(-1, ...)` not returning -1 / errno = EINVAL.

imp@ updated syscall.master and made changes markj@ suggested

PR:			189941
Tested by:		imp@
Reviewed by:		markj@
Pull Request:		https://github.com/freebsd/freebsd-src/pull/407
Differential Revision:	https://reviews.freebsd.org/D30617
2021-06-02 13:22:57 -06:00
Max Stucchi
1976e07954 Add bcm2710-rpi-cm3.dtb to the list of DTBs being added.
This allows to boot out of the box on the RPI COmpute Module 3 with 32G
of eMMC.

Tested by:		imp confirmed .dtb is in the rpi-firmware pkg
Reviewed by:		gjb@, imp@
Pull Request:		https://github.com/freebsd/freebsd-src/pull/452

Sponsored by:		Netflix
2021-06-02 11:28:01 -06:00
John Ko
7ef92163ab Allows user to specify an optional ZFSBOOT_POOL_SIZE for their zroot
The default is to create a zroot that consumes the whole disk because if
used with geli(8) this makes sense.

Without geli(8), I like to keep my data pool separate from my system
pool.

This is different than ZFSBOOT_BOOT_POOL_SIZE which is named bootpool.

Reviewed by:		allenjude
Pull Request:		https://github.com/freebsd/freebsd-src/pull/53
Differential Revision:	https://reviews.freebsd.org/D30588
2021-06-02 11:12:14 -06:00
Warner Losh
adfe427124 hptnr: use BLOB_OBJS for pre-built .o's
Sponsored by:		Netflix
2021-06-02 10:39:58 -06:00
Warner Losh
22ed04c203 hptmv: use BLOB_OBJS for pre-built .o's
Sponsored by:		Netflix
2021-06-02 10:39:58 -06:00
Warner Losh
455dff72fc hpt27xx: Use EXTRA_OBJS instead of OBJS
Sponsored by:		Netflix
Reviewed by:		emaste@
Differential Revision:	https://reviews.freebsd.org/D30616
2021-06-02 10:39:58 -06:00
Warner Losh
e8dca53aa0 kmod.mk: Allow extra objects to be specified in modules
OBJS are automatically added to CLEANFILES. For pre-built objects, this
is not desirable since it will delete the object from the source
tree. Introduce EXTRA_OBJS which list these object files, but aren't
added to clean files.

Sponsored by:		Netflix
Reviewed by:		emaste@
Differential Revision:	https://reviews.freebsd.org/D30615
2021-06-02 10:39:58 -06:00
Ceri Davies
774bb1c256 periodic: add support for .xz and .zcat compressed logs
Also improve temporary file usage in 200.accounting, add an xref to
zstd(1) to newsyslog.conf.5, and clarify in periodic.conf that
"daily accounting" means process accounting and "monthly accounting"
is login accounting.

PR:		253868
Reviewed by:	allanjude
Approved by:	blackend (mentor)
Differential Revision:	https://reviews.freebsd.org/D29267
2021-06-02 17:28:28 +01:00
Mateusz Guzik
c9f8dcda85 kqueue: replace kq_ncallouts loop with atomic_fetchadd 2021-06-02 15:14:58 +00:00
Rich Ercolani
a19ae1b099 vfs: fix MNT_SYNCHRONOUS check in vn_write
ca1ce50b2b ("vfs: add more safety against concurrent forced
unmount to vn_write") has a side effect of only checking MNT_SYNCHRONOUS
if O_FSYNC is set.

Reviewed By: mjg
Differential Revision: https://reviews.freebsd.org/D30610
2021-06-02 13:42:02 +00:00
Andrew Turner
2422138952 Fix the KCSAN_ENABLED check when building modules
The KCSAN_ENABLED variable is non-empty when the kernel is being built
with KCSAN. This allows us to disable modules that are known to be
broken.

There was a bug where we would check if it was defined. As this is
always the case the KCSAN_ENABLED variable would be set when building
modules so we would never build such a module. Fix this by checking
if the value is empty before passing it on to the module stage.

This doesn't affect how modules are built as the CFLAGS passed to
modules has the correct check.

Reported by:	rstone
Sponsored by:	Innovate UK
2021-06-02 10:59:19 +00:00
Andrew Turner
0a0d6ce34d Use the arm virtual counter in the arm64 loader
It exist on all ARMv8+ CPUs, and other boot loaders rely on it being
present.

Sponsored by:	Innovate UK
Differential Revision: https://reviews.freebsd.org/D30410
2021-06-02 10:58:20 +00:00
Emmanuel Vadot
25593adbc1 arm: allwinner: Add clock driver for Display Engine to the build
This is needed for drm
2021-06-02 10:17:16 +02:00
Marcin Wojtas
4fa977f854 sdhci_xenon: add UHS support
This patch adds the necessary methods resolution to the sdhci_xenon
driver which are required to configure UHS modes for SD/MMC devices.
Apart from the two generic routines, the custom sdhci_xenon_set_uhs_timing
function is responsible for setting the SDHCI_HOST_CONTROL2 register
with appropriate mode select values - in case of HS200 and HS400
they are non-standard.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30565
MFC after: 2 weeks
2021-06-02 09:55:20 +02:00
Marcin Wojtas
c80e2ca57e sdhci_xenon: improve the VCCQ voltage switch sequence
Improve the VCCQ voltage switch, so that to properly
handle the SDHCI_HOST_CONTROL2 register signaling
flags and along with manipulating the regulator.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30564
MFC after: 2 weeks
2021-06-02 09:55:20 +02:00
Marcin Wojtas
df86876284 sdhci_xenon: allow to properly disable the UHS signaling
Until now the "no-1-8-v" DT flag wrongly disabled the SDHCI_CAN_VDD_180
- slot 1.8V power supply capability, whereas it refers to the signaling
voltage. Fix the sdhci_xenon_read_4 and allow to disable the UHS modes
depending on the DT property or PHY slow mode. While at it - make sure
the unsupported 1.2V signaling is always disabled and not reported
in the bootverbose log.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30563
MFC after: 2 weeks
2021-06-02 09:55:19 +02:00
Marcin Wojtas
43e31350f8 sdhci_xenon: enable MMC FDT parsing
The mmc_fdt_parse allows to parse more MMC-related
FDT properties. Start using it. "wp-inverted" property,
VQMMC and newly added VMMC power supply parsing
is now done in a generic code.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30562
MFC after: 2 weeks
2021-06-02 09:55:19 +02:00
Marcin Wojtas
5652be30a3 sdhci: allow setting MMC capabilities before sdhci_init_slot
With this change the host controller drivers can set the MMC capabilities
(e.g. using mmc_fdt_parse() helper) before calling sdhci_init_slot().
This way the configuration dump (eg. in bootverbose) can include the
possible additional information.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30561
MFC after: 2 weeks
2021-06-02 09:55:19 +02:00
Marcin Wojtas
7d8700bc29 sdhci: extend bus_dma_tag boundary to 64-bit space
This patch adds support for the SDHCI_CAN_DO_64BIT
capability, so that to allow 64-bit DMA operation
for the controllers which support this feature.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30560
MFC after: 2 weeks
2021-06-02 09:55:19 +02:00
Marcin Wojtas
9cf66a0458 uart_dev_ns8250: Switch ACPI UART subtype for Marvell SoCs
DBG2 ACPI table description [1] specifies three subtypes
related to 16550 UART:
0x0 - 16550 compatible
0x1 - 16550 subset
0x12 - 16550 compatible with parameters defined in Generic Address Structure (GAS)

It turned out however, that the Windows OS treats 0x0 subtype as
legacy x86 UART with 8-bit access. ARM SoCs can use types 0x1 (16550 with
fixed mmio32 access) or 0x12 (16550 with fully respected GAS contents).

Switch Marvell SoCs ACPI UART subtype to 0x1 - thanks to that the same firmware
can run properly with UART output in FreeBSD, Windows 10, Linux and ESXI
hypervisor. Tests showed the older firmware versions that use 0x0
UART subtype in SPCR table continue to display output properly.

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-debug-port-table

Obtained from: Semihalf
Sponsored by: ARM
Differential revision: https://reviews.freebsd.org/D30386
MFC after: 2 weeks
2021-06-02 09:55:19 +02:00
Math Ieu
847b7d5054
Fix test case header function name
This restores the expected behavior (skip) when running with non-root user

MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D30584
2021-06-02 12:13:57 +08:00
Kyle Evans
2d741f33bd kern: ether_gen_addr: randomize on default hostuuid, too
Currently, this will still hash the default (all zero) hostuuid and
potentially arrive at a MAC address that has a high chance of collision
if another interface of the same name appears in the same broadcast
domain on another host without a hostuuid, e.g., some virtual machine
setups.

Instead of using the default hostuuid, just treat it as a failure and
generate a random LA unicast MAC address.

Reviewed by:	bz, gbe, imp, kbowling, kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D29788
2021-06-01 22:59:21 -05:00
Kyle Evans
e58a65ccda man: document ether_gen_addr(9)
This KPI is used to assign a MAC address to an interface that doesn't
already have one assigned.

Reviewed by:	bcr, gnn, imp, kbowling, kp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29787
2021-06-01 22:59:10 -05:00
Mark Johnston
8cd05b8833 amd64: Clear the local TSS when creating a new thread
Otherwise it is copied from the creating thread.  Then, if either thread
exits, the other is left with a dangling pointer, typically resulting in
a page fault upon the next context switch.

Reported by:	syzkaller
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30607
2021-06-01 19:38:22 -04:00