Commit Graph

268591 Commits

Author SHA1 Message Date
John Baldwin
828f257277 Remove nonexistent include path for arm64 crypto files.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D31932
2021-09-15 09:03:17 -07:00
Martin Matuska
53b70c86d9 zfs: merge openzfs/zfs@4a1195ca5 (master) into main
Notable upstream pull request merges:
  #11312 Temporarily use root credentials to mount snapshots in .zfs
  #12246 arc: Drop an incorrect assert
  #12443 Fixed data integrity issue when underlying disk returns error
         to zfs
  #12522 Compressed receive with different ashift can result in incorrect
         PSIZE on disk
  #12535 Verify embedded blkptr's in arc_read()
  #12541 Allow sending corrupt snapshots even if metadata is corrupted

Obtained from:	OpenZFS
OpenZFS commit:	4a1195ca50
2021-09-15 17:30:53 +02:00
Piotr Pawel Stefaniak
6e8272f317 mount: improve error message for invalid filesystem names
For an invalid filesystem name used like this:
mount -t asdfs /dev/ada1p5 /usr/obj

emit an error message like this:
mount: /dev/ada1p5: Invalid fstype: Invalid argument

instead of:
mount: /dev/ada1p5: Operation not supported by device

Differential Revision:	https://reviews.freebsd.org/D31540
2021-09-15 16:25:31 +02:00
Pawel Anikiel
2de4c7f6d0 pci_host_generic: Add Synopsys Designware PCIe controller quirk
Due to the quirky nature of the Synopsys Designware PCIe IP,
the type 0 configuration is broadcast and whatever device
is plugged into slot, will appear at each 32 device
positions of bus0. Mitigate the issue by filtering out
duplicated devices on this bus for both DT and ACPI cases.

Reviewed by: mw
Sponsored by: Semihalf
MFC: after 3 weeks
Differential revision: https://reviews.freebsd.org/D31887
2021-09-15 15:17:40 +02:00
Pietro Cerutti
41ba691f92 tee: use queue(9) in place of a custom linked list
Approved by: cognet
2021-09-15 11:04:24 +00:00
Andrew Turner
1896a00943 Use a 64 bit read to access GICR_TYPER
The GICv3 ITS only needs to implement 32 bit access to the GICR_TYPER
when the CPU implements AArch32. As this may not always be the case
use a 64 bit read when checking if the ITS is enabled on the CPU.

PR:		258217
Reported by:	Olivier Delande <olivier.delande@provenrun.com>
Sponsored by:	The FreeBSD Foundation
2021-09-15 09:13:41 +00:00
Michael Tuexen
4542164685 sctp: cleanup, no functional change intended
MFC after:	1 week
2021-09-15 10:18:11 +02:00
Alexander Motin
6c2d440416 ipmi(4): Limit maximum watchdog pre-timeout interval.
Previous code by default setting pre-timeout interval to 120 seconds
made impossible to set timeout interval below that, resulting in error
0xcc (Invalid data field in Request) at least on Supermicro boards.

To fix that limit maximum pre-timeout interval to ~1/4 of the timeout
interval, that sounds like a reasonable default: not too short to fire
too late, but also not too long to give many false reports.

MFC after:	2 weeks
2021-09-14 21:06:39 -04:00
Allan Jude
4a1195ca50
Temporarily use root credentials to mount snapshots in .zfs
When mounting a snapshot in the .zfs/snapshots control directory,
temporarily assume roots credentials to perform the VFS_MOUNT().

This allows regular users and users inside jails to access these
snapshots.

The regular usermount code is not helpful here, since it requires
that the user performing the mount own the mountpoint, which won't
be the case for .zfs/snapshot/<snapname>

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Sponsored-By: Modirum MDPay
Sponsored-By: Klara Inc.
Closes #11312
2021-09-14 17:10:00 -06:00
Alexander Motin
02d8194012 mps/mpr(4): Move xpt_register_async() out of lock.
It fixes lock ordere reversal between SIM and device locks.  Also
remove registration for AC_FOUND_DEVICE, unused for a while now.

