]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoena: Trigger reset on ena_com_prepare_tx failure
Artur Rojek [Thu, 12 Aug 2021 08:34:24 +0000 (10:34 +0200)]
ena: Trigger reset on ena_com_prepare_tx failure

All ena_com_prepare_tx errors other than ENA_COM_NO_MEM are fatal and
require device reset.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

2 years agoena: Avoid unnecessary mbuf collapses for LLQ condition
Artur Rojek [Thu, 12 Aug 2021 08:34:17 +0000 (10:34 +0200)]
ena: Avoid unnecessary mbuf collapses for LLQ condition

In case of Low-latency Queue, one small enough descriptor can be pushed
directly to the ENA hw, thus saving one fragment. Check for this
condition before performing collapse.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

2 years agosyscalls.master: correct formatting issues
Brooks Davis [Wed, 1 Sep 2021 20:54:38 +0000 (21:54 +0100)]
syscalls.master: correct formatting issues

Reviewed by: kevans, emaste
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D31351

2 years agosyscalls.master: switch to CAPENABLED flags
Brooks Davis [Wed, 1 Sep 2021 20:54:38 +0000 (21:54 +0100)]
syscalls.master: switch to CAPENABLED flags

Switch the main syscall table to use CAPENABLED flags rather than
capabilities.conf.  This avoid synchronization issues between
syscalls.master and capabilities.conf (e.g. when renaming a syscall
during development).

For now, move capabilities.conf to sys/compat/freebsd32 and use it
there.  Use of sys/compat/freebsd32/syscalls.master should be replaced
by makesyscalls.lua enhancements to allow the main one to be used.

This change results in no changes to generated files after running
`make sysent`.

Reviewed by: kevans, emaste
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D31350

2 years agomakesyscalls.lua: add a CAPENABLED flag
Brooks Davis [Wed, 1 Sep 2021 20:54:38 +0000 (21:54 +0100)]
makesyscalls.lua: add a CAPENABLED flag

The CAPENABLED flag indicates that the syscall can be used in capsicum
capability mode.  It is intended to replace capabilities.conf.

Reviewed by: kevans, emaste
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D31349

2 years agoRevert "arm: Bump KSTACK_PAGES default to match i386/amd64"
Kevin Bowling [Wed, 1 Sep 2021 20:06:27 +0000 (13:06 -0700)]
Revert "arm: Bump KSTACK_PAGES default to match i386/amd64"

This reverts commit b684d812fcb04b2997fd755405a92c36b9f6e30e.

It causes an issue on a pfsense routing workload where memory
fragmentation prevents the necessary consecutive pages from being
readily available.

Reported by: pfsense (mjg, scottl)
Approved by: ian
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D31244

2 years agoppbus: Set the lock for pps interface, update to latest api
Warner Losh [Wed, 1 Sep 2021 19:37:27 +0000 (13:37 -0600)]
ppbus: Set the lock for pps interface, update to latest api

Since we take a lock when we enter the ioctl, we need to set driver_mtx
in the pps structure so it can be dropped while sleeping during a call
to timepps_fetch() with a non-zero timeout (PPS_CANWAIT feature).

MFC After: 5 days
Sponsored by: Netflix
Reviewed by: ian
Differential Revision: https://reviews.freebsd.org/D31763

2 years agoopenssh: update note about class-based login restrictions
Ed Maste [Wed, 1 Sep 2021 20:09:56 +0000 (16:09 -0400)]
openssh: update note about class-based login restrictions

2 years agoopenssh: simplify login class restrictions
Ed Maste [Tue, 31 Aug 2021 19:30:50 +0000 (15:30 -0400)]
openssh: simplify login class restrictions

Login class-based restrictions were introduced in 5b400a39b8ad.  The
code was adapted for sshd's Capsicum sandbox and received many changes
over time, including at least fc3c19a9fceebd393de91cc3, and
e8c56fba2926.

During an attempt to upstream the work a much simpler approach was
suggested.  Adopt it now in the in-tree OpenSSH to reduce conflicts with
future updates.

Submitted by: Yuchiro Naito (against OpenSSH-portable on GitHub)
Obtained from: https://github.com/openssh/openssh-portable/pull/262
Reviewed by: allanjude, kevans
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31760

2 years agokevent: Fix races between timer detach and kqtimer_proc_continue()
Mark Johnston [Wed, 1 Sep 2021 18:18:58 +0000 (14:18 -0400)]
kevent: Fix races between timer detach and kqtimer_proc_continue()

- When detaching a knote, we need to double check the enqueued flag
  after acquiring the process lock, as kqtimer_proc_continue() may have
  toggled it.
- kqtimer_proc_continue() could in principle reschedule a stopped
  callout after filt_timerdetach() drains the callout.  So, we need to
  re-check.

Reported by: syzbot+4a4cebb3ec07892cb040@syzkaller.appspotmail.com
Reported by: syzbot+a9c04bc76078a3b7dd8d@syzkaller.appspotmail.com
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31772

2 years agopf tests: altq:codel_bridge requires if_bridge
Kristof Provost [Wed, 1 Sep 2021 14:09:14 +0000 (16:09 +0200)]
pf tests: altq:codel_bridge requires if_bridge

Check that the bridge module is loaded before running this test.
It likely will be (as a result of running the bridge tests), but if it's
not we'll get spurious failures.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agounionfs: style
Jason A. Harmening [Tue, 31 Aug 2021 01:55:42 +0000 (18:55 -0700)]
unionfs: style

Fix the more egregious style(9) violations in unionfs.
No functional change intended.

2 years agounionfs: rework pathname handling
Jason A. Harmening [Sun, 29 Aug 2021 21:36:15 +0000 (14:36 -0700)]
unionfs: rework pathname handling

Running stress2 unionfs tests reliably produces a namei_zone corruption
panic due to unionfs_relookup() attempting to NUL-terminate a newly-
allocate pathname buffer without first validating the buffer length.

