]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC r368555: caroot: update bundle
Kyle Evans [Tue, 15 Dec 2020 21:50:05 +0000 (21:50 +0000)]
MFC r368555: caroot: update bundle

Summary:
- One (1) added
- Ten (10) removed

3 years agoMFC r368525:
Kenneth D. Merry [Tue, 15 Dec 2020 19:59:29 +0000 (19:59 +0000)]
MFC r368525:
  ------------------------------------------------------------------------
  r368525 | ken | 2020-12-10 16:06:06 -0500 (Thu, 10 Dec 2020) | 17 lines

  Add the LTO-9 density code to libmt and the mt(1) man page.

  These values are taken directly from the density report from an
  IBM LTO-9 tape drive.  (Using mt getdensity)

  A LTO-9 drive stores 18TB raw (45TB with compression) on an LTO-9 tape.

  lib/libmt/mtlib.c:
          Add the LTO-9 density code, and bpmm/bpi values.

  usr.bin/mt/mt.1:
          Add the LTO-9 density code, bpmm/bpi values and number of
   tracks.  Bump the man page date.

  ------------------------------------------------------------------------
Sponsored by: Spectra Logic

3 years agoMFC r368239:
Kristof Provost [Tue, 15 Dec 2020 16:15:25 +0000 (16:15 +0000)]
MFC r368239:

pf tests: Re-enable panicing tests

We've fixed the vnet/epair cleanup race, so it is now safe to re-enable these
tests.

Sponsored by: Modirum MDPay

3 years agoMFC r368238:
Kristof Provost [Tue, 15 Dec 2020 16:13:32 +0000 (16:13 +0000)]
MFC r368238:

net: Revert vnet/epair cleanup race mitigation

Revert the mitigation code for the vnet/epair cleanup race (done in r365457).
r368237 introduced a more reliable fix.

Sponsored by: Modirum MDPay

3 years agoMFC r368237:
Kristof Provost [Tue, 15 Dec 2020 15:33:28 +0000 (15:33 +0000)]
MFC r368237:

if: Fix panic when destroying vnet and epair simultaneously

When destroying a vnet and an epair (with one end in the vnet) we often
panicked. This was the result of the destruction of the epair, which destroys
both ends simultaneously, happening while vnet_if_return() was moving the
struct ifnet to its home vnet. This can result in a freed ifnet being re-added
to the home vnet V_ifnet list. That in turn panics the next time the ifnet is
used.

Prevent this race by ensuring that vnet_if_return() cannot run at the same time
as if_detach() or epair_clone_destroy().

PR: 238870, 234985, 244703, 250870
Sponsored by: Modirum MDPay

3 years agoMFC r368458:
Mitchell Horne [Tue, 15 Dec 2020 14:58:40 +0000 (14:58 +0000)]
MFC r368458:
arm64: fix struct l_sigaction_t layout

3 years agoMFC r368281:
Mitchell Horne [Tue, 15 Dec 2020 14:54:36 +0000 (14:54 +0000)]
MFC r368281:
em: fix a null de-reference in em_free_pci_resources

3 years agoMFC r368588:
Kristof Provost [Tue, 15 Dec 2020 08:29:45 +0000 (08:29 +0000)]
MFC r368588:

pf: Allow net.pf.request_maxcount to be set from loader.conf

Mark request_maxcount as RWTUN so we can set it both at runtime and from
loader.conf. This avoids users getting caught out by the change from tunable to
run time configuration.

Suggested by: Franco Fichtner

3 years agoMFC r368561:
Brooks Davis [Mon, 14 Dec 2020 22:07:07 +0000 (22:07 +0000)]
MFC r368561:

ndis(4): expand deprecation to the whole driver

nids(4) was a clever idea in the early 2000's when the market was
flooded with 10/100 NICs with Windows-only drivers, but that hasn't been
the case for ages and the driver has had no meaningful maintenance in
ages. It only supports Windows-XP era drivers.

Reviewed by: imp, bcr
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D27527

3 years agoMFC r368543:
Brooks Davis [Mon, 14 Dec 2020 21:56:15 +0000 (21:56 +0000)]
MFC r368543:

style(9): Correct whitespace in struct definitions

struct ifconf and struct ifreq use the odd style "struct<tab>foo".
struct ifdrv seems to have tried to follow this but was committed with
spaces in place of most tabs resulting in "struct<space><space>ifdrv".

3 years agoMFC 368004: Pull the check for VM ownership into ppt_find().
John Baldwin [Mon, 14 Dec 2020 20:48:59 +0000 (20:48 +0000)]
MFC 368004: Pull the check for VM ownership into ppt_find().

This reduces some code duplication.  One behavior change is that
ppt_assign_device() will now only succeed if the device is unowned.
Previously, a device could be assigned to the same VM multiple times,
but each time it was assigned, the device's state was reset.

3 years agoMFC 368003:
John Baldwin [Mon, 14 Dec 2020 20:40:21 +0000 (20:40 +0000)]
MFC 368003:
Honor the disabled setting for MSI-X interrupts for passthrough devices.

Add a new ioctl to disable all MSI-X interrupts for a PCI passthrough
device and invoke it if a write to the MSI-X capability registers
disables MSI-X.  This avoids leaving MSI-X interrupts enabled on the
host if a guest device driver has disabled them (e.g. as part of
detaching a guest device driver).

This was found by Chelsio QA when testing that a Linux guest could
switch from MSI-X to MSI interrupts when using the cxgb4vf driver.

While here, explicitly fail requests to enable MSI on a passthrough
device if MSI-X is enabled and vice versa.

3 years agoMerge OpenSSL 1.1.1i.
Jung-uk Kim [Mon, 14 Dec 2020 19:18:11 +0000 (19:18 +0000)]
Merge OpenSSL 1.1.1i.