MFC after:	1 month
2021-09-14 17:40:32 -04:00
Alan Somers
5dc5f849be tools/test/upsdl: fix compiler warnings
MFC after:	2 weeks
Sponsored by:	Axcient
2021-09-14 14:50:01 -06:00
John Baldwin
9affbb0f52 cxgbe tom: Enter network epoch in t4_aiotx_task().
While here, don't restore the old vnet until after sorele().

Sponsored by:	Chelsio Communications
2021-09-14 13:46:15 -07:00
John Baldwin
5dbf8c1588 cxgbe tom: Update rcv_nxt for a FIN after handle_ddp_close().
For TCP DDP, handle_ddp_close() needs to see the pre-FIN rcv_nxt to
determine how much data was placed in the local buffer before the FIN
was received.  The changes in d59f1c49e2 broke this by updating
rcv_nxt before calling handle_ddp_close().

Fixes:		d59f1c49e2 cxgbe tom: Permit rcv_nxt mismatches on FIN for iSCSI connections on T6.
Sponsored by:	Chelsio Communications
2021-09-14 13:46:14 -07:00
John Baldwin
1ecbc1d8e9 cxgbe tom: Don't queue AIO requests on listen sockets.
This is similar to the fixes in 141fe2dcee.  One difference is that
TOE sockets do not change states (listen vs non-listen) once created,
so no lock is needed for SOLISTENING().

Sponsored by:	Chelsio Communications
2021-09-14 13:46:14 -07:00
Edward Tomasz Napierala
bdf0f24bb1 linux: implement PTRACE_GET_SYSCALL_INFO
This is one of the pieces required to make modern (ie Focal)
strace(1) work.

Reviewed By:	jhb (earlier version)
Sponsored by:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D28212
2021-09-14 20:19:55 +00:00
Edward Tomasz Napierala
6f43f86bf3 tzcode: Fix operation without WITH_DETECT_TZ_CHANGES
Reviewed By:	bdrewery, kevans, cy
Reported By:	lwhsu, bdrewery
Fixes:		ddedf2a11e
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D31961
2021-09-14 20:17:50 +00:00
Ka Ho Ng
49050613ef ctl(4): Do hole-punching for UNMAP to file-backed LUNs
This adds support for SCSI UNMAP command to file-backed LUNs, if the
underlying file system has a non-zerofilling VOP_DEALLOCATE
implementation where some or all parts of the requested operation range
may be deallocated.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D31922
2021-09-15 03:51:58 +08:00
Ed Maste
8cba2003e8 Cirrus-CI: add a manually triggered arm64 task
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31953
2021-09-14 15:12:55 -04:00
Andrew Turner
90f33f34ba Remove a bogus assertion from the gic drivers
When setting a message based interrupt range we set the base and count.
In an earlier the count was implemented as an end value, however the
asserts used to check this value was correct were incorrectly left in.

Reported by:	emaste
Sponsored by:	The FreeBSD Foundation
2021-09-14 19:06:25 +00:00
John Baldwin
c782ea8bb5 Add a switch structure for send tags.
Move the type and function pointers for operations on existing send
tags (modify, query, next, free) out of 'struct ifnet' and into a new
'struct if_snd_tag_sw'.  A pointer to this structure is added to the
generic part of send tags and is initialized by m_snd_tag_init()
(which now accepts a switch structure as a new argument in place of
the type).

Previously, device driver ifnet methods switched on the type to call
type-specific functions.  Now, those type-specific functions are saved
in the switch structure and invoked directly.  In addition, this more
gracefully permits multiple implementations of the same tag within a
driver.  In particular, NIC TLS for future Chelsio adapters will use a
different implementation than the existing NIC TLS support for T6
adapters.

Reviewed by:	gallatin, hselasky, kib (older version)
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D31572
2021-09-14 11:43:41 -07:00
Mark Johnston
cf4670fe0b kcov: Integrate with KMSAN
- kern_kcov.c needs to be compiled with -fsanitize=kernel-memory when
  KMSAN is configured since it calls into various other subsystems.