Instead, avoid allocating new pathname buffers in unionfs entirely,
using already-provided buffers while ensuring the the correct flags
are set in struct componentname to prevent freeing or manipulation
of those buffers at lower layers.

While here, also compute and store the path length once in the unionfs
node instead of constantly invoking strlen() on it.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D31728

2 years agosctp: Always check for a vanishing inpcb when processing COOKIE-ECHO
Mark Johnston [Wed, 1 Sep 2021 14:28:17 +0000 (10:28 -0400)]
sctp: Always check for a vanishing inpcb when processing COOKIE-ECHO

We previously did this only in the normal case where no association
exists yet.  However, it is not safe to process COOKIE-ECHO even if an
association exists, as sctp_process_cookie_existing() may dereference
the socket pointer.

See also commit 0c7dc84076b64ef74c24f04400d572f75ef61bb4.

Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31755

2 years agosctp: Hold association locks across socket wakeups when freeing
Mark Johnston [Wed, 1 Sep 2021 14:27:51 +0000 (10:27 -0400)]
sctp: Hold association locks across socket wakeups when freeing

At this point we do not hold the inpcb lock, so the only thing holding
the socket reference live is the TCB lock, which needs to be acquired by
sctp_inpcb_free() in order to destroy associations.  Defer the unlock to
until after we dereference the socket reference.

Reported by: syzbot+1d0f2c4675de76a4cf1e@syzkaller.appspotmail.com
Reported by: syzbot+fabee77954fe69d3a5ad@syzkaller.appspotmail.com
Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31754

2 years agosctp: Release the socket reference when detaching an association
Mark Johnston [Wed, 1 Sep 2021 14:27:31 +0000 (10:27 -0400)]
sctp: Release the socket reference when detaching an association

Later in sctp_free_assoc(), when we clean up chunk lists,
sctp_free_spbufspace() is used to reset the byte count in the socket
send buffer.  However, if the PCB is going away, the socket may already
have been detached from the PCB, in which case this becomes a use-after
free.  Clear the socket reference from the association before detaching
it from the PCB, if the PCB has already lost its socket reference.

Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31753

2 years agosctp: Implement sctp_inpcb_bind_locked()
Mark Johnston [Wed, 1 Sep 2021 14:04:47 +0000 (10:04 -0400)]
sctp: Implement sctp_inpcb_bind_locked()

This will be used by sctp_listen() to avoid dropping locks when
performing an implicit bind.  No functional change intended.

Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31757

2 years agosctp: Add macros to assert on inp info lock state
Mark Johnston [Wed, 1 Sep 2021 14:06:02 +0000 (10:06 -0400)]
sctp: Add macros to assert on inp info lock state

Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31756

2 years agovfs: Use file_cred for VOP_DEALLOCATE in vn_deallocate if non-NULL
Ka Ho Ng [Wed, 1 Sep 2021 12:18:24 +0000 (20:18 +0800)]
vfs: Use file_cred for VOP_DEALLOCATE in vn_deallocate if non-NULL

This changes vn_deallocate() to match the behavior of vn_rdwr() when
picking which ucred to use. That is, vn_deallocate() uses file_cred for
making VOP call if it is non-NULL, or use active_cred otherwise.

Sponsored by: The FreeBSD Foundation
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D31712

2 years agoif_cdce: Add support for setting RX filtering
Kornel Duleba [Tue, 31 Aug 2021 12:22:30 +0000 (14:22 +0200)]
if_cdce: Add support for setting RX filtering

We can now set promisc and allmulti modes.
Filtering of given multicast addresses is not supported.
Changing the mode is done by sending a command described in:
"USB CDC Subclass Specification for Ethernet Devices v1.2, section 6.2.4".
This means that at least in theory this feature should work with all
modems that are using this driver.

This fixes Huawei E3372h-320 running new firmware in "HiLink" mode.
Previously it would reset a few seconds after its mode was changed
with "usb_modeswitch".
Setting RX filter to default value at the end of attach function
fixed that.

Sponsored by: Stormshield
Obtained from: Semihalf
Differential revision: https://reviews.freebsd.org/D31766
MFC after: 2 weeks
Reviewed by: hps

2 years agopf: import pf_set_protostate() from OpenBSD
Kristof Provost [Tue, 20 Jul 2021 16:38:16 +0000 (18:38 +0200)]
pf: import pf_set_protostate() from OpenBSD

to change a state's state (that term is overloaded in pf, protocol state
like ESTABLISHED for tcp here), don't do it directly, but go through a newly
introduced pf_set_protostate()

Reviewed by: kbowling
Obtainted from: OpenBSD
MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D31729

2 years agopf: Add counters for syncookies
Kristof Provost [Sun, 29 Aug 2021 13:54:50 +0000 (15:54 +0200)]
pf: Add counters for syncookies

Count when we send a syncookie, receive a valid syncookie or detect a
synflood.

Reviewed by: kbowling
MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D31713

2 years agocam: revert second half of 75b5caa08ef
Edward Tomasz Napierala [Wed, 1 Sep 2021 09:34:27 +0000 (09:34 +0000)]
cam: revert second half of 75b5caa08ef

This turns debugging printf() into a KASSERT().

Reviewed By: imp
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31523

2 years agorouting: Disallow zero nexthop weights in nexthop groups.
Alexander V. Chernikov [Mon, 30 Aug 2021 21:49:00 +0000 (21:49 +0000)]
routing: Disallow zero nexthop weights in nexthop groups.

Adding such nexthops breaks calc_min_mpath_slots() assumptions,
 thus resulting in the incorrect nexthop group creation and
 eventually leading to panic.
Reported by: avg
MFC after: 1 week

2 years agoOpenSSL: Reduce diff with the upstream
Jung-uk Kim [Wed, 1 Sep 2021 04:10:59 +0000 (00:10 -0400)]
OpenSSL: Reduce diff with the upstream

No functional change expected.

2 years agoOpenSSL: Regen manual pages for 1.1.1l
Jung-uk Kim [Wed, 1 Sep 2021 04:09:34 +0000 (00:09 -0400)]
OpenSSL: Regen manual pages for 1.1.1l