Note this is a direct commit because assembly code was moved to a new place
on head.

3 years agoMFC r368275: nvme: Fix typo in definition
Chuck Tuffli [Mon, 14 Dec 2020 17:18:59 +0000 (17:18 +0000)]
MFC r368275: nvme: Fix typo in definition

3 years agoMFC r364602: bhyve: NVMe set nominal health values
Chuck Tuffli [Mon, 14 Dec 2020 17:12:48 +0000 (17:12 +0000)]
MFC r364602: bhyve: NVMe set nominal health values

3 years agoMFC r368414:
Mark Johnston [Mon, 14 Dec 2020 14:54:20 +0000 (14:54 +0000)]
MFC r368414:
arm: Let the GDB stub write to SP, LR and GP registers

PR: 251463

3 years agoMFC r368161:
Michal Meloun [Mon, 14 Dec 2020 11:09:07 +0000 (11:09 +0000)]
MFC r368161:

  Store MPIDR register in pcpu.

3 years agoMFC r367955:
Michal Meloun [Mon, 14 Dec 2020 10:16:59 +0000 (10:16 +0000)]
MFC r367955:

  Ensure that the buffer is in nvme_single_map() mapped to single segment.
  Not a functional change.

3 years agoMFC r367865:
Michal Meloun [Mon, 14 Dec 2020 10:14:32 +0000 (10:14 +0000)]
MFC r367865:

  Also pass interrupt binding request to non-root interrupt controllers.  There
  are message based controllers that can bind interrupts even if they are not
  implemented as root controllers (such as the ITS subblock of GIC).

3 years agoMFC r367447:
Michal Meloun [Mon, 14 Dec 2020 09:49:07 +0000 (09:49 +0000)]
MFC r367447:

  Add a method to determine whether given interrupt is per CPU or not.

3 years agoMFC r3684733:
Justin Hibbits [Sun, 13 Dec 2020 22:42:48 +0000 (22:42 +0000)]
MFC r3684733:

dev/mfi: Make a seemingly bogus conditional unconditional

Summary:
r358689 attempted to fix a clang warning/error by inferring the intent
of the condition "(cdb[0] != 0x28 || cdb[0] != 0x2A)".  Unfortunately, it looks
like this broke things.  Instead, fix this by making this path unconditional,
effectively reverting to the previous state.

PR:             kern/251483

3 years agoMFC r368390:
Yuri Pankov [Sun, 13 Dec 2020 22:25:54 +0000 (22:25 +0000)]
MFC r368390:

update wcwidth data from utf8proc

Character width data being out of date is a constant source
of weird rendering issues and wasted time trying to diagnose
those, e.g. as reported by Jeremy Chadwick:

https://gitlab.com/muttmua/mutt/-/issues/67

Sadly, there is no real ("standard") wcwidth data source, so
this tries to rectify the problem using the utf8proc one (through
its C API) which would hopefully benefeat both FreeBSD and
utf8proc through bug reports (if any).

PR: 251767

3 years agoMFC r367768: Stop using NVME_MAX_XFER_SIZE constant.
Alexander Motin [Sun, 13 Dec 2020 02:21:54 +0000 (02:21 +0000)]
MFC r367768: Stop using NVME_MAX_XFER_SIZE constant.

This constant depends on MAXPHYS and does not respect device capabilities.
Use proper dynamic ioctl(NVME_GET_MAX_XFER_SIZE) instead.

3 years agoMFC r368132: Increase nvme(4) maximum transfer size from 1MB to 2MB.
Alexander Motin [Sun, 13 Dec 2020 02:19:18 +0000 (02:19 +0000)]
MFC r368132: Increase nvme(4) maximum transfer size from 1MB to 2MB.

With 4KB page size the 2MB is the maximum we can address with one page PRP.
Going further would require chaining, that would add some more complexity.

On the other side, to reduce memory consumption, allocate the PRP memory
respecting maximum transfer size reported in the controller identify data.
Many of NVMe devices support much smaller values, starting from 128KB.
To do that we have to change the initialization sequence to pull the data
earlier, before setting up the I/O queue pairs.  The admin queue pair is
still allocated for full MIN(maxphys, 2MB) size, but it is not a big deal,
since there is only one such queue with only 16 trackers.

3 years agoMFC r353491 by eugen:
Yuri Pankov [Sun, 13 Dec 2020 01:44:52 +0000 (01:44 +0000)]
MFC r353491 by eugen:

Add missing port to the list of needed tools in the README file
describing locale rebuild process:

devel/apache-ant

MFC r353791:

tools/tools/locale: allow POSIX target to be built in parallel

While it's rarely used target, more so a one not used during the
buildworld, it helps when it's not taking hours (literally).

MFC r364245 by hrs:

- Update to Unicode CLDR v35 (Unicode 12.0).

- Update tools/tools/locale to add make targets to automatically
  generate locale source files.  With this change, just typing
  "make obj && make -j4" will rebuild them.  Check README for more details.

- Fix issues in ja_JP ctypedef and range specification support
  in utf8-rollup.pl.

- Add a temporary patch for UnicodeData.txt to fix code ranges of
  CJK Ideograph Extension A and Extension B.

- tools/cldr2def.pl:
  Use eucJP for ja_JP ctypedef because eucJP is not compatible with UTF-8.

- tools/convert_map.pl:
  Add a verbose error message.

- tools/utf8-rollup.pl:
  Normalize entries to use Unicode, not UTF-8.

MFC r368404 by hrs:

Fix the source directory when installing the results.  The install
target did not install them actually.

3 years agoMFC r368489:
Dimitry Andric [Sat, 12 Dec 2020 23:59:05 +0000 (23:59 +0000)]
MFC r368489:

