]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

3 years agoMFC r368058:
Hans Petter Selasky [Thu, 3 Dec 2020 10:32:54 +0000 (10:32 +0000)]
MFC r368058:
Ensure consistent error messages from ifconfig(8).

If multiple threads are invoking "ifconfig XXX create" a race may occur
which can lead to two different error messages for the same error.

a) ifconfig: SIOCIFCREATE2: File exists
b) ifconfig: interface XXX already exists

This patch ensures ifconfig prints the same error code
for the same case.

Reviewed by: imp@ and kib@
Differential Revision: https://reviews.freebsd.org/D27380
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366286:
Cy Schubert [Thu, 3 Dec 2020 05:56:42 +0000 (05:56 +0000)]
MFC r366286:

ipfilter getifname ifdef cleanup.

3 years agoMFC r367812:
Li-Wen Hsu [Thu, 3 Dec 2020 02:21:48 +0000 (02:21 +0000)]
MFC r367812:

ipheth(4): Fix for iOS 14

Fix USB tethering for iOS 14.

Inspired by: https://github.com/libimobiledevice/libimobiledevice/issues/1038

PR: 249979
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D27250

3 years agoMFC 355686: Fix a mismerge in r355683 and remove the local gdb_port from main.
John Baldwin [Wed, 2 Dec 2020 23:16:24 +0000 (23:16 +0000)]
MFC 355686: Fix a mismerge in r355683 and remove the local gdb_port from main.

PR: 251501
Reported by: Yuichiro NAITO <naito.yuichiro@gmail.com>

3 years agoMFC r353130:
Yuri Pankov [Wed, 2 Dec 2020 22:44:40 +0000 (22:44 +0000)]
MFC r353130:

Mark "private use area" characters as printable.

At least some of the characters in E000-F8FF range are used by Powerline
fonts, and having no attributes for these ranges in UnicodeData.txt
other than "Other, Private Use" it should be safe to mark all of them as
printable.  Some actually were before r340491, so this fixes the
regression introduced there as well.

PR: 240911
Reviewed by: bapt
Tested by: Daniel Ponte <amigan@gmail.com>
Differential Revision: https://reviews.freebsd.org/D21850

3 years agoMFC r367809:
Dimitry Andric [Wed, 2 Dec 2020 21:44:41 +0000 (21:44 +0000)]
MFC r367809:

When elftoolchain's objcopy (or strip) is rewriting a file in-place,
make it create the temporary file in the same directory as the source
file by default, instead of always using $TMPDIR or /tmp. If creating
that file fails because the directory is not writable, also fallback to
$TMPDIR or /tmp.

This has also been submitted upstream as:
https://sourceforge.net/p/elftoolchain/tickets/597/

Reported by: cem
PR: 250872

3 years agoMFC r367304:
Dimitry Andric [Wed, 2 Dec 2020 21:39:54 +0000 (21:39 +0000)]
MFC r367304:

Add WITH_LLVM_CXXFILT option to install llvm-cxxfilt as c++filt

Since elftoolchain's cxxfilt is rather far behind on features, and we
ran into several bugs, add an option to use llvm-cxxfilt as an drop-in
replacement.

It supports the same options as elftoolchain cxxfilt, though it doesn't
have support for old ARM (C++ Annotated Reference Manual, not the CPU)
and GNU v2 manglings. But these are irrelevant in 2020.

Note: as we already compile the required libraries as part of libllvm,
this will not add any significant build time either.

PR: 250702
Reviewed by: emaste, yuri
Differential Revision: https://reviews.freebsd.org/D27071

MFC r367712:

Ensure make delete-old does not unlink the llvm-cxxfilt and its manpage,
after r367304 and r367324, when WITH_LLVM_CXXFILT is enabled.

Noticed by: "Herbert J. Skuhra" <herbert@gojira.at>

3 years agoMFC r368023:
Konstantin Belousov [Wed, 2 Dec 2020 00:45:35 +0000 (00:45 +0000)]
MFC r368023:
Use designated initializers for libc pthread stubs' jump table.

3 years agoMFC r368248:
Mark Johnston [Tue, 1 Dec 2020 19:35:48 +0000 (19:35 +0000)]
MFC r368248:
rtsold: Fix multiple buffer overflows

Approved by: so
Security: CVE-2020-25577

3 years agoiconv(1): Add EXAMPLE
Fernando Apesteguía [Tue, 1 Dec 2020 18:13:57 +0000 (18:13 +0000)]
iconv(1): Add EXAMPLE