2 years agoImport OpenSSL 1.1.1l
Jung-uk Kim [Wed, 1 Sep 2021 04:26:38 +0000 (00:26 -0400)]
Import OpenSSL 1.1.1l

2 years agoAlign taskqueue_enqueue_timeout() to hardclock.
Alexander Motin [Wed, 1 Sep 2021 03:47:51 +0000 (23:47 -0400)]
Align taskqueue_enqueue_timeout() to hardclock.

It is done for all other KPIs using HZ, but was missed here.

MFC after: 2 weeks

2 years agograid: Avoid tasting devices with small sector sizes
Mark Johnston [Tue, 31 Aug 2021 21:09:52 +0000 (17:09 -0400)]
graid: Avoid tasting devices with small sector sizes

The RAID metadata parsers effectively assume a sector size of 512 bytes
or larger, but md(4) devices can be created with a sector size that's
any power of 2.  Add some seatbelts to graid tasting routines to ensure
that the requested sector(s) are large enough for the device to
plausibly contain RAID metadata.

Reported by: syzbot+f43583c9bf8357c8b56f@syzkaller.appspotmail.com
Reported by: syzbot+537dd9f22b91b698e161@syzkaller.appspotmail.com
Reported by: syzbot+51509dd48871c57c6e47@syzkaller.appspotmail.com
Reported by: syzbot+c882a31037ea2a54ff63@syzkaller.appspotmail.com
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoitimer: Serialize access to the p_itimers array
Mark Johnston [Tue, 31 Aug 2021 20:38:05 +0000 (16:38 -0400)]
itimer: Serialize access to the p_itimers array

Fix the following race between itimer_proc_continue() and process exit.

itimer_proc_continue() may be called via realitexpire(), the real
interval timer.  Note that exit1() drains this timer _after_ draining
and freeing itimers.  Moreover, itimers_exit() is called without the
process lock held; it only acquires the proc lock when deleting
individual itimers, so once they are drained we free p->p_itimers
without any synchronization.  Thus, itimer_proc_continue() may load a
non-NULL p->p_itimers array and iterate over it after it has been freed.

Fix the problem by using the process lock when clearing p->p_itimers, to
synchronize with itimer_proc_continue().  Formally, accesses to this
field should be protected by the process lock anyway, and since the
array is allocated lazily this will not incur any overhead in the common
case.

Reported by: syzbot+c40aa8bf54fe333fc50b@syzkaller.appspotmail.com
Reported by: syzbot+929be2f32503bbc3844f@syzkaller.appspotmail.com
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31759

2 years agomdconfig: Add a regression test for mediasize rounding
Mark Johnston [Tue, 31 Aug 2021 19:50:09 +0000 (15:50 -0400)]
mdconfig: Add a regression test for mediasize rounding

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agomd: Clamp to a multiple of the sector size when resizing
Mark Johnston [Tue, 31 Aug 2021 19:35:08 +0000 (15:35 -0400)]
md: Clamp to a multiple of the sector size when resizing

We do this when creating md(4) devices, in kern_mdattach_locked(), but
not when resizing the provider.  Apply the same policy when resizing, as
many GEOM classes do not expect to deal with providers for which
pp->mediasize % pp->sectorsize != 0.

Reported by: syzkaller
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agonvme(4): Add MSI and single MSI-X support.
Alexander Motin [Tue, 31 Aug 2021 17:34:48 +0000 (13:34 -0400)]
nvme(4): Add MSI and single MSI-X support.

If we can't allocate more MSI-X vectors, accept using single shared.
If we can't allocate any MSI-X, try to allocate 2 MSI vectors, but
accept single shared.  If still no luck, fall back to shared INTx.

This provides maximal flexibility in some limited scenarios.  For
example, vmd(4) does not support INTx and can handle only limited
number of MSI/MSI-X vectors without sharing.

MFC after: 1 week

2 years agosctp: Fix racy UNBOUND flag check in sctp_inpcb_bind()
Mark Johnston [Tue, 31 Aug 2021 11:43:47 +0000 (07:43 -0400)]
sctp: Fix racy UNBOUND flag check in sctp_inpcb_bind()

SCTP needs to avoid binding a given socket twice.  The check used to
avoid this is racy since neither the inpcb lock nor the global info lock
is held.  Fix it by synchronizing using the global info lock.  In
particular, sctp_inpcb_bind() may drop the inpcb lock in some cases, but
the info lock is sufficient to prevent double insertion into PCB hash
tables.

Reported by: syzbot+548a8560d959669d0e12@syzkaller.appspotmail.com
Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31734

2 years agosctp: Simplify the free port search in sctp_inpcb_bind()
Mark Johnston [Tue, 31 Aug 2021 11:43:39 +0000 (07:43 -0400)]
sctp: Simplify the free port search in sctp_inpcb_bind()

Eliminate a flag variable and reduce indentation.  No functional change
intended.

Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31733

2 years agosctp: Avoid unnecessary refcount bumps in sctp_inpcb_bind()
Mark Johnston [Tue, 31 Aug 2021 11:43:27 +0000 (07:43 -0400)]
sctp: Avoid unnecessary refcount bumps in sctp_inpcb_bind()

We only drop the inp lock when binding to a specific port.  So, only
acquire an extra reference when required.  This simplifies error
handling a bit.

Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31732

2 years agosctp: Remove always-false checks in sctp_inpcb_bind()
Mark Johnston [Tue, 31 Aug 2021 11:43:13 +0000 (07:43 -0400)]
sctp: Remove always-false checks in sctp_inpcb_bind()

No functional change intended.

Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31731

2 years agorouting: simplify malloc flags in alloc_nhgrp().
Alexander V. Chernikov [Tue, 31 Aug 2021 08:12:54 +0000 (08:12 +0000)]
routing: simplify malloc flags in alloc_nhgrp().

MFC after: 1 week

2 years agozfs: merge openzfs/zfs@3b89d9518 (master) into main
Martin Matuska [Tue, 31 Aug 2021 06:58:27 +0000 (08:58 +0200)]
zfs: merge openzfs/zfs@3b89d9518 (master) into main