Merge commit 28de0fb48 from llvm git (by Luís Marques):

  [RISCV] Set __GCC_HAVE_SYNC_COMPARE_AND_SWAP_x defines

  The RISCV target did not set the GCC atomic compare and swap defines,
  unlike other targets. This broke builds for things like glib on
  RISCV.

  Patch by Kristof Provost (kprovost)

  Differential Revision: https://reviews.llvm.org/D91784

This should fix building glib20 on RISC-V and unblock a number of
dependent ports.

Requested by: kp

3 years agoMFC r367976:
Alan Somers [Sat, 12 Dec 2020 23:01:11 +0000 (23:01 +0000)]
MFC r367976:

ping6: update usage text after r365547

3 years agoMFC r366365:
Alan Somers [Sat, 12 Dec 2020 22:57:28 +0000 (22:57 +0000)]
MFC r366365:

fusefs tests: quell Coverity "Argument cannot be negative" warnings

Must abort tests early if open(2) fails.

Reported by: Coverity
Coverity CID: 1432810 and many others
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D26635

3 years agoMFC r340992:
Yuri Pankov [Sat, 12 Dec 2020 22:47:57 +0000 (22:47 +0000)]
MFC r340992:

Add ga_IE.UTF-8 locale.

PR: 228587
Submitted by: Micil <micheal.maclochlainn@oegaillimh.ie> (LC_TIME)

3 years agoMFC r367678:
Mateusz Piotrowski [Sat, 12 Dec 2020 20:40:42 +0000 (20:40 +0000)]
MFC r367678:

Document the PAGER environment variable

Sometimes users want to use freebsd-update(8) in a non-interactive way and
what they often miss is that they have to set PAGER to cat(1) in order to
avoid interactive prompts from less(1).

3 years agoMFC 367188: Use a dynamic buffer for the copy of a node's new value.
John Baldwin [Sat, 12 Dec 2020 17:11:22 +0000 (17:11 +0000)]
MFC 367188: Use a dynamic buffer for the copy of a node's new value.

This permits setting a node's value to a string longer than BUFSIZ.

3 years agoMFC 367578: Clear tp->tod in t4_pcb_detach().
John Baldwin [Sat, 12 Dec 2020 17:07:33 +0000 (17:07 +0000)]
MFC 367578: Clear tp->tod in t4_pcb_detach().

Otherwise, a socket can have a non-NULL tp->tod while TF_TOE is clear.
In particular, if a newly accepted socket falls back to non-TOE due to
an active open failure, the non-TOE socket will still have tp->tod set
even though TF_TOE is clear.

3 years agoMFC 366955: Handle CPL_RX_DATA on active TLS sockets.
John Baldwin [Sat, 12 Dec 2020 17:04:54 +0000 (17:04 +0000)]
MFC 366955: Handle CPL_RX_DATA on active TLS sockets.

In certain edge cases, the NIC might have only received a partial TLS
record which it needs to return to the driver.  For example, if the
local socket was closed while data was still in flight, a partial TLS
record might be pending when the connection is closed.  Receiving a
RST in the middle of a TLS record is another example.  When this
happens, the firmware returns the the partial TLS record as plain TCP
data via CPL_RX_DATA.  Handle these requests by returning an error to
OpenSSL (via so_error for KTLS or via an error TLS record header for
the older Chelsio OpenSSL interface).

3 years agoMFC 366854: Re-enable receive flow control for TOE TLS sockets.
John Baldwin [Sat, 12 Dec 2020 16:55:23 +0000 (16:55 +0000)]
MFC 366854: Re-enable receive flow control for TOE TLS sockets.

Flow control was disabled during initial TOE TLS development to
workaround a hang (and to match the Linux TOE TLS support for T6).
The rest of the TOE TLS code maintained credits as if flow control was
enabled which was inherited from before the workaround was added with
the exception that the receive window was allowed to go negative.
This negative receive window handling (rcv_over) was because I hadn't
realized the full implications of disabling flow control.

To clean this up, re-enable flow control on TOE TLS sockets.  The
existing TPF_FORCE_CREDITS workaround is sufficient for the original
hang.  Now that flow control is enabled, remove the rcv_over
workaround and instead assert that the receive window never goes
negative matching plain TCP TOE sockets.

3 years agoMFC r368020, r368025:
Kristof Provost [Fri, 11 Dec 2020 15:39:22 +0000 (15:39 +0000)]
MFC r368020, r368025:

if: Protect V_ifnet in vnet_if_return()

When we terminate a vnet (i.e. jail) we move interfaces back to their home
vnet. We need to protect our access to the V_ifnet CK_LIST.

We could enter NET_EPOCH, but if_detach_internal() (called from if_vmove())
waits for net epoch callback completion. That's not possible from NET_EPOCH.
Instead, we take the IFNET_WLOCK, build a list of the interfaces that need to
move and, once we've released the lock, move them back to their home vnet.

We cannot hold the IFNET_WLOCK() during if_vmove(), because that results in a
LOR between ifnet_sx, in_multi_sx and iflib ctx lock.

Separate out moving the ifp into or out of V_ifnet, so we can hold the lock as
we do the list manipulation, but do not hold it as we if_vmove().

if: Fix non-VIMAGE build

if_link_ifnet() and if_unlink_ifnet() are needed even when VIMAGE is not
enabled.

Sponsored by: Modirum MDPay

3 years agoMFC r368015:
Kristof Provost [Fri, 11 Dec 2020 14:11:41 +0000 (14:11 +0000)]
MFC r368015:

if: Remove ifnet_rwlock

It no longer serves any purpose, as evidenced by the fact that we never take it
without ifnet_sxlock.