- Disable address and memory sanitizers in kcov(4)'s coverage sanitizer
  callbacks, as they do not provide useful checking.  Moreover, with
  KMSAN we may otherwise get false positives since the caller (coverage
  sanitizer runtime) is not instrumented.
- Disable KASAN and KMSAN interceptors in subr_coverage.c, as they do
  not provide any benefit but do introduce overhead when fuzzing.

Sponsored by:	The FreeBSD Foundation
2021-09-14 14:29:27 -04:00
Alexander Motin
272c4a4dc5 Allow setting NFS server scope and owner.
By default NFS server reports as scope and owner major the host UUID
value and zero for owner minor.  It works good in case of standalone
server.  But in case of CARP-based HA cluster failover the values
should remain persistent, otherwise some clients like VMware ESXi
get confused by the change and fail to reconnect automatically.

The patch makes server scope, major owner and minor owner values
configurable via sysctls.  If not set (by default) the host UUID
value is still used.

Reviewed by:	rmacklem
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D31952
2021-09-14 14:18:03 -04:00
Ed Maste
0f9bafdfc3 openssh: pass ssh context to BLACKLIST_NOTIFY
Fixes:		19261079b7 ("openssh: update to OpenSSH v8.7p1")
Sponsored by:	The FreeBSD Foundation
2021-09-14 13:44:39 -04:00
Brian Behlendorf
6954c22f35
Use fallthrough macro
As of the Linux 5.9 kernel a fallthrough macro has been added which
should be used to anotate all intentional fallthrough paths.  Once
all of the kernel code paths have been updated to use fallthrough
the -Wimplicit-fallthrough option will because the default.  To
avoid warnings in the OpenZFS code base when this happens apply
the fallthrough macro.

Additional reading: https://lwn.net/Articles/794944/

Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12441
2021-09-14 10:17:54 -06:00
Mark Johnston
b1746faad6 debugnet: Include some required headers
Don't depend on pollution from net/vnet.h.

PR:		258496
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-09-14 11:02:45 -04:00
Mark Johnston
e6c19aa94d sctp: Allow blocking on I/O locks even with non-blocking sockets
There are two flags to request a non-blocking receive on a socket:
MSG_NBIO and MSG_DONTWAIT.  They are handled a bit differently in that
soreceive_generic() and soreceive_stream() will block on the socket I/O
lock when MSG_NBIO is set, but not if MSG_DONTWAIT is set.  In general,
MSG_NBIO seems to mean, "don't block if there is no data to receive" and
MSG_DONTWAIT means "don't go to sleep for any reason".

SCTP's soreceive implementation did not allow blocking on the I/O lock
if either flag is set, but this violates an assumption in
aio_process_sb(), which specifies MSG_NBIO but nonetheless
expects to make progress if data is available to read.  Change
sctp_sorecvmsg() to block on the I/O lock only if MSG_DONTWAIT
is not set.

Reported by:	syzbot+c7d22dbbb9aef509421d@syzkaller.appspotmail.com
Reviewed by:	tuexen
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31915
2021-09-14 09:02:05 -04:00
Mark Johnston
fa0463c384 socket: De-duplicate SBLOCKWAIT() definitions
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-09-14 09:01:32 -04:00
Andrew Turner
fd860ace3b Remove the DN flag from the initial arm64 fpcr value
This fixes software that expects NaN values to propagate.

Sponsored by:	The FreeBSD Foundation
2021-09-14 12:52:48 +00:00
Andrew Turner
e4d89a633e Add support for gicv2m as a child of gicv3
On some systems, e.g. Parallels set to host a Linux VM under an M1 Mac,
there is a GICv2m as a child of the GICv3. We previously assumed the
GICv2m was always a child of a GICv2. Fix this by adding the needed
support to the GICv3 driver.

PR:		258136
Reported by:	trasz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31768
2021-09-14 08:24:52 +01:00
Andrew Turner
c6f3076d44 Move the GICv2m msi handling to the parent
This is in preperation for adding support for the GICv2m driver as a
child of the GICv3 driver.