Notable upstream pull request merges:
  #12022 Fix endianness issues with zstd
  #12319 Extend zpool-iostat to account for ZIO_PRIORITY_REBUILD
  #12458 Add hole punching support on FreeBSD version 1400032
  #12473 Initialize parity blocks before RAID-Z reconstruction benchmarking
  #12511 Make 'zpool labelclear -f' work on offlined disks
  #12514 FreeBSD: Don't remove SA xattr if not SA znode

Obtained from: OpenZFS
OpenZFS commit: 3b89d9518df2c7fd747e349873a3d4d498beb20e

2 years agoumodem: Add Huawei E3372h-320 device id
Kornel Duleba [Tue, 31 Aug 2021 06:44:36 +0000 (08:44 +0200)]
umodem: Add Huawei E3372h-320 device id

After switching the dongle to the Huawei alternate mode(modem mode)
with usb_modeswitch the serial interfaces had all of their ids set to
0xFF.
After modifying umodem to work with that it attached successfully and
I've managed to configure device with standard AT commands to get
internet connection.

2 years agomvneta: Fix MTU update sequence
Kornel Duleba [Tue, 31 Aug 2021 06:22:29 +0000 (08:22 +0200)]
mvneta: Fix MTU update sequence

After MTU is updated we might start using allocating RX buffers from different pool. (MJUM9BYTES vs MCLBYTES)
Because of that we need to update the RX buffer size in hardware.
Previously it was done only when the interface was up, which is incorrect since MTU can be changed at any time.

Differential revision: https://reviews.freebsd.org/D31724
Sponsored by: Stormshield
Obtained from: Semihalf
MFC after: 2 weeks
Reviewed by: wma

2 years agoffs_update(): Do not assume that EBUSY can only come LK_NOWAIT trylock
Konstantin Belousov [Thu, 26 Aug 2021 16:17:39 +0000 (19:17 +0300)]
ffs_update(): Do not assume that EBUSY can only come LK_NOWAIT trylock

Instead do protective check for the local flags and do not interpret
EBUSY specially if we did not request trylock mode for bread().

Reviewed by: mckusick
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agoffs_update(): recalculate flags after relocking the vnode
Konstantin Belousov [Thu, 26 Aug 2021 16:12:58 +0000 (19:12 +0300)]
ffs_update(): recalculate flags after relocking the vnode

Inode type could migrate between snapshot and regular types while the
vnode is unlocked.  Recalculate flags specific for snapshot after relock.

Reviewed by: mckusick
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agopci_host_generic_fdt: set domain number
Bartlomiej Grzesik [Tue, 31 Aug 2021 04:25:05 +0000 (06:25 +0200)]
pci_host_generic_fdt: set domain number

Set domain number to device unit.

Some boards have multiple RCs handled by different drivers,
this ensures that there are no collisions with ofw_pcib.

Obtained from: Semihalf
Reviewed by: wma
Differential revision: https://reviews.freebsd.org/D31508

2 years agoqoriq_dw_pci: Fix typo in link status checking code
Bartlomiej Grzesik [Tue, 31 Aug 2021 04:22:33 +0000 (06:22 +0200)]
qoriq_dw_pci: Fix typo in link status checking code

On some DesignWare PCIe controllers accessing config registers of slots
whose link is down triggers a SError. Because of that we need to check the
link status before any acceses config space.
Due to a typo link was always reported up.
This fixes a SError that occured during boot on LS1028A-RDB.

Obtained from: Semihalf
Reviewed by: wma
Differential revision: https://reviews.freebsd.org/D31509

2 years agoFix an early return in ctld UCL parser
Ryan Stone [Wed, 7 Jul 2021 20:04:10 +0000 (16:04 -0400)]
Fix an early return in ctld UCL parser

If the UCL ctld parser encountered a port that used the CTL
ioctl device, it fell into a special case that had an erroneous
early return.  This caused all configuration in the target
following the port attribute to be skipped.  Fix this by replacing
the return with a continue so that the rest of the config is
parsed correctly.

Sponsored by: Dell EMC Isilon
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31703
Reviewed by: bapt

2 years agoamd64: correctly calculate KVA of the preloaded ucode blob
Konstantin Belousov [Mon, 30 Aug 2021 20:25:31 +0000 (23:25 +0300)]
amd64: correctly calculate KVA of the preloaded ucode blob

when kernphys != 2M

Reported and tested by: kbowling
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoCirrus-CI: reduce VM memory to 8G
Ed Maste [Tue, 31 Aug 2021 00:50:34 +0000 (20:50 -0400)]
Cirrus-CI: reduce VM memory to 8G

Cirrus-CI now provides a task memory use graph, and it is clear we do
not need to provision the VM with 24GB.

Sponsored by: The FreeBSD Foundation

2 years agonvme(4): Do not panic on admin queue construct error.
Alexander Motin [Tue, 31 Aug 2021 00:36:22 +0000 (20:36 -0400)]
nvme(4): Do not panic on admin queue construct error.

MFC after: 1 week

2 years agoFreeBSD: Don't remove SA xattr if not SA znode
Ryan Moeller [Mon, 30 Aug 2021 23:01:09 +0000 (19:01 -0400)]
FreeBSD: Don't remove SA xattr if not SA znode

We attempt to remove an existing SA xattr when setting a dir xattr, but
this only makes sense if the znode has been upgraded to the SA format.
Otherwise, we will hit an assert in zfs_sa_get_xattr.

Make sure this is an SA znode before attempting to remove the SA xattr.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #12514

2 years agocxgbei: Add sysctls to report the maximum data segment lengths.
John Baldwin [Mon, 30 Aug 2021 22:55:40 +0000 (15:55 -0700)]
cxgbei: Add sysctls to report the maximum data segment lengths.

These sysctls report the maximum data segment lengths supported by an
adapter.  These are the values advertised to the remote end during the
login phase.

Sponsored by: Chelsio Communications

