]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoTemporarily skip flakey bin.sh.execution.functional_test.bg12 in CI
Li-Wen Hsu [Fri, 26 Jun 2020 09:39:23 +0000 (09:39 +0000)]
Temporarily skip flakey bin.sh.execution.functional_test.bg12 in CI

PR: 238870
Sponsored by: The FreeBSD Foundation

3 years agoena: fix module build after r362530
Andriy Gapon [Fri, 26 Jun 2020 09:32:57 +0000 (09:32 +0000)]
ena: fix module build after r362530

Somehow I missed the makefile when moving the change from phabricator to
svn.

MFC after: 1 week
X-MFC with: r362530

3 years agoPrevent calling USB backends multiple times.
Peter Grehan [Fri, 26 Jun 2020 08:20:38 +0000 (08:20 +0000)]
Prevent calling USB backends multiple times.

The TRB processing loop could potentially call a back-end twice
with the same status transaction. While this was generally benign,
some code paths in the tablet backend weren't set up to handle
this case, resulting in a NULL dereference.

Fix by
 - returning a STALL error when an invalid request was seen in the backend
 - skipping a call to the backend if the number of packets in a status
   transaction was zero (this code fragment was taken from the Intel ACRN
   xhci backend)

PR: 246964
Reported by:  Ali Abdallah
Discussed with: Leon Dang (author)
Reviewed by: jhb (#bhyve), Leon Dang
Approved by: jhb
Obtained from:  Intel ACRN (partially)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25228

3 years agoUpdate bhyve maintainers.
Peter Grehan [Fri, 26 Jun 2020 06:11:50 +0000 (06:11 +0000)]
Update bhyve maintainers.

Suggested by: jhb
Approved by:  jhb, tychon

3 years agoDon't log normal login_getpwclass(3) result.
Xin LI [Fri, 26 Jun 2020 04:46:45 +0000 (04:46 +0000)]
Don't log normal login_getpwclass(3) result.

The logging was introduced in r314527 but doesn't appear to be useful
for regular operation, and as the result, for users with no class set
(very common) the administrator would see a message like this in their
auth.log:

  sshd[44251]: user root login class [preauth]

(note that the class was "" because that's what's typically configured
for most users; we would get 'default' if lc->lc_class is chosen)

Remove this log as it can be annoying as the lookup happen before
authentication and repeats, and our code is not acting upon lc_class
or pw_class directly anyways.

Reviewed by: cem, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24997

3 years agoAdd an entry for r362639.
Rick Macklem [Fri, 26 Jun 2020 03:18:10 +0000 (03:18 +0000)]
Add an entry for r362639.

3 years agoBump the version since r362639 changed the internal API between the NFS
Rick Macklem [Fri, 26 Jun 2020 03:14:30 +0000 (03:14 +0000)]
Bump the version since r362639 changed the internal API between the NFS
kernel modules so they must all be rebuilt.

3 years agoAdd a boolean argument to nfscl_reqstart() to indicate that ext_pgs mbufs
Rick Macklem [Fri, 26 Jun 2020 03:11:54 +0000 (03:11 +0000)]
Add a boolean argument to nfscl_reqstart() to indicate that ext_pgs mbufs
should be used.

For KERN_TLS (and possibly some other future network interface) the mbuf
list passed into sosend() must be ext_pgs mbufs. The krpc could simply
copy all the mbuf data into ext_pgs mbufs before calling sosend(), but
that would be inefficient for large RPC messages.
This patch adds an argument to nfscl_reqstart() to indicate that it should
fill the RPC message into ext_pgs mbufs.
It also adds fields to "struct nfsrv_descript" needed for building NFS RPC
messages in ext_pgs mbufs, along with new flags for this.

Since the argument is always "false", this commit should not result in any
semantic change. However, this commit prepares the code
for future commits that will add support for building of NFS RPC messages
in ext_pgs mbufs.

3 years agoReduce contention on per-adapter lock.
John Baldwin [Fri, 26 Jun 2020 00:01:31 +0000 (00:01 +0000)]
Reduce contention on per-adapter lock.

- Move temporary sglists into the session structure and protect them
  with a per-session lock instead of a per-adapter lock.

- Retire an unused session field, and move a debugging field under
  INVARIANTS to avoid using the session lock for completion handling
  when INVARIANTS isn't enabled.

- Use counter_u64 for per-adapter statistics.

Note that this helps for cases where multiple sessions are used
(e.g. multiple IPsec SAs or multiple KTLS connections).  It does not
help for workloads that use a single session (e.g. a single GELI
volume).

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25457

3 years agoSimplify IPsec transform-specific teardown.
John Baldwin [Thu, 25 Jun 2020 23:59:16 +0000 (23:59 +0000)]
Simplify IPsec transform-specific teardown.

- Rename from the teardown callback from 'zeroize' to 'cleanup' since
  this no longer zeroes keys.

- Change the callback return type to void.  Nothing checked the return
  value and it was always zero.

- Don't have esp call into ah since it no longer needs to depend on
  this to clear the auth key.  Instead, both are now private and
  self-contained.

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25443

3 years agoEnter and exit the network epoch for async IPsec callbacks.
John Baldwin [Thu, 25 Jun 2020 23:57:30 +0000 (23:57 +0000)]
Enter and exit the network epoch for async IPsec callbacks.

When an IPsec packet has been encrypted or decrypted, the next step in
the packet's traversal through the network stack is invoked from a
crypto worker thread, not from the original calling thread.  These
threads need to enter the network epoch before passing packets down to
IP output routines or up to transport protocols.

Reviewed by: ae
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25444

3 years agoAdd CAP_EVENT to pidfiles.
David Bright [Thu, 25 Jun 2020 21:34:43 +0000 (21:34 +0000)]
Add CAP_EVENT to pidfiles.

CAP_EVENT was omitted on pidfiles (in
pidfile_open()). There seems no reason why a process that creates
and writes a pidfile cannot monitor events on that file. This mod adds
the capability.

Reviewed by: cem@
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D25363

3 years agoiflib: fix compilation issue introduced in r362621
Vincenzo Maffione [Thu, 25 Jun 2020 20:43:21 +0000 (20:43 +0000)]
iflib: fix compilation issue introduced in r362621

The ifp local variable is useful even without netmap
and altq, as it is used to check for IFF_DRV_RUNNING.

MFC after: 2 weeks

3 years agoUse zfree() to explicitly zero IPsec keys.
John Baldwin [Thu, 25 Jun 2020 20:31:06 +0000 (20:31 +0000)]
Use zfree() to explicitly zero IPsec keys.

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25442

3 years agoImplement an approximation of Linux MADV_DONTNEED semantics.
Mark Johnston [Thu, 25 Jun 2020 20:30:30 +0000 (20:30 +0000)]
Implement an approximation of Linux MADV_DONTNEED semantics.

Linux MADV_DONTNEED is not advisory: it has side effects for anonymous
memory, and some system software depends on that.  In particular,
MADV_DONTNEED causes anonymous pages to be discarded.  If the mapping is
a private mapping of a named object then subsequent faults are to
repopulate the range from that object, otherwise pages will be
zero-filled.  For mappings of non-anonymous objects, Linux MADV_DONTNEED
can be implemented in the same way as our MADV_DONTNEED.

This implementation differs from Linux semantics in its handling of
private mappings, inherited through fork(), of non-anonymous objects.
After applying MADV_DONTNEED, subsequent faults will repopulate the
mapping from the parent object rather than the root of the shadow chain.

PR: 230160
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25330

3 years agoFix few panics on NVMe's timing out initialization requests.
Alexander Motin [Thu, 25 Jun 2020 20:29:29 +0000 (20:29 +0000)]
Fix few panics on NVMe's timing out initialization requests.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

3 years agoUse explicit_bzero() instead of bzero() for sensitive data.
John Baldwin [Thu, 25 Jun 2020 20:25:35 +0000 (20:25 +0000)]
Use explicit_bzero() instead of bzero() for sensitive data.

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25441

3 years agoExplicitly zero the temporary auth context used to generate HMAC state.
John Baldwin [Thu, 25 Jun 2020 20:22:44 +0000 (20:22 +0000)]
Explicitly zero the temporary auth context used to generate HMAC state.

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25439

3 years agoExplicitly zero hash results and context in glxsb_authcompute().
John Baldwin [Thu, 25 Jun 2020 20:21:34 +0000 (20:21 +0000)]
Explicitly zero hash results and context in glxsb_authcompute().

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25438

3 years agoUse zfree() instead of bzero() and free().
John Baldwin [Thu, 25 Jun 2020 20:20:22 +0000 (20:20 +0000)]
Use zfree() instead of bzero() and free().

These bzero's should have been explicit_bzero's.

Reviewed by: cem, delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25437

3 years agoZero the temporary HMAC key in hmac_init_pad().
John Baldwin [Thu, 25 Jun 2020 20:18:55 +0000 (20:18 +0000)]
Zero the temporary HMAC key in hmac_init_pad().

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25436

3 years agoUse zfree() instead of explicit_bzero() and free().
John Baldwin [Thu, 25 Jun 2020 20:17:34 +0000 (20:17 +0000)]
Use zfree() instead of explicit_bzero() and free().

In addition to reducing lines of code, this also ensures that the full
allocation is always zeroed avoiding possible bugs with incorrect
lengths passed to explicit_bzero().

Suggested by: cem
Reviewed by: cem, delphij
Approved by: csprng (cem)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25435

3 years agoFix copy/paste mistake in kvm_getswapinfo(3)
Dimitry Andric [Thu, 25 Jun 2020 20:04:35 +0000 (20:04 +0000)]
Fix copy/paste mistake in kvm_getswapinfo(3)

It seems this manpage was copied from kvm_getloadavg(3), but the
DIAGNOSTICS section was not updated completely. Update the section with
correct information about a return value of -1.

MFC after: 3 days

3 years agoiflib: netmap: add support for partial ring openings
Vincenzo Maffione [Thu, 25 Jun 2020 19:44:24 +0000 (19:44 +0000)]
iflib: netmap: add support for partial ring openings

Reviewed by: gallatin
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25254

3 years agoiflib: netmap: add per-tx-queue netmap support
Vincenzo Maffione [Thu, 25 Jun 2020 19:35:43 +0000 (19:35 +0000)]
iflib: netmap: add per-tx-queue netmap support

Reviewed by: gallatin
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25253

3 years agoRevert OPENSSL_NO_SSL3_METHOD to keep ABI compatibility.
Gordon Tetlow [Thu, 25 Jun 2020 19:35:37 +0000 (19:35 +0000)]
Revert OPENSSL_NO_SSL3_METHOD to keep ABI compatibility.

This define caused a couple of symbols to disappear. To keep ABI
compatibility, we are going to keep the symbols exposed, but leave SSLv3 as
not in the default config (this is what OPENSSL_NO_SSL3 achieves). The
ramifications of this is an application can still use SSLv3 if it
specifically calls the SSLv3_method family of APIs.

Reported by: kib, others
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D25451

3 years agoipfw: Support the literal IPv6 address syntax in the fwd command.
Mark Johnston [Thu, 25 Jun 2020 19:27:22 +0000 (19:27 +0000)]
ipfw: Support the literal IPv6 address syntax in the fwd command.

Discussed with: rgrimes, Lutz Donnerhacke
Submitted by: Neel Chauhan <neel AT neelc DOT org>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24011

3 years agoAdd SCTP_SUPPORT to the default kernel options.
Mark Johnston [Thu, 25 Jun 2020 19:12:27 +0000 (19:12 +0000)]
Add SCTP_SUPPORT to the default kernel options.

Otherwise out-of-tree module builds will be broken for a lack of a
definition of MK_SCTP_SUPPORT.

Reported by: Michael Butler <imb@protected-networks.net>
MFC with: r362614
Sponsored by: The FreeBSD Foundation

3 years agoEliminate the color field from the RB element struct. Identify the
Doug Moore [Thu, 25 Jun 2020 17:44:14 +0000 (17:44 +0000)]
Eliminate the color field from the RB element struct. Identify the
color of a node (or, really, the color of the link from the parent to
the node) by using one of the last two bits of the parent pointer in
that parent node. Adjust rebalancing methods to account for where
colors are stored, and the fact that null children have a color too.

Adjust RB_PARENT and RB_SET_PARENT to account for this change.

Reviewed by: markj
Tested by: pho, hselasky
Differential Revision: https://reviews.freebsd.org/D25418

3 years agocxgbe(4): Add a pointer to the adapter softc in vi_info.
Navdeep Parhar [Thu, 25 Jun 2020 17:04:22 +0000 (17:04 +0000)]
cxgbe(4): Add a pointer to the adapter softc in vi_info.

There were quite a few places where port_info was being accessed only to
get to the adapter.

Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25432

3 years agolimits(1): Add EXAMPLES section
Fernando Apesteguía [Thu, 25 Jun 2020 16:46:27 +0000 (16:46 +0000)]
limits(1): Add EXAMPLES section

 * Add four examples showing flags -e, -b, -d, -s
 * Remove extra space at the end of the line reported by igor

Approved by: bcr@
Differential Revision: https://reviews.freebsd.org/D25426

3 years agoAdd SCTP_SUPPORT handling to config.mk.
Mark Johnston [Thu, 25 Jun 2020 15:25:00 +0000 (15:25 +0000)]
Add SCTP_SUPPORT handling to config.mk.

Reviewed by: jhb, tuexen
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25402

3 years agoCall swap_pager_freespace() from vm_object_page_remove().
Mark Johnston [Thu, 25 Jun 2020 15:21:21 +0000 (15:21 +0000)]
Call swap_pager_freespace() from vm_object_page_remove().

All vm_object_page_remove() callers, except
linux_invalidate_mapping_pages() in the LinuxKPI, free swap space when
removing a range of pages from an object.  The LinuxKPI case appears to
be an unintentional omission that could result in leaked swap blocks, so
unconditionally free swap space in vm_object_page_remove() to protect
against similar bugs in the future.

Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25329

3 years agobhyve: allow for automatic destruction on power-off
Pawel Biernacki [Thu, 25 Jun 2020 12:35:20 +0000 (12:35 +0000)]
bhyve: allow for automatic destruction on power-off

Introduce -D flag that allows for the VM to be destroyed on guest initiated
power-off by the bhyve(8) process itself.
This is quality of life change that allows for simpler deployments without
the need for bhyvectl --destroy.

Requested by: swills
Reviewed by: 0mp (manpages), grehan, kib, swills
Approved by: kib (mentor)
MFC after: 2 weeks
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D25414

3 years agoman page of select(2) should mention pselect(2)
Pawel Biernacki [Thu, 25 Jun 2020 12:31:05 +0000 (12:31 +0000)]
man page of select(2) should mention pselect(2)

Reviewed by: bcr (manpages), kib, trasz
Approved by: kib (mentor)
MFC after: 7 days
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D25169

3 years agoUpdate tests(7) as kyua(1) was imported to base in r359260
Li-Wen Hsu [Thu, 25 Jun 2020 11:41:28 +0000 (11:41 +0000)]
Update tests(7) as kyua(1) was imported to base in r359260

PR: 247151
Reported by: 0mp
Reviewed by: 0mp, asomers, bcr, emaste, markj
Suggested from: brooks, ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25339

3 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Dimitry Andric [Thu, 25 Jun 2020 08:15:10 +0000 (08:15 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.0-129-gd24d5c8e308. Getting closer to 10.0.1-rc2.

MFC after: 3 weeks

3 years agobhyve(8): For prototyping, reattempt decode in userspace
Conrad Meyer [Thu, 25 Jun 2020 00:18:42 +0000 (00:18 +0000)]
bhyve(8): For prototyping, reattempt decode in userspace

If userspace has a newer bhyve than the kernel, it may be able to decode
and emulate some instructions vmm.ko is unaware of.  In this scenario,
reset decoder state and try again.

Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D24464

3 years agoatkbd/evdev: recognize the Chromebook menu key as F13 like Linux does.
Vladimir Kondratyev [Thu, 25 Jun 2020 00:09:43 +0000 (00:09 +0000)]
atkbd/evdev: recognize the Chromebook menu key as F13 like Linux does.

This is the key on the right side of the function keys, with the
"hamburger menu" icon on it.

Submitted by: GregV <greg@unrelenting.technology>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25390

3 years agoClang-format: Avoid hardcoded LLVM include-order style
Conrad Meyer [Wed, 24 Jun 2020 23:22:36 +0000 (23:22 +0000)]
Clang-format: Avoid hardcoded LLVM include-order style

Reported by: emaste

3 years agoUpdate .clang-format type and foreach macros lists
Conrad Meyer [Wed, 24 Jun 2020 22:42:46 +0000 (22:42 +0000)]
Update .clang-format type and foreach macros lists

No functional change.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D25429

3 years agoVendor import of llvm-project branch release/10.x
Dimitry Andric [Wed, 24 Jun 2020 20:22:44 +0000 (20:22 +0000)]
Vendor import of llvm-project branch release/10.x
llvmorg-10.0.0-129-gd24d5c8e308.

3 years agoacpi_ibm(4): Rename disengaged mode to unthrottled mode.
Mark Johnston [Wed, 24 Jun 2020 19:51:03 +0000 (19:51 +0000)]
acpi_ibm(4): Rename disengaged mode to unthrottled mode.

This mode was added in r362496.  Rename it to make the meaning more
clear.

PR: 247306
Suggested by: rpokala
Submitted by: Ali Abdallah <ali.abdallah@suse.com>
MFC with: r362496

3 years agoAdd `kern.features.witness`
Enji Cooper [Wed, 24 Jun 2020 18:51:01 +0000 (18:51 +0000)]
Add `kern.features.witness`

Adding `kern.features.witness` helps expose whether or not the kernel has
`options WITNESS` enabled, so the `feature_present(3)` API can be used
to query whether or not witness(9) is built into the kernel.

This support is helpful with userspace applications (generally speaking,
tests), as it can be queried to determine whether or not tests related
to WITNESS should be run.

MFC after: 1 week
Reviewed by: cem, darrick.freebsd_gmail.com
Differential Revision: https://reviews.freebsd.org/D25302
Sponsored by: DellEMC Isilon

3 years agoUpdate .clang-format with style(9) header-sorting
Conrad Meyer [Wed, 24 Jun 2020 18:40:43 +0000 (18:40 +0000)]
Update .clang-format with style(9) header-sorting

Thanks to work done in the NetBSD clang-format project.  No functional change.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D25428

3 years agoAlways compile the brand and ignore init ELF notes standalone.
John Baldwin [Wed, 24 Jun 2020 17:54:24 +0000 (17:54 +0000)]
Always compile the brand and ignore init ELF notes standalone.

Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25374

3 years agoRegenerate src.conf.5 after r362587
Conrad Meyer [Wed, 24 Jun 2020 17:31:21 +0000 (17:31 +0000)]
Regenerate src.conf.5 after r362587

3 years agoAdd WITH_CLANG_FORMAT option
Conrad Meyer [Wed, 24 Jun 2020 17:03:42 +0000 (17:03 +0000)]
Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT.  Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D25427

3 years agoipfw(4): make O_IPVER/ipversion match IPv4 or 6, not just IPv4.
Mark Johnston [Wed, 24 Jun 2020 15:46:33 +0000 (15:46 +0000)]
ipfw(4): make O_IPVER/ipversion match IPv4 or 6, not just IPv4.

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Reviewed by: Lutz Donnerhacke
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25227

3 years agoOnly invalidate the early DTB mapping if it exists
Mitchell Horne [Wed, 24 Jun 2020 15:21:12 +0000 (15:21 +0000)]
Only invalidate the early DTB mapping if it exists

This temporary mapping will become optional. Booting via loader(8)
means that the DTB will have already been copied into the kernel's
staging area, and is therefore covered by the early KVA mappings.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D24911

3 years agoHandle load from loader(8)
Mitchell Horne [Wed, 24 Jun 2020 15:20:00 +0000 (15:20 +0000)]
Handle load from loader(8)

In locore, we must detect and handle different arguments passed by
loader(8) compared to what we recieve when booting directly via SBI
firmware. Currently we receive the hart ID in a0 and a pointer to the
device tree blob in a1. loader(8) provides only a pointer to its
metadata in a0.

The solution to this is to add an additional entry point, _alt_start.
This will be placed first in the .text section, so SBI firmware will
enter here, and jump to the common pagetable setup shortly after. Since
loader(8) understands our ELF kernel, it will enter at the ELF's entry
address, which points to _start. This approach leads to very little
guesswork as to which way we booted.

Fix-up initriscv() to parse the loader's metadata, continuing to use
fake_preload_metadata() in the SBI direct boot case.

Reviewed by: markj, jrtc27 (asm portion)
Differential Revision: https://reviews.freebsd.org/D24912

3 years agoipfw(8): In fill_ip6(), use a single statement for both "me" and "me6".
Mark Johnston [Wed, 24 Jun 2020 15:05:42 +0000 (15:05 +0000)]
ipfw(8): In fill_ip6(), use a single statement for both "me" and "me6".

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Reviewed by: rgrimes, Lutz Donnerhacke
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24403

3 years agoFix the acconting for fragmented unordered messages when using
Michael Tuexen [Wed, 24 Jun 2020 14:47:51 +0000 (14:47 +0000)]
Fix the acconting for fragmented unordered messages when using
interleaving.
This was reported for the userland stack in
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19321

MFC after: 1 week

3 years agoTCP: fix cubic RTO reaction.
Richard Scheffenegger [Wed, 24 Jun 2020 13:52:53 +0000 (13:52 +0000)]
TCP: fix cubic RTO reaction.

Proper TCP Cubic operation requires the knowledge
of the maximum congestion window prior to the
last congestion event.

This restores and improves a bugfix previously added
by jtl@ but subsequently removed due to a revert.

Reported by: chengc_netapp.com
Reviewed by: chengc_netapp.com, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor)
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D25133

3 years agoTCP: make after-idle work for transactional sessions.
Richard Scheffenegger [Wed, 24 Jun 2020 13:42:42 +0000 (13:42 +0000)]
TCP: make after-idle work for transactional sessions.

The use of t_rcvtime as proxy for the last transmission
fails for transactional IO, where the client requests
data before the server can respond with a bulk transfer.

Set aside a dedicated variable to actually track the last
locally sent segment going forward.

Reported by: rrs
Reviewed by: rrs, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor)
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D25016

3 years agoEnable long double tests on RISC-V
Mitchell Horne [Wed, 24 Jun 2020 13:11:19 +0000 (13:11 +0000)]
Enable long double tests on RISC-V

Some of the NetBSD contributed tests are gated behind the
__HAVE_LONG_DOUBLE flag. This flag seems to be defined only for
platforms whose long double is larger than their double. I could not
find this explicitly documented anywhere, but it is implied by the
definitions in NetBSD's sys/arch/${arch}/include/math.h headers, and the
following assertion from the UBSAN code:

  #ifdef __HAVE_LONG_DOUBLE
      long double LD;
      ASSERT(sizeof(LD) > sizeof(uint64_t));
  #endif

RISC-V has 128-bit long doubles, so enable the tests on this platform,
and update the comments to better explain the purpose of this flag.

Reviewed by: ngie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25419

3 years agoMake sys.auditpipe depend on /dev/auditpipe. This fixes a few failures
Edward Tomasz Napierala [Wed, 24 Jun 2020 12:17:40 +0000 (12:17 +0000)]
Make sys.auditpipe depend on /dev/auditpipe.  This fixes a few failures
on armv7.

MFC after: 2 weeks
Sponsored by: DARPA

3 years agoFix AccessWidth and BitWidth parsing in SPCR table
Marcin Wojtas [Wed, 24 Jun 2020 12:15:27 +0000 (12:15 +0000)]
Fix AccessWidth and BitWidth parsing in SPCR table

The ACPI Specification defines a Generic Address Structure (GAS),
which is used to describe UART controller register layout in the
SPCR table. The driver responsible for parsing it (uart_cpu_acpi)
wrongly associates the Access Size field to the uart_bas's regshft
and the register BitWidth to the regiowidth - according to
the definitions it should be opposite.

This problem remained hidden most likely because the majority of platforms
use 32-bit registers (BitWidth) which are accessed with the according
size (Dword). However on Marvell Armada 8k / Cn913x platforms,
the 32-bit registers should be accessed with Byte granulity, which
unveiled the issue.

This patch fixes above by proper values assignment and slightly improved
parsing.

Note that handling of the AccessWidth set to EFI_ACPI_6_0_UNDEFINED is
needed to work around a buggy SPCR table on EC2 x86 "bare metal" instances.

Reviewed by: manu, imp, cperciva, greg_unrelenting.technology
Obtained from: Semihalf
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25373

3 years agoTemporarily skip unstable sys.geom.class.gate.ggate_test.ggated on i386 in CI
Li-Wen Hsu [Wed, 24 Jun 2020 07:25:54 +0000 (07:25 +0000)]
Temporarily skip unstable sys.geom.class.gate.ggate_test.ggated on i386 in CI

PR: 244737
Sponsored by: The FreeBSD Foundation

3 years agoFix build with recent byacc.
Jung-uk Kim [Wed, 24 Jun 2020 02:08:08 +0000 (02:08 +0000)]
Fix build with recent byacc.

3 years agoMFV r362565:
Cy Schubert [Wed, 24 Jun 2020 01:51:05 +0000 (01:51 +0000)]
MFV r362565:

Update 4.2.8p14 --> 4.2.8p15

Summary: Systems that use a CMAC algorithm in ntp.keys will not release
a bit of memory on each packet that uses a CMAC keyid, eventually causing
ntpd to run out of memory and fail. The CMAC cleanup from
https://bugs.ntp.org/3447, part of ntp-4.2.8p11, introduced a bug whereby
the CMAC data structure was no longer completely removed.

MFC after: 3 days
Security: NTP Bug 3661

3 years agoImport ntp-4.2.8p15.
Cy Schubert [Wed, 24 Jun 2020 00:20:45 +0000 (00:20 +0000)]
Import ntp-4.2.8p15.

Security: ntp bug 3661

3 years agostand: remove redundant declarations
Kyle Evans [Tue, 23 Jun 2020 23:52:43 +0000 (23:52 +0000)]
stand: remove redundant declarations

These are picked out by the amd64-gcc6 build; time() is declared in <time.h>
and delay() is declared in <bootstrap.h>. These are the correct places for
these in stand/, so remove the duplicate declarations and make sure the
delay() consumer in libefi that depended on the extra delay() declaration
includes <bootstrap.h>.

MFC after: 1 week

3 years agoFix alignment issue manifesting in the userland stack.
Michael Tuexen [Tue, 23 Jun 2020 23:05:05 +0000 (23:05 +0000)]
Fix alignment issue manifesting in the userland stack.

MFC after: 1 wwek

3 years agoIn r362552, RB_SET_PARENT is defined, and use in parens in
Doug Moore [Tue, 23 Jun 2020 22:47:54 +0000 (22:47 +0000)]
In r362552, RB_SET_PARENT is defined, and use in parens in
RB_CLEAR_NODE.  But it is not an expression, and ought not to be
enclosed in parens.  Remove them.

Approved by: markj
Differential Revision: https://reviews.freebsd.org/D25421

3 years agoOptimize g_journal's superblock update by noting that the summary
Kirk McKusick [Tue, 23 Jun 2020 21:44:00 +0000 (21:44 +0000)]
Optimize g_journal's superblock update by noting that the summary
information is neither read nor written so it need not be written
out when updating the superblock.

PR:           247425
Sponsored by: Netflix

3 years agoCorrectly describe the return values for the libufs library sbget()
Kirk McKusick [Tue, 23 Jun 2020 21:37:12 +0000 (21:37 +0000)]
Correctly describe the return values for the libufs library sbget()
and sbput() functions that respectively read and write the superblock.

PR:           247425
Sponsored by: Netflix

3 years agoThe libufs library needs to track and free the new fs_si structure
Kirk McKusick [Tue, 23 Jun 2020 21:28:26 +0000 (21:28 +0000)]
The libufs library needs to track and free the new fs_si structure
in addition to the fs_csp structure that it references.

PR:           247425
Sponsored by: Netflix

3 years agoAlign comments in struct uufsd structure. No semantic change.
Kirk McKusick [Tue, 23 Jun 2020 21:17:13 +0000 (21:17 +0000)]
Align comments in struct uufsd structure. No semantic change.

Sponsored by: Netflix

3 years agoClean up some function and variable names.
Colin Percival [Tue, 23 Jun 2020 21:11:40 +0000 (21:11 +0000)]
Clean up some function and variable names.

The change from "slave" processes to "minion" processes to "worker"
processes left some less-than-coherent names:
1. "enslave" turned into the ungrammatical "enworker".
2. "slp" (SLave Pointer) turned into "mlp" (Minion [L] Pointer?).

Convert "enworker" to "create_workers" (the function in question forks
off 3 worker processes), and replace "mlp" with "wp" (Worker Pointer)
and "tmlp" with "twp" (Temporary Worker Pointer).

Reviewed by: imp, cem, danfe
Differential Revision: https://reviews.freebsd.org/D25403

3 years agoiflib: netmap: fix rsync index overrun
Vincenzo Maffione [Tue, 23 Jun 2020 20:23:56 +0000 (20:23 +0000)]
iflib: netmap: fix rsync index overrun

In the current iflib_netmap_rxsync, there is nothing that prevents
kring->nr_hwtail to overrun kring->nr_hwcur during the descriptor
import phase. This may cause errors in netmap applications, such as:

em1 RX0: fail 'head < kring->nr_hwcur || head > kring->nr_hwtail'
    h 795 c 795 t 282 rh 795 rc 795 rt 282 hc 282 ht 282

Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25252

3 years agoDefine RB_SET_PARENT to do all assignments to rb parent
Doug Moore [Tue, 23 Jun 2020 20:02:55 +0000 (20:02 +0000)]
Define RB_SET_PARENT to do all assignments to rb parent
pointers. Define RB_SWAP_CHILD to replace the child of a parent with
its twin, and use it in 4 places. Use RB_SET in rb_link_node to remove
the only linuxkpi reference to color, and then drop color- and
parent-related definitions that are defined and used only in rbtree.h.

This is intended to be entirely cosmetic, with no impact on program
behavior, and leave RB_PARENT and RB_SET_PARENT as the only ways to
read and write rb parent pointers.

Reviewed by: markj, kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D25264

3 years agoRevert r362390, those tests are fixed by r362418
Li-Wen Hsu [Tue, 23 Jun 2020 19:14:38 +0000 (19:14 +0000)]
Revert r362390, those tests are fixed by r362418

PR: 247425
Sponsored by: The FreeBSD Foundation

3 years agoRemove ldconfig_paths_aout from rc.conf after r362543
Mateusz Piotrowski [Tue, 23 Jun 2020 18:35:00 +0000 (18:35 +0000)]
Remove ldconfig_paths_aout from rc.conf after r362543

Approved by: imp
Differential Revision: https://reviews.freebsd.org/D25415

3 years agokmod.mk: Don't split out debug symbols if requested
Conrad Meyer [Tue, 23 Jun 2020 18:25:31 +0000 (18:25 +0000)]
kmod.mk: Don't split out debug symbols if requested

Ports bsd.kmod.mk explicitly sets MK_KERNEL_SYMBOLS=no to prevent auto-
splitting of debuginfo from kernel modules.  If that knob is set, don't
split out a .ko.debug and .ko from .ko.full; just generate a .ko with
debuginfo and leave it be.

Otherwise, with DEBUG_FLAGS set and MK_KERNEL_SYMBOLS=no, we would helpfully
strip out the debuginfo from the .ko.full and then not install it.  That is
not the desired result a WITH_DEBUG port kmod build.

Reviewed by: emaste, jhb
Differential Revision: https://reviews.freebsd.org/D24835

3 years agoUpdate documentation after dropping support for i386 aout from ldconfig
Mateusz Piotrowski [Tue, 23 Jun 2020 18:24:15 +0000 (18:24 +0000)]
Update documentation after dropping support for i386 aout from ldconfig

The i386 aout invocation was removed from rc.d/ldconfig in r362543.

3 years agopstat(8): improve the Size header width after r358181
Piotr Pawel Stefaniak [Tue, 23 Jun 2020 18:19:22 +0000 (18:19 +0000)]
pstat(8): improve the Size header width after r358181

All size values use fields of width 8. Also, all other headers use fields of
width 8. Make the Size header added in r358181 use 8 characters as well.

3 years agoarch(7): small corrections for RISC-V
Mitchell Horne [Tue, 23 Jun 2020 17:17:13 +0000 (17:17 +0000)]
arch(7): small corrections for RISC-V

Document that RISC-V supports multiple page sizes: 4K, 2M, and 1G.

RISC-V's long double is always 128-bits wide, therefore quad precision.

Mention __riscv_float_abi_soft, which can be used to differentiate between
riscv64 and riscv64sf in userland code.

MFC after: 3 days

3 years agosort(1): Fix two wchar-related bugs in radixsort
Conrad Meyer [Tue, 23 Jun 2020 16:43:48 +0000 (16:43 +0000)]
sort(1): Fix two wchar-related bugs in radixsort

Sort(1)'s radixsort implementation was broken for multibyte LC_CTYPEs in at
least two ways:

  * In actual radix sort, it would only bucket the least significant
    byte from each wchar, ignoring the 24 most-significant bits of each
    unicode character.

  * In degenerate cases / "fast paths," it would fall back to another
    sorting algorithm (default: mergesort) with a bogus comparator
    offset.  The string comparison functions in sort(1) take an offset
    in units of the operating character size.  However, radixsort was
    passing an offset in units of bytes.  The byte offset must be
    divided by sizeof(wchar_t).

This revision addresses both discovered issues.

Some example testcases:

  $ (echo 耳 ; echo 脳 ; echo 耳) | \
  LC_CTYPE=ja_JP.UTF-8 LC_COLLATE=C LANG=C sort --radixsort --debug

  $ (echo 耳 ; echo 脳 ; echo 耳) | \
  LC_CTYPE=C LC_COLLATE=C LANG=C           sort --radixsort --debug

  $ (for i in $(jot 34); do echo 耳耳耳耳耳; echo 耳耳耳耳脳; echo 耳耳耳耳脴; done) | \
  LC_CTYPE=ja_JP.UTF-8 LC_COLLATE=C LANG=C sort --radixsort --debug

PR: 247494
Reported by: knu
MFC after: I do not intend to, but parties interested in stable might want to

3 years agolibdevdctl: Force full match of "timestamp" field name
Ryan Moeller [Tue, 23 Jun 2020 16:29:59 +0000 (16:29 +0000)]
libdevdctl: Force full match of "timestamp" field name

OpenZFS generates events with a "zio_timestamp" field, which gets mistaken for
"timestamp" by libdevdctl due to imprecise string matching.  Then later it is
assumed a "timestamp" field exists when it doesn't and an exception is thrown.

Add a space to the search string so we match exactly "timestamp" rather than
anything with that as a suffix.

Approved by: mav (mentor)
MFC after: 3 days
Sponsored by: iXsystems, Inc.

3 years agoldconfig: remove i386 aout invocation
Ed Maste [Tue, 23 Jun 2020 15:36:05 +0000 (15:36 +0000)]
ldconfig: remove i386 aout invocation

aout support in ldconfig hasn't been required since FreeBSD 2.x.

Anyone still using FreeBSD 2 shared libraries can use a FreeBSD 2
ldconfig to generate aout ldconfig hints.

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

3 years agoarm64 armreg.h: fix TCR_TBI1 definition
Ed Maste [Tue, 23 Jun 2020 15:32:05 +0000 (15:32 +0000)]
arm64 armreg.h: fix TCR_TBI1 definition

Submitted by: Greg V <greg@unrelenting.technology>
Differential Revision: https://reviews.freebsd.org/D25411

3 years agopkg: Provide a friendlier message when bootstrap fails due to address resolution
Tom Jones [Tue, 23 Jun 2020 15:14:54 +0000 (15:14 +0000)]
pkg: Provide a friendlier message when bootstrap fails due to address resolution

The current message when bootstapping pkg fails for any reason implies that pkg
is not available. We have the error code from fetch so if bootstrap failed due
to address resolution say so.

Reviewed by:    bapt, bz
Approved by:    bz (co-mentor)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D25323

3 years agoTo avoid a startup script race change net.bpf.optimize_writers from
Tycho Nightingale [Tue, 23 Jun 2020 13:57:53 +0000 (13:57 +0000)]
To avoid a startup script race change net.bpf.optimize_writers from
CTLFLAG_RW to CTLFLAG_RWTUN to allow it to be modified by a loader
tunable.

Sponsored by: Dell EMC Isilon

3 years agoMention CI system information in development(7)
Li-Wen Hsu [Tue, 23 Jun 2020 11:40:11 +0000 (11:40 +0000)]
Mention CI system information in development(7)

Approved by: 0mp, bcr
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25340

3 years agoFix a typo and sort options
Mateusz Piotrowski [Tue, 23 Jun 2020 10:56:15 +0000 (10:56 +0000)]
Fix a typo and sort options

MFC after: 1 week

3 years agocolrm.1: Add a missing colon
Mateusz Piotrowski [Tue, 23 Jun 2020 10:27:41 +0000 (10:27 +0000)]
colrm.1: Add a missing colon

3 years agotee.1: Add a missing article
Mateusz Piotrowski [Tue, 23 Jun 2020 10:22:58 +0000 (10:22 +0000)]
tee.1: Add a missing article

3 years agocolrm(1): Add EXAMPLES section
Fernando Apesteguía [Tue, 23 Jun 2020 10:15:08 +0000 (10:15 +0000)]
colrm(1): Add EXAMPLES section

Add a couple of simple examples

Approved by: bcr@
Differential Revision: https://reviews.freebsd.org/D25196

3 years agotee(1): Add EXAMPLES section
Fernando Apesteguía [Tue, 23 Jun 2020 10:05:07 +0000 (10:05 +0000)]
tee(1): Add EXAMPLES section

Add one simple example

Approved by: bcr@
Differential Revision: https://reviews.freebsd.org/D25337

3 years agood(1): Add EXAMPLES section
Fernando Apesteguía [Tue, 23 Jun 2020 07:48:48 +0000 (07:48 +0000)]
od(1): Add EXAMPLES section

 * Add two small examples showing the use of -a, -c, -j and -N
 * While here, remove obsolete .Tn reported by mandoc(1)

Approved by: 0mp@
Differential Revision: https://reviews.freebsd.org/D25372

3 years agocxgbe(4): Add a tx_len16_to_desc helper.
Navdeep Parhar [Tue, 23 Jun 2020 07:33:29 +0000 (07:33 +0000)]
cxgbe(4): Add a tx_len16_to_desc helper.

No functional change.

MFC after: 1 week
Sponsored by: Chelsio Communications

3 years agoMFOpenZFS: Add basic zfs ioc input nvpair validation
Toomas Soome [Tue, 23 Jun 2020 06:42:39 +0000 (06:42 +0000)]
MFOpenZFS: Add basic zfs ioc input nvpair validation

We want newer versions of libzfs_core to run against an existing
zfs kernel module (i.e. a deferred reboot or module reload after
an update).

Programmatically document, via a zfs_ioc_key_t, the valid arguments
for the ioc commands that rely on nvpair input arguments (i.e. non
legacy commands from libzfs_core). Automatically verify the expected
pairs before dispatching a command.

This initial phase focuses on the non-legacy ioctls. A follow-on
change can address the legacy ioctl input from the zfs_cmd_t.

The zfs_ioc_key_t for zfs_keys_channel_program looks like:

static const zfs_ioc_key_t zfs_keys_channel_program[] = {
       {"program",     DATA_TYPE_STRING,               0},
       {"arg",         DATA_TYPE_UNKNOWN,              0},
       {"sync",        DATA_TYPE_BOOLEAN_VALUE,        ZK_OPTIONAL},
       {"instrlimit",  DATA_TYPE_UINT64,               ZK_OPTIONAL},
       {"memlimit",    DATA_TYPE_UINT64,               ZK_OPTIONAL},
};

Introduce four input errors to identify specific input failures
(in addition to generic argument value errors like EINVAL, ERANGE,
EBADF, and E2BIG).

ZFS_ERR_IOC_CMD_UNAVAIL the ioctl number is not supported by kernel
ZFS_ERR_IOC_ARG_UNAVAIL an input argument is not supported by kernel
ZFS_ERR_IOC_ARG_REQUIRED a required input argument is missing
ZFS_ERR_IOC_ARG_BADTYPE an input argument has an invalid type

Reviewed by: allanjude
Obtained from: OpenZFS
Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25393

3 years agoteach ena driver about RSS kernel option
Andriy Gapon [Tue, 23 Jun 2020 04:58:36 +0000 (04:58 +0000)]
teach ena driver about RSS kernel option

Networking is broken if the driver configures its (virtual) hardware to
use a hash algorithm (or a key) different from the one that the network
stack (software RSS) uses.  This can be seen with connections initiated
from the host.  The PCB will be placed into the hash table based on the
hash value calculated by the software.  The hardware-calculated hash
value in reponse packets will be different, so the PCB won't be found.

Tested with a kernel compiled with 'options RSS' on an instance with ena
driver.

Reviewed by: mw, adrian
MFC after: 2 weeks
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D24733

3 years agoStore the AAD in a separate buffer for KTLS.
John Baldwin [Tue, 23 Jun 2020 00:02:28 +0000 (00:02 +0000)]
Store the AAD in a separate buffer for KTLS.

For TLS 1.2 this permits reusing one of the existing iovecs without
always having to duplicate both.

While here, only duplicate the output iovec for TLS 1.3 if it will be
used.

Reviewed by: gallatin
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25291

3 years agoAdd support for requests with separate AAD to ccr(4).
John Baldwin [Mon, 22 Jun 2020 23:41:33 +0000 (23:41 +0000)]
Add support for requests with separate AAD to ccr(4).

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25290

3 years agoAdd support for requests with separate AAD to aesni(4).
John Baldwin [Mon, 22 Jun 2020 23:22:13 +0000 (23:22 +0000)]
Add support for requests with separate AAD to aesni(4).

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25289

3 years agoAdd support to the crypto framework for separate AAD buffers.
John Baldwin [Mon, 22 Jun 2020 23:20:43 +0000 (23:20 +0000)]
Add support to the crypto framework for separate AAD buffers.

This permits requests to provide the AAD in a separate side buffer
instead of as a region in the crypto request input buffer.  This is
useful when the main data buffer might not contain the full AAD
(e.g. for TLS or IPsec with ESN).

Unlike separate IVs which are constrained in size and stored in an
array in struct cryptop, separate AAD is provided by the caller
setting a new crp_aad pointer to the buffer.  The caller must ensure
the pointer remains valid and the buffer contents static until the
request is completed (e.g. when the callback routine is invoked).

As with separate output buffers, not all drivers support this feature.
Consumers must request use of this feature via a new session flag.

To aid in driver testing, kern.crypto.cryptodev_separate_aad can be
set to force /dev/crypto requests to use a separate AAD buffer.

Discussed with: cem
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25288

3 years agoFix crash in drill(1) when IP has two subsequent dots
Oleksandr Tymoshenko [Mon, 22 Jun 2020 23:13:14 +0000 (23:13 +0000)]
Fix crash in drill(1) when IP has two subsequent dots

Cherry-pick crash fix from the upstream repo

PR: 226575
Reported by: Goran Mekić <meka@tilda.center>
Obtained from: https://git.nlnetlabs.nl/ldns/commit/?id=98291475
MFC after: 2 weeks

3 years agoRevert r362148.
Yuri Pankov [Mon, 22 Jun 2020 22:59:03 +0000 (22:59 +0000)]
Revert r362148.

Breaks UTF-8 input for new or having only 7bit characters present files.

Reported by: glebius