This differs slightly from r368015 in that we keep the ifnet_rwlock instance
(but no longer take the lock) in case there are external users who still take
the lock.

Sponsored by: Modirum MDPay

3 years agoMFC 367576: Add C startup code tests for PIE binaries.
John Baldwin [Fri, 11 Dec 2020 01:06:49 +0000 (01:06 +0000)]
MFC 367576: Add C startup code tests for PIE binaries.

- Force dynamic to be a non-PIE binary.

- Add a dynamicpie test which uses a PIE binary.

3 years agoMFC 367575: Fix dso_handle_check for PIE executables.
John Baldwin [Fri, 11 Dec 2020 01:04:36 +0000 (01:04 +0000)]
MFC 367575: Fix dso_handle_check for PIE executables.

PIE executables use crtbeginS.o and have a non-NULL dso_handle as a
result.

3 years agoRegen
Konstantin Belousov [Fri, 11 Dec 2020 00:38:08 +0000 (00:38 +0000)]
Regen

3 years agoMFC r368343:
Konstantin Belousov [Fri, 11 Dec 2020 00:37:51 +0000 (00:37 +0000)]
MFC r368343:
Fix compat32 for ntp_adjtime(2).

3 years agoMFC r368342:
Konstantin Belousov [Fri, 11 Dec 2020 00:35:04 +0000 (00:35 +0000)]
MFC r368342:
Add kern_ntp_adjtime(9).

3 years agoMFC: r367997
Jung-uk Kim [Fri, 11 Dec 2020 00:30:41 +0000 (00:30 +0000)]
MFC: r367997

Do not truncate the last character from serial number.

strlcpy() requires one more byte for the NULL character.

3 years agoMFC r368108:
Mark Johnston [Fri, 11 Dec 2020 00:25:34 +0000 (00:25 +0000)]
MFC r368108:
arm: Correctly report the size of FPA registers to GDB

PR: 251022

3 years agoMFC 367574: Rename __JCR_LIST__ to __JCR_END__ in crtend.c.
John Baldwin [Thu, 10 Dec 2020 23:58:27 +0000 (23:58 +0000)]
MFC 367574: Rename __JCR_LIST__ to __JCR_END__ in crtend.c.

This is more consistent with the names used for .ctor and .dtor
symbols and better reflects __JCR_END__'s role.

3 years agoMFC 366584: Don't invoke semunload() if seminit() fails during MOD_LOAD.
John Baldwin [Thu, 10 Dec 2020 22:26:51 +0000 (22:26 +0000)]
MFC 366584: Don't invoke semunload() if seminit() fails during MOD_LOAD.

The module handler code invokes a MOD_UNLOAD event immediately if
MOD_LOAD fails.  The result was that if seminit() failed, semunload()
was invoked twice.  semunload() is not idempotent however and would
try to remove it's process_exit eventhandler twice resulting in a
panic.

3 years agoMFC 366897: Use a template assembly file to generate the embedded MFS.
John Baldwin [Thu, 10 Dec 2020 21:12:25 +0000 (21:12 +0000)]
MFC 366897: Use a template assembly file to generate the embedded MFS.

This uses the .incbin directive to pull in the MFS image contents.
Using assembly directly ensures that symbols can be defined with the
name and properties (such as .size) desired without having to rename
symbols, etc. via a second objcopy invocation.  Since it is compiled
by the C compiler driver, it also avoids the need for all of the
EMBEDFS* make variables.

3 years agoMFC 366494: Don't permit DRM buffer mappings to be upgraded to executable.
John Baldwin [Thu, 10 Dec 2020 20:44:05 +0000 (20:44 +0000)]
MFC 366494: Don't permit DRM buffer mappings to be upgraded to executable.

3 years agoMFC r363169 by allanjude: Actually install the new 221.backup-gpart periodic script
Gordon Bergling [Thu, 10 Dec 2020 13:32:51 +0000 (13:32 +0000)]
MFC r363169 by allanjude: Actually install the new 221.backup-gpart periodic script

PR: 86388
Submitted by: Rob Fairbanks <rob dot fx907 at gmail dot com>
Reported by: Michael Butler <imb at protected-networks dot net>
Sponsored by: Klara Inc.

3 years agoMFC r367436 and r367443 by rew:
Gordon Bergling [Thu, 10 Dec 2020 13:25:45 +0000 (13:25 +0000)]
MFC r367436 and r367443 by rew:

r367436
Add a periodic script to backup output generated from `zfs list`, `zfs get`,
`zpool list`, and `zpool get` commands.

Disabled by default.

r367443
Add a periodic script to backup output generated from `gmirror list`.

Disabled by default.

PR: 86388
Submitted by: Miroslav Lachman <000 dot fbsd at quip dot cz>
Reported by: Seklecki <Seklecki at FreeBSD dot org>
Reviewed by: allanjude, 0mp, gbe
Event: July 2020 Bugathon
Differential Revision: https://reviews.freebsd.org/D25638
Differential Revision: https://reviews.freebsd.org/D25631

3 years agoMFC r366615: man5: Fix a few typos spotted by igor
Gordon Bergling [Thu, 10 Dec 2020 13:08:06 +0000 (13:08 +0000)]
MFC r366615: man5: Fix a few typos spotted by igor

- fstab(5): conjuction -> conjunction
- mount.conf(5): repeated 'the'
- periodic.conf(5): Partion ->  Partition

3 years agoMFC r365508 (by rew):
Gordon Bergling [Thu, 10 Dec 2020 10:00:43 +0000 (10:00 +0000)]
MFC r365508 (by rew):

periodic.conf(5): don't truncate interface names reported by 420.status-network.

The daily periodic script, 420.status-network uses netstat(1) to report
interface status. By default, netstat(1) truncates interface names.