2 years agomx25l: Add support for Integrated Silicon Solution is25wp256
Thomas Skibo [Mon, 30 Aug 2021 20:39:20 +0000 (21:39 +0100)]
mx25l: Add support for Integrated Silicon Solution is25wp256

This is used for the on-board flash on the HiFive Unmatched board.

Reviewed by: #riscv, jrtc27
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31562

2 years agosifive_spi: Add missing case for SPIBUS_MODE_NONE
Thomas Skibo [Mon, 30 Aug 2021 20:39:20 +0000 (21:39 +0100)]
sifive_spi: Add missing case for SPIBUS_MODE_NONE

Otherwise sckmode is left uninitialised, not zero. This mode is used for
the on-board flash on the HiFive Unmatched board. Whilst here, catch
unknown modes and return an error rather than silently continuing.

Reviewed by: #riscv, jrtc27
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31562

2 years agocxgbei: Limit T5 transmit data segments to 15k.
John Baldwin [Mon, 30 Aug 2021 22:27:08 +0000 (15:27 -0700)]
cxgbei: Limit T5 transmit data segments to 15k.

This avoids exceeding a limit in the firmware when using ISO with
jumbo frames.

Reported by: Jithesh Arakkan @ Chelsio
Sponsored by: Chelsio Communications

2 years agoFix cross-endian interoperability of zstd
Rich Ercolani [Mon, 30 Aug 2021 21:13:46 +0000 (17:13 -0400)]
Fix cross-endian interoperability of zstd

It turns out that layouts of union bitfields are a pain, and the
current code results in an inconsistent layout between BE and LE
systems, leading to zstd-active datasets on one erroring out on
the other.

Switch everyone over to the LE layout, and add compatibility code
to read both.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12008
Closes #12022

2 years agorouting: Fix newly-added rt_get_inet[6]_parent() api.
Alexander V. Chernikov [Mon, 30 Aug 2021 21:10:37 +0000 (21:10 +0000)]
routing: Fix newly-added rt_get_inet[6]_parent() api.

Correctly handle the case when no default route is present.

Reported by: Konrad <konrad.kreciwilk at korbank.pl>

2 years agoZTS: Enable punch-hole tests on FreeBSD
Ka Ho Ng [Sun, 22 Aug 2021 15:22:07 +0000 (23:22 +0800)]
ZTS: Enable punch-hole tests on FreeBSD

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ka Ho Ng <khng@FreeBSD.org>
Sponsored-by: The FreeBSD Foundation
Closes #12458

2 years agoFreeBSD: Implement hole-punching support
Ka Ho Ng [Wed, 4 Aug 2021 15:57:48 +0000 (23:57 +0800)]
FreeBSD: Implement hole-punching support

This adds supports for hole-punching facilities in the FreeBSD kernel
starting from __FreeBSD_version 1400032.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ka Ho Ng <khng@FreeBSD.org>
Sponsored-by: The FreeBSD Foundation
Closes #12458

2 years agoktls: Support asynchronous dispatch of AEAD ciphers.
John Baldwin [Mon, 30 Aug 2021 20:11:52 +0000 (13:11 -0700)]
ktls: Support asynchronous dispatch of AEAD ciphers.

KTLS OCF support was originally targeted at software backends that
used host CPU cycles to encrypt TLS records.  As a result, each KTLS
worker thread queued a single TLS record at a time and waited for it
to be encrypted before processing another TLS record.  This works well
for software backends but limits throughput on OCF drivers for
coprocessors that support asynchronous operation such as qat(4) or
ccr(4).  This change uses an alternate function (ktls_encrypt_async)
when encrypt TLS records via a coprocessor.  This function queues TLS
records for encryption and returns.  It defers the work done after a
TLS record has been encrypted (such as marking the mbufs ready) to a
callback invoked asynchronously by the coprocessor driver when a
record has been encrypted.

- Add a struct ktls_ocf_state that holds the per-request state stored
  on the stack for synchronous requests.  Asynchronous requests malloc
  this structure while synchronous requests continue to allocate this
  structure on the stack.

- Add a ktls_encrypt_async() variant of ktls_encrypt() which does not
  perform request completion after dispatching a request to OCF.
  Instead, the ktls_ocf backends invoke ktls_encrypt_cb() when a TLS
  record request completes for an asynchronous request.

- Flag AEAD software TLS sessions as async if the backend driver
  selected by OCF is an async driver.

- Pull code to create and dispatch an OCF request out of
  ktls_encrypt() into a new ktls_encrypt_one() function used by both
  ktls_encrypt() and ktls_encrypt_async().

- Pull code to "finish" the VM page shuffling for a file-backed TLS
  record into a helper function ktls_finish_noanon() used by both
  ktls_encrypt() and ktls_encrypt_cb().

Reviewed by: markj
Tested on: ccr(4) (jhb), qat(4) (markj)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31665

2 years agoopenssh: add information about a local change
Ed Maste [Mon, 30 Aug 2021 19:28:38 +0000 (15:28 -0400)]
openssh: add information about a local change

2 years agoFix acpica macros that subtract null pointers
Dimitry Andric [Sun, 29 Aug 2021 11:15:23 +0000 (13:15 +0200)]
Fix acpica macros that subtract null pointers

Clang 13.0.0 produces a new -Werror warning about the ACPI_TO_INTEGER(p)
and ACPI_OFFSET(d, f) macros in acpica's actypes.h:

    sys/contrib/dev/acpica/components/dispatcher/dsopcode.c:708:31: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction]
        ObjDesc->Region.Address = ACPI_PTR_TO_PHYSADDR (Table);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/acpica/include/actypes.h:664:41: note: expanded from macro 'ACPI_PTR_TO_PHYSADDR'
    #define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
                                            ^~~~~~~~~~~~~~~~~~
    sys/contrib/dev/acpica/include/actypes.h:661:41: note: expanded from macro 'ACPI_TO_INTEGER'
    #define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) 0)
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/acpica/include/actypes.h:656:82: note: expanded from macro 'ACPI_PTR_DIFF'
    #define ACPI_PTR_DIFF(a, b)             ((ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b))))
                                                                                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