Just a small example to show simple usage.

Approved by:    manpages (0mp@)
Differential Revision: https://reviews.freebsd.org/D27385

3 years agoMFC r367990:
Kristof Provost [Tue, 1 Dec 2020 16:02:52 +0000 (16:02 +0000)]
MFC r367990:

pf tests: provoke tag hashing panic

Attempt to provoke the panic fixed in r367987.

3 years agoFix error merging r354116 from OpenZFS
Alan Somers [Tue, 1 Dec 2020 15:15:18 +0000 (15:15 +0000)]
Fix error merging r354116 from OpenZFS

When we merged 4c0883fb4af0d5565459099b98fcf90ecbfa1ca1 from OpenZFS (svn
r354116), there were some merge conflicts.  One of those was resolved
incorrectly, causing "zfs receive" to fail to delete snapshots that a "zfs
send -R" stream has deleted.

This change corrects that merge conflict, and also reduces some harmless
diffs vis-a-vis OpenZFS that were also introduced by the same revision.
Direct commit to stable/12 because head has moved on to OpenZFS.

PR: 249438
Reported by: Dmitry Wagin <dmitry.wagin@ya.ru>
Reviewed by: mmacy
Sponsored by: Axcient

3 years agoMFC r367987:
Mark Johnston [Tue, 1 Dec 2020 15:11:16 +0000 (15:11 +0000)]
MFC r367987:
pf: Make tag hashing more robust

3 years agoMFC r367988:
Mark Johnston [Tue, 1 Dec 2020 15:09:02 +0000 (15:09 +0000)]
MFC r367988:
ping(8): Improve parameter validation

PR: 239974, 239977, 239978

3 years agoMFC r367989:
Mark Johnston [Tue, 1 Dec 2020 15:01:10 +0000 (15:01 +0000)]
MFC r367989:
ata(4): Release the ioport resource if device initialization fails

PR: 251346

3 years agoMFC r366933 and r366934:
Hans Petter Selasky [Tue, 1 Dec 2020 13:58:14 +0000 (13:58 +0000)]
MFC r366933 and r366934:
Add support for IP over infiniband, IPoIB, to lagg(4). Currently only
the failover protocol is supported due to limitations in the IPoIB
architecture. Refer to the lagg(4) manual page for how to configure
and use this new feature. A new network interface type,
IFT_INFINIBANDLAG, has been added, similar to the existing
IFT_IEEE8023ADLAG .

ifconfig(8) has been updated to accept a new laggtype argument when
creating lagg(4) network interfaces. This new argument is used to
distinguish between ethernet and infiniband type of lagg(4) network
interface. The laggtype argument is optional and defaults to
ethernet. The lagg(4) command line syntax is backwards compatible.

Differential Revision: https://reviews.freebsd.org/D26254
Reviewed by: melifaro@
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366931:
Hans Petter Selasky [Tue, 1 Dec 2020 13:47:16 +0000 (13:47 +0000)]
MFC r366931:
Implement mbuf hashing routines for IP over infiniband, IPoIB.
No functional change intended.

Differential Revision: https://reviews.freebsd.org/D26254
Reviewed by: melifaro@
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366930, r366936, r366993 and r366994:
Hans Petter Selasky [Tue, 1 Dec 2020 13:44:33 +0000 (13:44 +0000)]
MFC r366930, r366936, r366993 and r366994:
Factor out generic IP over infiniband, IPoIB, definitions and code
into net/if_infiniband.c and net/infiniband.h . No functional change
intended.

Differential Revision: https://reviews.freebsd.org/D26254
Reviewed by: melifaro@
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367719:
Hans Petter Selasky [Tue, 1 Dec 2020 13:09:04 +0000 (13:09 +0000)]
MFC r367719:
Make mlx5_cmd_exec_cb() a safe API in mlx5core.

APIs that have deferred callbacks should have some kind of cleanup
function that callers can use to fence the callbacks. Otherwise things
like module unloading can lead to dangling function pointers, or worse.

The IB MR code is the only place that calls this function and had a
really poor attempt at creating this fence. Provide a good version in
the core code as future patches will add more places that need this
fence.

Linux commit:
e355477ed9e4f401e3931043df97325d38552d54

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367718:
Hans Petter Selasky [Tue, 1 Dec 2020 13:06:26 +0000 (13:06 +0000)]
MFC r367718:
Report EQE data upon CQ completion in mlx5core.

Report EQE data upon CQ completion to let upper layers use this data.