Add the '-W' flag (avoid truncating interface names) as the default for
'daily_status_network_netstat_flags' in periodic.conf(5).

The default 420.status-network command is now 'netstat -i -d -W -n'.

PR: 163572
Reported by: kes-kes@yandex.ru
Reviewed by: allanjude (mentor), bcr (manpages)
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D26023

3 years agoMFC r363114 (by allanjude)
Gordon Bergling [Thu, 10 Dec 2020 09:57:18 +0000 (09:57 +0000)]
MFC r363114 (by allanjude)

periodic.conf: correct capitailization in the middle of a sentence

Reported by: yuripv
Event: July 2020 Bugathon

3 years agoMFC r363110 (by allanjude):
Gordon Bergling [Thu, 10 Dec 2020 09:55:04 +0000 (09:55 +0000)]
MFC r363110 (by allanjude):

Add a periodic script to backup the partition table and boot code

Optionally, alert you if the contents change from the previous backup

PR: 86388
Submitted by: Rob Fairbanks <rob.fx907@gmail.com>, Miroslav Lachman <000.fbsd@quip.cz> (Original Version)
Relnotes: yes
Sponsored by: Klara Inc.
Event: July 2020 Bugathon
Differential Revision: https://reviews.freebsd.org/D25628

3 years agoMFC r362226 (by bapt): Fix typo in the documentation about the daily ntpd status
Gordon Bergling [Thu, 10 Dec 2020 09:51:50 +0000 (09:51 +0000)]
MFC r362226 (by bapt): Fix typo in the documentation about the daily ntpd status

PR: 245679
Submitted by: Taylor Stearns <t@tstearns.com>

3 years agoFix bug in ifconfig preventing proper VLAN creation.
Hans Petter Selasky [Thu, 10 Dec 2020 09:30:09 +0000 (09:30 +0000)]
Fix bug in ifconfig preventing proper VLAN creation.

Detection of VLAN interface type must happen before detection of
interface type by prefix. Else the following sequence of commands will
try to create a LAGG interface instead of a VLAN interface, which
accidentially worked previously, because the data pointed to by the
ifr_data pointer was not parsed by the VLAN create ioctl(2). This is a
regression after r368229, because the VLAN creation now parses the
ifr_data field.

How to reproduce:
# ifconfig lagg0 create
# ifconfig lagg0.256 create

This is a direct commit, until r366917, stacked VLANs has been MFC'ed.

Differential Revision: https://reviews.freebsd.org/D27521
Tested by: raul.munoz@custos.es
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC: r366318, r368072, r368080, r368097, r368387
Stefan Eßer [Thu, 10 Dec 2020 08:48:03 +0000 (08:48 +0000)]
MFC: r366318, r368072, r368080, r368097, r368387

Upgrade to version 3.2.3

3 years agoMFC r368294:
Cy Schubert [Thu, 10 Dec 2020 00:43:33 +0000 (00:43 +0000)]
MFC r368294:

Remove trailing whitespace.

3 years agoMFC of 368396 and 368425.
Kirk McKusick [Wed, 9 Dec 2020 22:37:23 +0000 (22:37 +0000)]
MFC of 368396 and 368425.

Document BA_CLRBUF flag.

Sponsored by: Netflix

3 years agoZFS: fix spurious EBUSY after zfs receive to an existing dataset
Alan Somers [Wed, 9 Dec 2020 20:06:37 +0000 (20:06 +0000)]
ZFS: fix spurious EBUSY after zfs receive to an existing dataset

If you do a "zfs send -p <src> | zfs receive -F <dst>" to an existing but
empty dataset, the receive will complete successfully but spuriously fail
with exit status 1 and the message "cannot mount 'pool/dataset': mountpoint
or dataset is busy".

The root cause is a merge error made in r344569 and MFCed in r345578, which
merged changes a10d50f999 and e63ac16d25 from ZoL.  The merge:
* failed to flip a == to an != like the upstream change did, and
* Left out one chunk

Direct commit to stable/12 because head has moved on to OpenZFS.

PR: 251694
Reviewed by: bapt
Sponsored by: Axcient

3 years agoMFC r368277:
Kristof Provost [Wed, 9 Dec 2020 17:17:45 +0000 (17:17 +0000)]
MFC r368277:

pf tests: Test case for bug #251414

Changing a table from not having counters to having counters (or vice versa)
may trigger panics.

PR: 251414

3 years agoMFC r367762
Peter Grehan [Wed, 9 Dec 2020 02:47:39 +0000 (02:47 +0000)]
MFC r367762
  Add legacy debug/test interfaces for kvm unit tests.

3 years agoMFC r368278:
Mark Johnston [Wed, 9 Dec 2020 00:56:38 +0000 (00:56 +0000)]
MFC r368278:
rtsold: Fix bugs reported by Coverity

3 years agoMFC r368276:
Mark Johnston [Wed, 9 Dec 2020 00:56:14 +0000 (00:56 +0000)]
MFC r368276:
pf: Fix table entry counter toggling

PR: 251414

3 years agoMFC r368397: Add deprecation notice to mn(4)
Ed Maste [Wed, 9 Dec 2020 00:28:27 +0000 (00:28 +0000)]
MFC r368397: Add deprecation notice to mn(4)

Sync serial (T1/E1) interfaces are largely irrelevant today and phk
confirms this driver is unnecessary in review D23928.

This leaves ce(4) and cp(4) in the tree.  They're likely not relevant
either, but glebius contacted the manufacturer and those devices are
still available for purchase.  At glebius' suggestion leave them in
the tree as long as they do not impose a maintenace burden.

[Build fix from hps included in MFC]

Sponsored by: The FreeBSD Foundation