This problem of undefined behavior was also reported to acpica by @cem
in 2018: https://github.com/acpica/acpica/issues/407, but it seems there
was never any fix committed for it upstream.

Instead fix these locally, for ACPI_TO_INTEGER by simply casting the
incoming pointer to ACPI_SIZE (which corresponds roughly to uintptr_t
and size_t), and for ACPI_OFFSET by reusing our __offsetof definition
from sys/cdefs.h.

Reviewed by: emaste, kib, imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D31710

2 years agohwpmc: don't validate capabilities in allocation method
Mitchell Horne [Mon, 30 Aug 2021 17:03:18 +0000 (14:03 -0300)]
hwpmc: don't validate capabilities in allocation method

These checks were inconsistently applied across the various hwpmc
classes. The condition is already checked by the generic code in
hwpmc_mod.c, so remove them.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31388

2 years agohwpmc: consistently validate PMC class in allocation method
Mitchell Horne [Mon, 30 Aug 2021 17:02:23 +0000 (14:02 -0300)]
hwpmc: consistently validate PMC class in allocation method

It is always a good idea. In one case, attempting to allocate N+1 PMCs
from a class with N hardware counters would incorrectly attempt to
allocate from the next class in the list. Without this validation, this
can lead to all kinds of strange behaviour.

Since powerpc_allocate_pmc() is used by both the mpc7xxx and ppc970
classes, add a new global to track which is active (it will never be
both).

Reviewed by: luporl, ray
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31387

2 years agoaesni: Avoid a potential out-of-bounds load in aes_encrypt_icm()
Mark Johnston [Mon, 30 Aug 2021 18:22:20 +0000 (14:22 -0400)]
aesni: Avoid a potential out-of-bounds load in aes_encrypt_icm()

Given a partial block at the end of a payload, aes_encrypt_icm() would
perform a 16-byte load of the residual into a temporary variable.  This
is unsafe in principle since the full block may cross a page boundary.
Fix the problem by copying the residual into a stack buffer first.

Reported by: syzbot+b7e44cde9e2e89f0f6c9@syzkaller.appspotmail.com
Reported by: syzbot+4b5eaf123a99456b5160@syzkaller.appspotmail.com
Reported by: syzbot+70c74c1aa232633355ca@syzkaller.appspotmail.com
Reported by: syzbot+2c663776a52828373d41@syzkaller.appspotmail.com
Reviewed by: cem, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31730

2 years agongatm: remove one of doubled semicolons
Ed Maste [Mon, 30 Aug 2021 15:38:51 +0000 (11:38 -0400)]
ngatm: remove one of doubled semicolons

Discussed with: harti

2 years agoxinstall: fix invocation of llvm-strip
Mitchell Horne [Wed, 2 Jun 2021 15:00:56 +0000 (12:00 -0300)]
xinstall: fix invocation of llvm-strip

When executing strip(1), '--' is passed as an argument to explicitly
terminate the getopt(3) loop. The option parsing in llvm-strip doesn't
support this however, so setting XSTRIPBIN=llvm-strip results in an
unsupported argument error. llvm-strip(1) is otherwise
commandline-compatible with FreeBSD's strip(1), so just use the
documented argument format that is common to both.

Special care needs to be taken for filenames beginning with a '-'.

Reviewed by: arichardson, eugen (earlier version, both)
Discussed with: jilles
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D30614

2 years agowpa: Enclose FreeBSD specific defines
Cy Schubert [Thu, 26 Aug 2021 23:28:40 +0000 (16:28 -0700)]
wpa: Enclose FreeBSD specific defines

FreeBSD only defines are specific only to FreeBSD. Document them as such.
It is our intention to push this change to w1.fi.

MFC after: 1 week

2 years agowpa: Include all wpa include file search directories
Cy Schubert [Thu, 26 Aug 2021 23:17:11 +0000 (16:17 -0700)]
wpa: Include all wpa include file search directories

Though not all include file search directories are presently needed,
add them to the search list. This is required for the next update to
wpa.

No functional change intended.

MFC after: 1 week

2 years agowpa: Correctly build the hostapd BSD driver
Cy Schubert [Thu, 26 Aug 2021 22:59:03 +0000 (15:59 -0700)]
wpa: Correctly build the hostapd BSD driver

driver.bsd.c initializes itself differently when built for
hostapd than it does when built for wpa_supplicant.

MFC after: 1 week

2 years agoCreate sys/reg.h for the common code previously in machine/reg.h
Andrew Turner [Fri, 27 Aug 2021 09:38:40 +0000 (09:38 +0000)]
Create sys/reg.h for the common code previously in machine/reg.h

Move the common kernel function signatures from machine/reg.h to a new
sys/reg.h. This is in preperation for adding PT_GETREGSET to ptrace(2).

Reviewed by: imp, markj
Sponsored by: DARPA, AFRL (original work)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19830

2 years agoRevert "Disable the accelerated arm64 sha25 in static libraries"
Andrew Turner [Mon, 30 Aug 2021 09:34:30 +0000 (10:34 +0100)]
Revert "Disable the accelerated arm64 sha25 in static libraries"

This is now unneeded as arm64 can now resolve ifuncs in static binaries

This reverts commit c81ea895b563c4d1e39468a8525284b7474fe850.

Sponsored by: The FreeBSD Foundation

2 years agobhyve: Nuke double-semicolons
Elliott Mitchell [Mon, 30 Aug 2021 07:26:45 +0000 (15:26 +0800)]
bhyve: Nuke double-semicolons

A distinct number of double-semicolons ended up in bhyve. Take a pass at
getting rid of many of these harmless typos.

MFC after: 3 days

2 years agonfsd: Make loop calling VOP_ALLOCATE() iterate until done
Rick Macklem [Sun, 29 Aug 2021 23:46:27 +0000 (16:46 -0700)]
nfsd: Make loop calling VOP_ALLOCATE() iterate until done