Linux commit:
4e0e2ea1886afe8c001971ff767f6670312a9b04

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r357294:
Hans Petter Selasky [Tue, 1 Dec 2020 13:03:09 +0000 (13:03 +0000)]
MFC r357294:
Widen EPOCH(9) usage in mlx5en(4).

Make completion event path mostly lockless using EPOCH(9).

Implement a mechanism using EPOCH(9) which allows us to make
the callback path for completion events mostly lockless.

Simplify draining callback events using epoch_wait().

While at it make sure all receive completion callbacks are
covered by the network EPOCH(9), because this is required
when calling if_input() and ether_input() after r357012.

Sponsored by: Mellanox Technologies

3 years agoMFC r367717:
Hans Petter Selasky [Tue, 1 Dec 2020 12:51:35 +0000 (12:51 +0000)]
MFC r367717:
Enhance the mlx5_core_create_cq() function in mlx5core.

Enhance mlx5_core_create_cq() to get the command out buffer from the
callers to let them use the output.

Linux commit:
38164b771947be9baf06e78ffdfb650f8f3e908e

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367716:
Hans Petter Selasky [Tue, 1 Dec 2020 12:45:07 +0000 (12:45 +0000)]
MFC r367716:
Use mlx5core to create/destroy all Dynamically Connected Targets, DCTs.

To prevent a hardware memory leak when a DEVX DCT object is destroyed
without calling drain DCT before, (e.g. under cleanup flow), need to
manage its creation and destruction via mlx5 core.

Linux commit:
c5ae1954c47d3fd8815bd5a592aba18702c93f33

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367715:
Hans Petter Selasky [Tue, 1 Dec 2020 12:43:22 +0000 (12:43 +0000)]
MFC r367715:
Fix error handling order in create_kernel_qp in mlx5ib.

Make sure order of cleanup is exactly the opposite of initialization.

Linux commit:
f4044dac63e952ac1137b6df02b233d37696e2f5

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367555:
Hans Petter Selasky [Tue, 1 Dec 2020 12:41:25 +0000 (12:41 +0000)]
MFC r367555:
Include GID type when deleting GIDs from HW table under RoCE in mlx4ib.
Refer to the Linux commit mentioned below for a more detailed description.

Linux commit:
a18177925c252da7801149abe217c05b80884798

Requested by: Isilon
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367622:
Hans Petter Selasky [Tue, 1 Dec 2020 12:38:28 +0000 (12:38 +0000)]
MFC r367622:
Add more USB quirks.

PR: 230038
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367615:
Hans Petter Selasky [Tue, 1 Dec 2020 12:36:21 +0000 (12:36 +0000)]
MFC r367615:
Add a tunable sysctl, hw.usb.uaudio.handle_hid, to allow disabling the
the HID volume keys support in the USB audio driver.

While at it re-organize the USB audio sysctls a bit.

Differential Revision: https://reviews.freebsd.org/D27180
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367614:
Hans Petter Selasky [Tue, 1 Dec 2020 12:32:35 +0000 (12:32 +0000)]
MFC r367614:
When doing a USB alternate setting on an USB interface we need to
re-configure the XHCI endpoint context.

Differential Revision: https://reviews.freebsd.org/D27174
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367757, r367756, r367759, r367769:
Mateusz Piotrowski [Tue, 1 Dec 2020 09:24:15 +0000 (09:24 +0000)]
MFC r367757, r367756, r367759, r367769:

Improve readability of the lists of options

- Sort options alphabetically
- Add missing arguments (e.g., "list" to -a)
- Adjust the width of Bl

Clean up the synopsis section & fix mandoc warnings

The synopsis section had two very similar entries. The flags documented by
the first one were a strict subset of the second one. Let's just keep only
the second entry for simplicity.

Add an example for the -s flag

Partially revert r367756 (chpass(1) synopsis changes)

Let's have two entries in the synopsis:
- chpass now lists options which can be used for non-NIS-specific
  functionalities.
- ypchpass additionally lists the NIS-specific flags.

Technically, it is an artificial distinction, as chpass and ypchpass behave
identically. Nevertheless, it might help navigating the synopsis section.

Reviewed by: imp

3 years agoMFC r366285:
Cy Schubert [Mon, 30 Nov 2020 22:35:30 +0000 (22:35 +0000)]
MFC r366285:

Resurrect ipfilter's getifname, replacing the stub with the real
function.