3 years agoMFC: r368268
Rick Macklem [Tue, 8 Dec 2020 22:37:30 +0000 (22:37 +0000)]
MFC: r368268
Improve man page for AmazonEFS mounts.

PR#250770 was actually just a misunderstanding of what
NFS mount options are needed for AmazonEFS mounts.
This patch attempts to clarify the manpage to clarify this.

This is a content change.

PR: 250770

3 years agoMFC r368447: OpenSSL: address CVE-2020-1971
Ed Maste [Tue, 8 Dec 2020 18:28:49 +0000 (18:28 +0000)]
MFC r368447: OpenSSL: address CVE-2020-1971

OpenSSL commit 3db2c9f3:
Complain if we are attempting to encode with an invalid ASN.1 template

OpenSSL commit 43a7033:
Check that multi-strings/CHOICE types don't use implicit tagging

OpenSSL commit f960d812:
Correctly compare EdiPartyName in GENERAL_NAME_cmp()

Obtained from: OpenSSL 3db2c9f343a7033f960d812
Security: CVE-2020-1971

3 years agoMFC r362147:
Yuri Pankov [Tue, 8 Dec 2020 08:20:30 +0000 (08:20 +0000)]
MFC r362147:

awk(1): use -version instead of -V

-V is OpenBSD specific, use -version instead.

While here, fix issue reported by mandoc lint and drop nonexistent
script(7) reference.

PR: 247004

3 years agoMFC r340354:
Yuri Pankov [Tue, 8 Dec 2020 07:47:29 +0000 (07:47 +0000)]
MFC r340354:

Use blank am_pm and t_fmt_ampm for de_AT and de_DE locales as apparently
they use 24-hour clock notation.  The visible change is that w(1) now
uses 24-hour clock format as it checks for t_fmt_ampm presence.

PR: 231771
Submitted by: Christoph Schönweiler <public2016@hauptsignal.at>

3 years agoMFC r368265:
Konstantin Belousov [Tue, 8 Dec 2020 01:47:59 +0000 (01:47 +0000)]
MFC r368265:
lio_listio(2): send signal even if number of jobs is zero.

3 years agoMFC r368264:
Konstantin Belousov [Tue, 8 Dec 2020 01:46:44 +0000 (01:46 +0000)]
MFC r368264:
vfs_aio.c: style.

3 years agoMFC r368262:
Konstantin Belousov [Tue, 8 Dec 2020 01:45:36 +0000 (01:45 +0000)]
MFC r368262:
vfs_aio.c: correct comment.

3 years agoMFC r368260:
Konstantin Belousov [Tue, 8 Dec 2020 01:44:16 +0000 (01:44 +0000)]
MFC r368260:
rtld: bump r_debug.r_version to 1 from current 0.
Add r_ldbase.

3 years agoMFC r367985: Remove unneeded locking around xpt_bus_[de]register().
Alexander Motin [Tue, 8 Dec 2020 00:58:02 +0000 (00:58 +0000)]
MFC r367985: Remove unneeded locking around xpt_bus_[de]register().

3 years agoMFC r350224 by sobomax:
Gordon Bergling [Mon, 7 Dec 2020 20:36:58 +0000 (20:36 +0000)]
MFC r350224 by sobomax:

Allow "update" option to be used in the fstab(5). Document possible use case.

Approved by: sobomax
Differential Revision: https://reviews.freebsd.org/D18586

3 years agoMFC r368191:
Konstantin Belousov [Mon, 7 Dec 2020 01:05:39 +0000 (01:05 +0000)]
MFC r368191:
ffs: do not read full direct blocks if they are going to be overwritten.

3 years agoMFC r368190:
Konstantin Belousov [Mon, 7 Dec 2020 01:02:20 +0000 (01:02 +0000)]
MFC r368190:
Ensure that threading library is initialized in pthread_mutex_init().

3 years agoMFC r364027 by arichardson: Fix linker error in libuutil with recent LLVM
Eugene Grosbein [Sun, 6 Dec 2020 16:22:26 +0000 (16:22 +0000)]
MFC r364027 by arichardson: Fix linker error in libuutil with recent LLVM

This also fixes nanobsd-style build (cross-compiling).
Original commit log:

  Not marking the function as static can result in a linker error:
  undefined reference to __assfail [--no-allow-shlib-undefined]
  I noticed this error after updating our CHERI LLVM to the latest upstream
  LLVM HEAD revision.

  This change effectively reverts r329984 and marks dmu_buf_init_user as
  static (which keeps the GCC build happy).

Reviewed By: #zfs, asomers, freqlabs, mav
Differential Revision: https://reviews.freebsd.org/D25663

3 years agoMFC r367901 and r367904
Gordon Bergling [Sun, 6 Dec 2020 08:01:27 +0000 (08:01 +0000)]
MFC r367901 and r367904

r367901: hostapd.conf(5): Fix a mandoc warning
-new sentence, new line

r367904: hostapd.conf(5): Add missing 'l'
In r367901 I accidentally deleted the 'l' while fixing a few
mandoc erros.
Spotted by: Yuri Pankov

3 years agoMFC r367889: camcontrol(8): Fix some warnings spotted by mandoc
Gordon Bergling [Sun, 6 Dec 2020 07:57:56 +0000 (07:57 +0000)]
MFC r367889: camcontrol(8): Fix some warnings spotted by mandoc

- skipping paragraph macro: Pp before Bl

3 years agoMFC r366662 (by imp), r367897
Gordon Bergling [Sun, 6 Dec 2020 07:55:12 +0000 (07:55 +0000)]
MFC r366662 (by imp), r367897

r366662: devmatch: First appeared in 12.0
Document that devmatch first appeared in FreeBSD 12.0. Also can't -> can not. But
it doesn't help the sentence much.