The NFSv4.2 Deallocate operation loops on VOP_DEALLOCATE()
while progress is being made (remaining length decreasing).
This patch changes the loop on VOP_ALLOCATE() for the NFSv4.2
Allocate operation do the same, instead of stopping after
an arbitrary 20 iterations.

MFC after: 2 weeks

2 years agorouting: Bring back the ability to specify transmit interface via its name.
Alexander V. Chernikov [Sun, 29 Aug 2021 19:51:28 +0000 (19:51 +0000)]
routing: Bring back the ability to specify transmit interface via its name.

Some software references outgoing interfaces by specifying name instead of
 index.

Use rti_ifp from rt_addrinfo if provided instead of always using
 address interface when constructing nexthop.

PR:  255678
Reported by: martin.larsson2 at gmail.com
MFC after: 1 week

2 years agoUpdate a sysctl name to nbuffers_pcpu in hwpmc.4 and pmcstat.c
Piotr Pawel Stefaniak [Sat, 28 Aug 2021 08:01:19 +0000 (10:01 +0200)]
Update a sysctl name to nbuffers_pcpu in hwpmc.4 and pmcstat.c

This change was missed in r333509 (e6b475e0af).

Differential Revision: https://reviews.freebsd.org/D31704
Reviewed by: mjg

2 years agoxen: Fix warning by adding KERNBASE to modlist_paddr before casting
Dimitry Andric [Sun, 29 Aug 2021 14:02:31 +0000 (16:02 +0200)]
xen: Fix warning by adding KERNBASE to modlist_paddr before casting

Clang 13 produces the following warning for hammer_time_xen():

sys/x86/xen/pv.c:183:19: error: the pointer incremented by -2147483648 refers past the last possible element for an array in 64-bit address space containing 256-bit (32-byte) elements (max possible 576460752303423488 elements) [-Werror,-Warray-bounds]
                    (vm_paddr_t)start_info->modlist_paddr + KERNBASE;
                                ^                               ~~~~~~~~
sys/xen/interface/arch-x86/hvm/start_info.h:131:5: note: array 'modlist_paddr' declared here
    uint64_t modlist_paddr;         /* Physical address of an array of           */
    ^

This is because the expression first casts start_info->modlist_paddr to
struct hvm_modlist_entry * (via vmpaddr_t), and *then* adds KERNBASE,
which is then interpreted as KERNBASE * sizeof(struct
hvm_modlist_entry).

Instead, parenthesize the addition to get the intended result, and cast
it to struct hvm_modlist_entry * afterwards. Also remove the cast to
vmpaddr_t since it is not necessary.

Reviewed by: royger
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D31711

2 years agoZTS: Waiting for zvols to be available
Brian Behlendorf [Sun, 29 Aug 2021 15:56:58 +0000 (08:56 -0700)]
ZTS: Waiting for zvols to be available

The ZTS block_device_wait helper function should use -e when waiting
for a file to appear since it will be either a block special device
or a symlink.  This didn't cause any failures but when a device path
was specified the function would wait longer than needed.

Additionally update the most flakey test cases to pass the file path
to block_device_wait to try and improve the test reliability.  The
udev behavior on Fedora in particular can result in frequent false
positives.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12515

2 years agoFix -Wformat errors in pfctl on 32-bit architectures
Dimitry Andric [Sun, 29 Aug 2021 15:31:28 +0000 (17:31 +0200)]
Fix -Wformat errors in pfctl on 32-bit architectures

Use PRIu64 to printf(3) uint64_t quantities, otherwise this will result
in "error: format specifies type 'unsigned long' but the argument has
type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]" on 32-bit
architectures.

Fixes: 80078d9d38fd
MFC after: 1 week

2 years agoDon't error out on unused but set variables with clang 13
Dimitry Andric [Sun, 29 Aug 2021 13:53:40 +0000 (15:53 +0200)]
Don't error out on unused but set variables with clang 13

Clang 13.0.0 now has a -Wunused-but-set-variable warning similar to the
one gcc has had for quite a while. Since this triggers *very* often for
our kernel builds, don't make it a hard error, but leave the warning
visible so is some incentive to fix the instances.

MFC after: 3 days

2 years agoRemove -simplifycfg-dup-ret from CLANG_OPT_SMALL flags for clang 13
Dimitry Andric [Sun, 29 Aug 2021 13:39:16 +0000 (15:39 +0200)]
Remove -simplifycfg-dup-ret from CLANG_OPT_SMALL flags for clang 13

After llvm/clang 13.0.0, the -simplifycfg-dup-ret backend flag is no
longer supported. This was part of CLANG_OPT_SMALL, which is only still
used for stand/i386/boot2 and stand/i386/isoboot, to achieve the very
small binary size required. Luckily clang 13.0.0 does not need any
additional flags for this (I get 240 bytes available when building
boot2).

MFC after: 3 days

2 years agopfctl: use libpfctl to retrieve pf status
Kristof Provost [Thu, 26 Aug 2021 15:09:48 +0000 (17:09 +0200)]
pfctl: use libpfctl to retrieve pf status

Rather than call DIOCGETSTATUS ourselves use the new libpfctl functions.

MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D31697

2 years agolibpfctl: Implement DIOCGETSTATUS wrappers
Kristof Provost [Thu, 26 Aug 2021 15:06:15 +0000 (17:06 +0200)]
libpfctl: Implement DIOCGETSTATUS wrappers

MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D31696

2 years agolibpfctl: fix double free
Kristof Provost [Sun, 22 Aug 2021 14:20:15 +0000 (16:20 +0200)]
libpfctl: fix double free

Reviewed by: donner
MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D31695

2 years agopf: Introduce nvlist variant of DIOCGETSTATUS
Kristof Provost [Mon, 16 Aug 2021 19:55:27 +0000 (21:55 +0200)]
pf: Introduce nvlist variant of DIOCGETSTATUS

Make it possible to extend the GETSTATUS call (e.g. when we want to add
new counters, such as for syncookie support) by introducing an
nvlist-based alternative.