PR:             258136
Reported by:    trasz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31767
2021-09-14 08:24:52 +01:00
Wojciech Macek
ba4d9d9d5b Revert "if_mvneta: Build the driver as a kernel module"
This reverts commit bcf5c7a8b1.
2021-09-14 11:49:59 +02:00
Peter Holm
94c678cf19 stress2: A two second timeout is too short 2021-09-14 07:50:26 +00:00
Hubert Mazur
bcf5c7a8b1 if_mvneta: Build the driver as a kernel module
Fix device detach and attach routine. Add required Makefile
to build as a module. Remove entry from GENERIC, since now
it can be loaded automatically.

Tested on EspressoBin.

Obtained from:		Semihalf
Reviewed by:		manu
Differential revision:	https://reviews.freebsd.org/D31581
2021-09-14 08:29:53 +02:00
Konstantin Belousov
1c56781cc9 amd64 wakeup: rework trampoline page allocation
There is no need to restrict trampoline page table to low 1M, it
should work with any pages below 4G.  Only wakeup code itself should
be below 1M.

Do not waste level 5 page when LA48 mode is used.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31931
2021-09-14 00:23:15 +03:00
Konstantin Belousov
2b6eec531a x86: duplicate acpi_wakeup.c per i386 and amd64
The file as is is the maze of #ifdef passages, all slightly different.
Divorcing i386 and amd64 version actually makes changing the code
easier, also no changes for i386 are planned.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31931
2021-09-14 00:23:14 +03:00
Krzysztof Galazka
abf774528d
ixl(4): Fix 2.5 and 5G speeds reporting and update shared code
Fix 2.5 and 5G speeds reporting and update shared code with recent
changes:
- Update expected FW API versions for X710 and X722 adapters
- Define pointers related to Preservation Rules Module
- Add definitions for Shadow RAM pointers to new modules: 5th and 6th
  FPA, and Preservation Rules Module.
- Add I40E_RX_PTYPE_PARSER_ABORTED definition, so the driver will know
  opcode for parser aborted packets.
- Add the new filter types needed for custom cloud filters.
- Add support for Minimum Rollback Revision
- Fix RX_ONLY mode for unicast promiscuous on VLAN
- Add EEE LPI status check for X722 adapters
- Fix PHY type identifiers for 2.5G and 5G adapters
- Fix update link data for X722
- Increase the timeout value for PF reset to give PF more time to finish
  reset if it is loaded with filters.
- Added support for Min Rollback Revision for 4 more X722 modules
- Fix reporting of Active Optical Cable media type
- Add flags and fields for double VLAN processing
- Fix potentially uninitialized variables in NVM code

Reviewed by:	kbowling@, mike.jakubik@gmail.com
Tested by:	gowtham.kumar.ks@intel.com
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D31565
2021-09-13 14:00:50 -07:00
Jessica Clarke
f28c1d0c5c llvm-objcopy: Install llvm-strip, and optionally strip, links
Just as elftoolchain's objcopy doubles as strip, so does LLVM's. This
ensures that a strip binary is still present for WITH_LLVM_BINUTILS
builds. Note that we do not currently have a committed copy of the
manpage generated from the rST source so no manpage is installed for
(llvm-)strip.

Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
Tested by:	Shawn Webb <shawn.webb@hardenedbsd.org>
MFC after:	1 week
2021-09-13 21:52:40 +01:00
Jorgen Lundman
7443299fe0
Iterate encrypted clones at zvol_create_minor
Userland figures out which encryption-root keys are required to load,
and issues ZFS_IOC_LOAD_KEY.
The tail section of spa_keystore_load_wkey() will call
zvol_create_minors() on the encryption-root object.

Any clones of the encrypted zvol will not be plumbed. This commits
adds additional logic to detect if zvol has clones, and is encrypted,
then adds these to the list of zvols to call zvol_create_minors() on.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #12471
2021-09-13 13:27:07 -07:00
Arun KV
f82f0279ed
Fixed data integrity issue when underlying disk returns error
Errors in zil_lwb_write_done() are not propagated to
zil_lwb_flush_vdevs_done() which can result in zil_commit_impl()
not returning an error to applications even when zfs was not able
to write data to the disk.