3 years agoMFC r367530:
Michael Tuexen [Mon, 30 Nov 2020 09:45:44 +0000 (09:45 +0000)]
MFC r367530:
RFC 7323 specifies that:
* TCP segments without timestamps should be dropped when support for
  the timestamp option has been negotiated.
* TCP segments with timestamps should be processed normally if support
  for the timestamp option has not been negotiated.
This patch enforces the above.
Manually resolved merge conflicts.

MFC 367891:
Fix an issue I introuced in r367530: tcp_twcheck() can be called
with to == NULL for SYN segments. So don't assume tp != NULL.
Thanks to jhb@ for reporting and suggesting a fix.

MFC r367946:
Fix two occurences of a typo in a comment introduced in r367530.
Thanks to lstewart@ for reporting them.

PR: 250499
Reviewed by: gnn, rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D27148

3 years agoMFC r367520:
Michael Tuexen [Mon, 30 Nov 2020 09:22:33 +0000 (09:22 +0000)]
MFC r367520:

Fix a potential use-after-free bug introduced in
https://svnweb.freebsd.org/changeset/base/363046

Thanks to Taylor Brandstetter for finding this issue using fuzz testing
and reporting it in https://github.com/sctplab/usrsctp/issues/547

3 years agoMFC r367464:
Michael Tuexen [Mon, 30 Nov 2020 09:21:01 +0000 (09:21 +0000)]
MFC r367464:
The ioctl() calls using FIONREAD, FIONWRITE, FIONSPACE, and SIOCATMARK
access the socket send or receive buffer. This is not possible for
listening sockets since r319722.
Because send()/recv() calls fail on listening sockets, fail also ioctl()
indicating EINVAL.

PR: 250366
Reported by: Yong-Hao Zou
Reviewed by: glebius, rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D26897

3 years agoMFC r366750:
Michael Tuexen [Mon, 30 Nov 2020 09:18:13 +0000 (09:18 +0000)]
MFC r366750:

Improve the handling of cookie life times.
The staleness reported in an error cause is in us, not ms.
Enforce limits on the life time via sysct; and socket options
consistently. Update the description of the sysctl variable to
use the right unit. Also do some minor cleanups.
This also fixes an interger overflow issue if the peer can
modify the cookie. This was reported by Felix Weinrank by fuzz testing
the userland stack and in
https://oss-fuzz.com/testcase-detail/4800394024452096

3 years agoMFC r366517:
Michael Tuexen [Mon, 30 Nov 2020 09:16:51 +0000 (09:16 +0000)]
MFC r366517:

Minor cleanups.

3 years agoMFC r366489:
Michael Tuexen [Mon, 30 Nov 2020 09:15:30 +0000 (09:15 +0000)]
MFC r366489:

Reset delayed SACK state when restarting an SCTP association.

3 years agoMFC r366483:
Michael Tuexen [Mon, 30 Nov 2020 09:14:01 +0000 (09:14 +0000)]
MFC r366483:

Ensure variables are initialized before used.

3 years agoMFC r366482:
Michael Tuexen [Mon, 30 Nov 2020 09:12:45 +0000 (09:12 +0000)]
MFC r366482:

Remove dead stores reported by clang static code analysis

3 years agoMFC r366480:
Michael Tuexen [Mon, 30 Nov 2020 09:11:24 +0000 (09:11 +0000)]
MFC r366480:

Cleanup, no functional change intended.

3 years agoMFC 366474:
Michael Tuexen [Mon, 30 Nov 2020 09:10:05 +0000 (09:10 +0000)]
MFC 366474:

Whitespace changes.

3 years agoMFC r366426:
Michael Tuexen [Mon, 30 Nov 2020 09:08:51 +0000 (09:08 +0000)]
MFC r366426:

Use __func__ instead of __FUNCTION__ for consistency.

3 years agoMFC r366425:
Michael Tuexen [Mon, 30 Nov 2020 09:07:21 +0000 (09:07 +0000)]
MFC r366425:

Cleanup, no functional change intended.

3 years agoFix startup of gssd when /usr is a separately mounted local file system.
Rick Macklem [Sun, 29 Nov 2020 23:37:18 +0000 (23:37 +0000)]
Fix startup of gssd when /usr is a separately mounted local file system.

meowthink@gmail.com reported that the gssd daemon was not
starting, because /etc/rc.d/gssd was executed before his local
/usr file system was mounted.
He fixed the problem by adding mountcritlocal to the REQUIRED
line.