MFC after: 1 week
Sponsored by:   Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D31694

2 years agoFix a common typo in source code comments
Gordon Bergling [Sun, 29 Aug 2021 09:45:09 +0000 (11:45 +0200)]
Fix a common typo in source code comments

- s/concurently/concurrently/

MFC after: 3 days

2 years agovfs: yield in vn_deallocate_impl() loop
Ka Ho Ng [Sun, 29 Aug 2021 08:26:00 +0000 (16:26 +0800)]
vfs: yield in vn_deallocate_impl() loop

Yield at the end of each loop iteration if there are remaining works as
indicated by the value of *len updated by VOP_DEALLOCATE. Without this,
when calling vop_stddeallocate to zero a large region, the
implementation only zerofills a relatively small chunk and returns.

Sponsored by: The FreeBSD Foundation
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D31705

2 years agolibsa: Fix a typo in source code comments
Gordon Bergling [Sun, 29 Aug 2021 08:09:58 +0000 (10:09 +0200)]
libsa: Fix a typo in source code comments

- s/mininum/minimum/

MFC after: 3 days

2 years agoisci(4): Fix a common typo in src comments
Gordon Bergling [Sun, 29 Aug 2021 07:55:10 +0000 (09:55 +0200)]
isci(4): Fix a common typo in src comments

- s/exlusive/exclusive/

MFC after: 3 days

2 years agostress2: Added new msdosfs rename() tests
Peter Holm [Sun, 29 Aug 2021 06:37:54 +0000 (08:37 +0200)]
stress2: Added new msdosfs rename() tests

2 years agoldd: Remove non-functional -v option
Konstantin Belousov [Sat, 28 Aug 2021 17:28:54 +0000 (20:28 +0300)]
ldd: Remove non-functional -v option

It seems -v only worked for a.out.  Remove it, not even keeping the current
nop for compat.  Also remove more mentions of a.out format from the man
page.

Reviewed by: dim, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31708

2 years agoStyle
Konstantin Belousov [Fri, 27 Aug 2021 14:28:19 +0000 (17:28 +0300)]
Style

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agofsetown: Avoid process group lock recursion
Mark Johnston [Sat, 28 Aug 2021 19:50:44 +0000 (15:50 -0400)]
fsetown: Avoid process group lock recursion

Restore the pre-1d874ba4f8ba behaviour of disassociating the current
SIGIO recipient before looking up the specified process or process
group.  This avoids a lock recursion in the scenario where a process
group is configured to receive SIGIO for an fd when it has already been
so configured.

Reported by: pho
Tested by: pho
Reviewed by: kib
MFC after: 3 days

2 years agoExplicitly link zfsd with libspl to avoid undefined references
Dimitry Andric [Sat, 28 Aug 2021 18:23:15 +0000 (20:23 +0200)]
Explicitly link zfsd with libspl to avoid undefined references

Because lld 13.0.0 is more strict about undefined references when
linking to shared libraries, it produces the following errors for zfsd:

ld: error: /home/dim/obj/home/dim/src/llvm-13-update/amd64.amd64/tmp/usr/lib/libzfs_core.so: undefined reference to libspl_assertf [--no-allow-shlib-undefined]
ld: error: /home/dim/obj/home/dim/src/llvm-13-update/amd64.amd64/tmp/usr/lib/libnvpair.so: undefined reference to libspl_assertf [--no-allow-shlib-undefined]
ld: error: /home/dim/obj/home/dim/src/llvm-13-update/amd64.amd64/tmp/usr/lib/libavl.so: undefined reference to libspl_assertf [--no-allow-shlib-undefined]
*** [zfsd.full] Error code 1

Fix this by adding libspl (where libspl_assertf lives) to zfsd's LIBADD.

MFC after: 3 days

2 years agoFix a common typo in man pages and src comments
Gordon Bergling [Sat, 28 Aug 2021 17:24:27 +0000 (19:24 +0200)]
Fix a common typo in man pages and src comments

- s/desciptor/descriptor/

MFC after: 5 days

2 years agoFix some common typos in source code comments
Gordon Bergling [Sat, 28 Aug 2021 16:57:23 +0000 (18:57 +0200)]
Fix some common typos in source code comments

- s/priviledged/privileged/
- s/funtion/function/
- s/doens't/doesn't/
- s/sychronization/synchronization/

MFC after: 3 days

2 years agoinet6(4): Fix a few common typos in source code comments
Gordon Bergling [Sat, 28 Aug 2021 16:53:59 +0000 (18:53 +0200)]
inet6(4): Fix a few common typos in source code comments

- s/reshedule/reschedule/

MFC after: 3 days

2 years agoinet(3): Fix a few common typos in source code comments
Gordon Bergling [Sat, 28 Aug 2021 16:53:02 +0000 (18:53 +0200)]
inet(3): Fix a few common typos in source code comments

- s/funtion/function/

MFC after: 3 days

2 years agoocs_fs(4): Fix some common typos in source code comments
Gordon Bergling [Sat, 28 Aug 2021 16:24:08 +0000 (18:24 +0200)]
ocs_fs(4): Fix some common typos in source code comments

- s/transfered/transferred/
- s/associted/associated/

MFC after: 3 days

2 years agosh: improve emacs mode
Baptiste Daroussin [Sat, 28 Aug 2021 12:59:53 +0000 (14:59 +0200)]
sh: improve emacs mode

in emacs mode ^W should delete the previous word by default
Note that upstreaming this change directly into libedit is in process.

Reported by: manu
Reviewed by: jills, pstef, manu
Differential Revision: https://reviews.freebsd.org/D29493

2 years agoSilence unused parameter warnings in fspacectl(2) bootstrap stub
Dimitry Andric [Sat, 28 Aug 2021 13:37:24 +0000 (15:37 +0200)]
Silence unused parameter warnings in fspacectl(2) bootstrap stub

While here, replace spaces with tabs and add a newline at EOF.

Fixes: 5425ba8332571e57f9fe623346cb9d83293264d4
MFC after: 3 days