r367897: devmatch(8): Fix section ordering
- sections out of conventional order: Sh HISTORY

3 years agoMFC r366572: Fix a few mandoc issues
Gordon Bergling [Sun, 6 Dec 2020 07:50:15 +0000 (07:50 +0000)]
MFC r366572: Fix a few mandoc issues

- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order
- normalizing date format
- AUTHORS section without An macro

3 years agoMFC r344013 and r344015 (by cracauer)
Gordon Bergling [Sun, 6 Dec 2020 07:47:10 +0000 (07:47 +0000)]
MFC r344013 and r344015 (by cracauer)

r344013:
Clarify NFSv4 /etc/exports semantics, with working example.
The existing wording has been confusing users for years.

r344015:
Bump .Dd for today's edit.

Thank you Enji Cooper

3 years agoMFC r344922 (by wosch): explain ``fsck -f'' more in detail
Gordon Bergling [Sun, 6 Dec 2020 07:38:58 +0000 (07:38 +0000)]
MFC r344922 (by wosch): explain ``fsck -f'' more in detail

PR: 223491
Approved by: mckusick, 0mp, imp
Differential Revision: https://reviews.freebsd.org/D19437

3 years agoMFC r367898, r367899
Gordon Bergling [Sun, 6 Dec 2020 07:22:38 +0000 (07:22 +0000)]
MFC r367898, r367899

r367898: iscsi.conf(5): Fix a mandoc warning
- new sentence, new line

r367899: snmp_wlan(3): Fix mandoc warnings
- new sentence, new line

3 years agoMFC r367900, r367902, r367903
Gordon Bergling [Sun, 6 Dec 2020 07:09:34 +0000 (07:09 +0000)]
MFC r367900, r367902, r367903

r367900: syslog.conf(5): Fix a few mandoc warnings
- new sentence, new line
- skipping paragraph macro: Pp at the end of Sh

r367902: crashinfo(8): Fix a few mandoc warnings
- new sentence, new line

r367903: moused(8): Fix a few mandoc warnings
- new sentence, new line

3 years agoMFC r368125:
Konstantin Belousov [Sat, 5 Dec 2020 09:08:26 +0000 (09:08 +0000)]
MFC r368125:
libc: Add pthread_attr_get_np(3) stub, reporting ESRCH.

PR: 251112

3 years agoRevert r366857.
Cy Schubert [Fri, 4 Dec 2020 19:35:43 +0000 (19:35 +0000)]
Revert r366857.

r366857 created a number of problems, tearing down interfaces too
early in shutdown. This resulted in:

- hung ssh sessions when shutting down or rebooting remotely using
  shutdown (I've used exec shutdown, for years, as apposed to simply
  shutdown).

- NFS mounted filesystems "disappear" prior to unmount.

- dhclient attached to a VLAN on an interface who's parent interface
  has already shut down prints errors.

The path forward is to teach lagg(4) and vlan(4) about WOL.

PR: 251531, 251540
PR: 158734, 109980 are broken again
Reported by: jhb, emaste, jtl, Helge Oldach<freebsd_oldach.net>
Martin Birgmeier <d8zNeCFG_aon.at>
Discussion at: https://reviews.freebsd.org/D27459

3 years agoFix msdosfs suspension.
Konstantin Belousov [Fri, 4 Dec 2020 16:05:31 +0000 (16:05 +0000)]
Fix msdosfs suspension.

Unlike HEAD, stable/12 still uses the check for vfs_susp_clean != NULL
as indicator that fs supports suspension.  Satisfy the requirement by
providing dummy msdosfs_susp_clean method implementation.

This is direct commit to stable/12.

Reported by: Özkan KIRIK <ozkan.kirik@gmail.com>

3 years agoMFC r368111: fix casper initialization for setting scripts.
Hajimu UMEMOTO [Fri, 4 Dec 2020 14:09:12 +0000 (14:09 +0000)]
MFC r368111: fix casper initialization for setting scripts.

3 years agoMFC r367742-r367743: _umtx_op: documentation and compat32 fix
Kyle Evans [Fri, 4 Dec 2020 02:37:33 +0000 (02:37 +0000)]
MFC r367742-r367743: _umtx_op: documentation and compat32 fix

r367742:
_umtx_op: document UMTX_OP_SEM2_WAIT copyout behavior

This clever technique to get a time remaining back was added to support
sem_clockwait_np.

Reviewed by: kib, vangyzen
Differential Revision: https://reviews.freebsd.org/D27160

r367743:
_umtx_op: fix a compat32 bug in UMTX_OP_NWAKE_PRIVATE

Specifically, if we're waking up some value n > BATCH_SIZE, then the
copyin(9) is wrong on the second iteration due to upp being the wrong type.
upp is currently a uint32_t**, so upp + pos advances it by twice as many
elements as it should (host pointer size vs. compat32 pointer size).

Fix it by just making upp a uint32_t*; it's still technically a double
pointer, but the distinction doesn't matter all that much here since we're
just doing arithmetic on it.

Add a test case that demonstrates the problem, placed with the libthr tests
since one messing with _umtx_op should be running these tests. Running under
compat32, the new test case will hang as threads after the first 128 get
missed in the wake. it's not immediately clear how to hit it in practice,
since pthread_cond_broadcast() uses a smaller (sleepq batch?) size observed
to be around ~50 -- I did not spend much time digging into it.

The uintptr_t change makes no functional difference, but i've tossed it in
since it's more accurate (semantically).

3 years agoMFC r368009-r368010: kern: cpuset: minor improvements
Kyle Evans [Fri, 4 Dec 2020 02:28:45 +0000 (02:28 +0000)]
MFC r368009-r368010: kern: cpuset: minor improvements