Remove the ZIO_FLAG_DONT_PROPAGATE flag from zio_rewrite() to
allow errors to propagate and consolidate the error handling for
flush and write errors to a single location (rather than having
error handling split between the "write done" and "flush done"
handlers).

Reviewed-by: George Wilson <gwilson@delphix.com>
Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
Signed-off-by: Arun KV <arun.kv@datacore.com>
Closes #12391
Closes #12443
2021-09-13 13:02:39 -07:00
Stefan Grundmann
e673ac3ffb libnv: Fix array unpack endianness logic
When a nvlist(9) is converted into a binary buffer by nvlist_pack(9),
the host endianness is encoded in the nvlist_header of the binary
buffer. The nvlist_unpack(9) function converts a given binary buffer
to an nvlist. In the conversion process the endianness encoded in the
nvlist_header is evaluated and -- should the encoded endianness differ
from the endianess of the decoding host -- endianness conversion is
applied to nvlist_header and nvpair_header elements as well as
to some nvpair values.

In 2015 @oshogbo extended libnv with array support (in 347a39b).
The unpacking code misses the possible need to convert the endianness
of the nvph_nitems element of nvpair_headers.

The patch (re)enables libnv to unpack nvlists regardless of the
endianness of the packing host.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/528
2021-09-13 21:21:14 +02:00
Brian Behlendorf
695d4ae815
ZTS: Waiting for zvols to be available
This is a follow up patch for PR #12515 which addresses some
additional ZTS tests which are unreliable are should explicitly
wait for the required zvols to be available.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: @Theo13111
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12553
2021-09-13 12:18:01 -07:00
John Baldwin
93d6fa53c9 Disable -Woverflow errors for i386 for GCC 9.
GCC 9 warns about floating point constants overflowing for i386.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D26201
2021-09-13 11:00:38 -07:00
John Baldwin
3b5f95d7bd ctld: Disable TCP DDP for connection sockets.
cxgbei is not able to offload PDU processing for a socket using TCP
DDP offload.

Sponsored by:	Chelsio Communications
2021-09-13 09:57:54 -07:00
John Baldwin
91c62d626d iscsid: Disable TCP DDP for connection sockets.
cxgbei is not able to offload PDU processing for a socket using TCP
DDP offload.

Sponsored by:	Chelsio Communications
2021-09-13 09:57:54 -07:00
John Baldwin
f63ddf465f cxgbei: Only convert "plain" TCP connections to ISCSI.
Reject attempts to convert a connection using a different ULP
mode: (e.g. DDP or TLS) to ISCSI.

Reported by:	Jithesh Arakkan @ Chelsio
Sponsored by:	Chelsio Communications
2021-09-13 09:57:54 -07:00
John Baldwin
b7caa81576 cxgbei: Return early for EBUSY error in icl_cxgbei_conn_handoff.
This permits unindenting almost half of the function.

Sponsored by:	Chelsio Communications
2021-09-13 09:57:54 -07:00
John Baldwin
9b1bb0aee6 cxgbei: Disable ISO for -SO cards without external memory.
Reported by:	Jithesh Arakkan @ Chelsio
Sponsored by:	Chelsio Communications
2021-09-13 09:57:54 -07:00
Konstantin Belousov
db2ba218d9 amd64 acpi_wakeup: map 1:1 whole low 4G for the trampoline page table
This is required since kernel text might be physically located
anywhere below 4G.

PR:	258432
Reported by:	Taku YAMAMOTO <taku@tackymt.homeip.net>
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31916
2021-09-13 19:52:13 +03:00
Konstantin Belousov
ceca8ac1ce x86 acpi_install_wakeup_handler(): style
Do not use tab between type and variable name in local declarations.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31916
2021-09-13 19:52:06 +03:00
Konstantin Belousov
e99255c8a6 amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31916
2021-09-13 19:51:52 +03:00