This fix seems safe and works for a separately mounted /usr file
system on a local disk.
The case of a separately mounted remote /usr file system (such as
NFS) is still broken, but there is no obvious solution for that.
Adding mountcritremote would fix the problem, but it would
cause a POLA violation, because all kerberized NFS mounts
in /etc/fstab would need the "late" option specified to work.

3 years agoMFC: r367423
Rick Macklem [Sun, 29 Nov 2020 23:23:08 +0000 (23:23 +0000)]
MFC: r367423
Add support for the new mountd -R option.

r376026 added a new "-R" option to mountd, which tells it to
not support the Mount protocol (not used by NFSv4) and not
register with rpcbind.
Rpcbind is considered a security issue by some sites now.

This patch adds a new yes/no variable called nfsv4_server_only.
When that is set, make vfs.nfsd.server_min_vers=4 and set "=R"
for mountd.
Setting vfs.nfsd.server_min_vers=4 tells nfsd to not register with rpcbind.
While here, add a check for "load_kld nfsd" failing to nfsd.

3 years agoMFC r368084:
Mateusz Piotrowski [Sun, 29 Nov 2020 14:20:42 +0000 (14:20 +0000)]
MFC r368084:

libprocstat.3: Correct two occurrences of kvm_getprocs to procstat_getprocs

Submitted by: otis_sk.freebsd.org
Reviewed by: markj

3 years agoMFC r368083:
Konstantin Belousov [Sun, 29 Nov 2020 10:36:56 +0000 (10:36 +0000)]
MFC r368083:
Remove stray semicolumn.

3 years agoMFC r368082:
Konstantin Belousov [Sun, 29 Nov 2020 10:34:49 +0000 (10:34 +0000)]
MFC r368082:
Style.

3 years agoMFC: r367027
Rick Macklem [Sun, 29 Nov 2020 01:32:53 +0000 (01:32 +0000)]
MFC: r367027
Update man page for -R option added by r376026.

This is a content change.

3 years agoMFC: r367026
Rick Macklem [Sun, 29 Nov 2020 01:22:30 +0000 (01:22 +0000)]
MFC: r367026
Add "-R" option to tell mountd to not register with rpcbind.

rpcbind is now considered a security risk for some sites.
Since an NFSv4 only NFS server does not need rpcbind,
it makes sense to have an option that implements this.

This patch adds a "-R" option that disables the Mount
protocol (not used by NFSv4) and does not register
with rpcbind.

Changes are required to /etc/rc.d/mountd and /etc/rc.d/nfsd.
Those will be in a separate commit.

3 years agoMFC r368047
Peter Grehan [Sun, 29 Nov 2020 00:54:13 +0000 (00:54 +0000)]
MFC r368047
 Remove manual instruction encodings for VMLOAD, VMRUN, and VMSAVE.

3 years agoMFC r367094:
Cy Schubert [Sat, 28 Nov 2020 18:09:16 +0000 (18:09 +0000)]
MFC r367094:

MFV r367082:

Update unbound 1.11.0 --> 1.12.0.

3 years agoMFC r367923:
Konstantin Belousov [Sat, 28 Nov 2020 10:38:00 +0000 (10:38 +0000)]
MFC r367923:
Stop using eventhandlers for itimers subsystem exec and exit hooks.

3 years agoMFC r367918, r367919:
Konstantin Belousov [Sat, 28 Nov 2020 10:36:19 +0000 (10:36 +0000)]
MFC r367918, r367919:
Stop using eventhandler to invoke umtx_exec hook.

3 years agoMFC r366700:
Michal Meloun [Sat, 28 Nov 2020 09:06:51 +0000 (09:06 +0000)]
MFC r366700:

  Add 'netserver' command to EFI loader.

3 years agoMFC r367862: Microoptimize cam_num_doneqs math in xpt_done().
Alexander Motin [Fri, 27 Nov 2020 13:25:12 +0000 (13:25 +0000)]
MFC r367862: Microoptimize cam_num_doneqs math in xpt_done().

3 years agoMFC r367892:
Konstantin Belousov [Fri, 27 Nov 2020 11:51:07 +0000 (11:51 +0000)]
MFC r367892:
Unlock channels when any of them are locked, when returning for non-busy state.

3 years agoMFC r367890:
Konstantin Belousov [Fri, 27 Nov 2020 11:48:33 +0000 (11:48 +0000)]
MFC r367890:
msdosfs: Add trivial support for suspension.

3 years agoMFC r367869:
Kristof Provost [Fri, 27 Nov 2020 11:12:59 +0000 (11:12 +0000)]
MFC r367869:

pf tests: Basic source tracking test