r368009:
kern: cpuset: allow cpuset_create() to take an allocated *setp

Currently, it must always allocate a new set to be used for passing to
_cpuset_create, but it doesn't have to. This is purely kern_cpuset.c
internal and it's sparsely used, so just change it to use *setp if it's
not-NULL and modify the two consumers to pass in the address of a NULL
cpuset.

This paves the way for consumers that want the unr allocation without the
possibility of sleeping as long as they've done their due diligence to
ensure that the mask will properly apply atop the supplied parent
(i.e. avoiding the free_unr() in the last failure path).

r368010:
kern: cpuset: rename _cpuset_create() to cpuset_init()

cpuset_init() is better descriptor for what the function actually does. The
name was previously taken by a sysinit that setup cpuset_zero's mask
from all_cpus, it was removed in r331698 before stable/12 branched.

A comment referencing the removed sysinit has now also been removed, since
the setup previously done was moved into cpuset_thread0().

3 years agoMFC r368006: kern: never restart syscalls calling closefp(), e.g. close(2)
Kyle Evans [Fri, 4 Dec 2020 02:20:41 +0000 (02:20 +0000)]
MFC r368006: kern: never restart syscalls calling closefp(), e.g. close(2)

All paths leading into closefp() will either replace or remove the fd from
the filedesc table, and closefp() will call fo_close methods that can and do
currently sleep without regard for the possibility of an ERESTART. This can
be dangerous in multithreaded applications as another thread could have
opened another file in its place that is subsequently operated on upon
restart.

The following are seemingly the only ones that will pass back ERESTART
in-tree:
- sockets (SO_LINGER)
- fusefs
- nfsclient

3 years agoMFC r367944: cpuset_setproc: use the appropriate parent for new anon. sets
Kyle Evans [Fri, 4 Dec 2020 02:19:45 +0000 (02:19 +0000)]
MFC r367944: cpuset_setproc: use the appropriate parent for new anon. sets

As far as I can tell, this has been the case since initially committed in
2008.  cpuset_setproc is the executor of cpuset reassignment; note this
excerpt from the description:

* 1) Set is non-null.  This reparents all anonymous sets to the provided
*    set and replaces all non-anonymous td_cpusets with the provided set.

However, reviewing cpuset_setproc_setthread() for some jail related work
unearthed the error: if tdset was not anonymous, we were replacing it with
`set`. If it was anonymous, then we'd rebase it onto `set` (i.e. copy the
thread's mask over and AND it with `set`) but give the new anonymous set
the original tdset as the parent (i.e. the base of the set we're supposed to
be leaving behind).

The primary visible consequences were that:

1.) cpuset_getid() following such assignment returns the wrong result, the
    setid that we left behind rather than the one we joined.
2.) When a process attached to the jail, the base set of any anonymous
    threads was a set outside of the jail.

This was initially bundled in D27298, but it's a minor fix that's fairly
easy to verify the correctness of.

A test is included in D27307 ("badparent"), which demonstrates the issue
with, effectively:

osetid = cpuset_getid()
newsetid = cpuset()
cpuset_setaffinity(thread)
cpuset_setid(osetid)
cpuset_getid(thread) -> observe that it matches newsetid instead of osetid.

3 years agoMFC r368116: kern: cpuset: drop the lock to allocate domainsets
Kyle Evans [Fri, 4 Dec 2020 02:18:40 +0000 (02:18 +0000)]
MFC r368116: kern: cpuset: drop the lock to allocate domainsets

Restructure the loop a little bit to make it a little more clear how it
really operates: we never allocate any domains at the beginning of the first
iteration, and it will run until we've satisfied the amount we need or we
encounter an error.

The lock is now taken outside of the loop to make stuff inside the loop
easier to evaluate w.r.t. locking.

This fixes it to not try and allocate any domains for the freelist under the
spinlock, which would have happened before if we needed any new domains.

3 years agoMFC 350813: tools/tools/crypto: cryptokeytest: Fix build with newer OpenSSL
John Baldwin [Fri, 4 Dec 2020 01:11:09 +0000 (01:11 +0000)]
MFC 350813: tools/tools/crypto: cryptokeytest: Fix build with newer OpenSSL

Also, drag into this decade.

3 years agoMFC 366844: Mark asymmetric cryptography via OCF deprecated for 14.0.
John Baldwin [Fri, 4 Dec 2020 01:09:51 +0000 (01:09 +0000)]
MFC 366844: Mark asymmetric cryptography via OCF deprecated for 14.0.

Only one MIPS-specific driver implements support for one of the
asymmetric operations.  There are no in-kernel users besides
/dev/crypto.  The only known user of the /dev/crypto interface was the
engine in OpenSSL releases before 1.1.0.  1.1.0 includes a rewritten
engine that does not use the asymmetric operations due to lack of
documentation.

3 years agoMFC r367895:
Konstantin Belousov [Fri, 4 Dec 2020 00:48:11 +0000 (00:48 +0000)]
MFC r367895:
msdosfs: suspend around unmount or remount rw->ro.

3 years agoMFC r368193:
Mark Johnston [Thu, 3 Dec 2020 15:55:07 +0000 (15:55 +0000)]
MFC r368193:
qat: Fix firmware module autoloading

3 years agoMFC r368194:
Mark Johnston [Thu, 3 Dec 2020 15:54:41 +0000 (15:54 +0000)]
MFC r368194:
qat: Initialize the crypto device ID to -1 instead of 0

3 years agoMFC r367734:
Mitchell Horne [Thu, 3 Dec 2020 14:04:42 +0000 (14:04 +0000)]
MFC r367734:
bsdiff: fix off-by-one error