]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC r359601 (by brooks):
Mark Johnston [Mon, 8 Jun 2020 15:27:44 +0000 (15:27 +0000)]
MFC r359601 (by brooks):
pmc: diable position-independent builds, they fail to link on amd64

PR: 245189

3 years agoMFC 361721:
Cy Schubert [Mon, 8 Jun 2020 14:00:11 +0000 (14:00 +0000)]
MFC 361721:

Per-rule hit counts (-h) can be used with either -i (input) or -o (output)
filter rule lists.

3 years agoMFC r361844:
Mark Johnston [Mon, 8 Jun 2020 13:27:45 +0000 (13:27 +0000)]
MFC r361844:
librtld_db: Handle anonymous mappings below the first file mapping.

3 years agoMFC r361110:
Hans Petter Selasky [Mon, 8 Jun 2020 09:39:48 +0000 (09:39 +0000)]
MFC r361110:
Implement synchronize_srcu_expedited() in the LinuxKPI.

Differential Revision: https://reviews.freebsd.org/D24798
Sponsored by: Mellanox Technologies

3 years agoMFC r361498:
Hans Petter Selasky [Mon, 8 Jun 2020 09:37:20 +0000 (09:37 +0000)]
MFC r361498:
Sync with Linux packet pacing enhancements in mlx5en(4).

Linux commit:
05d3ac978ed25b753bfe34fe76c50c31ee506a82

Sponsored by: Mellanox Technologies

3 years agoMFC r361827:
Hans Petter Selasky [Mon, 8 Jun 2020 09:32:57 +0000 (09:32 +0000)]
MFC r361827:
USB HID descriptors may push/pop the current state to allow
description of items residing in a so-called union. FreeBSD currently
only supports 4 such push levels.

If the push level is not restored within the processing of the same
HID item, an invalid memory location may be used for subsequent HID
item processing.

Verify that the push level is always valid when processing HID items.

Reported by: Andy Nguyen (Google)
Sponsored by: Mellanox Technologies

3 years agoMFC r361582:
Hans Petter Selasky [Mon, 8 Jun 2020 09:30:08 +0000 (09:30 +0000)]
MFC r361582:
Fix check for wMaxPacketSize in USB bluetooth driver,
in case device is not FULL speed.

Sponsored by: Mellanox Technologies

3 years agoMFC r361581:
Hans Petter Selasky [Mon, 8 Jun 2020 09:26:46 +0000 (09:26 +0000)]
MFC r361581:
Implement helper function, usbd_get_max_frame_length(), which allows kernel
device drivers to correctly predict the default USB transfer frame length.

Sponsored by: Mellanox Technologies

3 years agoMFC r361577:
Hans Petter Selasky [Mon, 8 Jun 2020 09:23:52 +0000 (09:23 +0000)]
MFC r361577:
Don't allow USB device drivers to parent own interface.
It will prevent proper USB device detach.

Sponsored by: Mellanox Technologies

3 years agoMFC r352028:
Oleksandr Tymoshenko [Mon, 8 Jun 2020 00:20:15 +0000 (00:20 +0000)]
MFC r352028:

[rpi] Inherit framebuffer BPP value from the VideoCore firmware

Instead of using hardcoded bpp of 24, obtain current/configured value
from VideoCore. This solves certain problems with Xorg/Qt apps that
require bpp of 32 to work properly. The mode can be forced by setting
framebuffer_depth value in config.txt

PR: 235363
Submitted by: Steve Peurifoy <ssw01@mathistry.net>
Tested by: Johnathan Chen <jonc@chen.org.nz> (stabe/12 patch)

3 years agoMFC r361664:
Mark Johnston [Sun, 7 Jun 2020 17:40:29 +0000 (17:40 +0000)]
MFC r361664:
Handle getcpu() calls in vsyscall emulation on amd64.

PR: 246339

3 years agoMFC r360919,r360929,r361084:
Michael Reifenberger [Sun, 7 Jun 2020 16:42:03 +0000 (16:42 +0000)]
MFC r360919,r360929,r361084:

Patch systat -zarc to display cumulative rate and round down large numbers by SI units

Introduce sysputpage() to display large page size with human readable format.
  Using UI units allows to fit larger numbers in columns.
  Stop calling v_page_size - this is a value that doesn't change at runtime.
  Renamed WINDOW *wnd to *wd to avoid conflict with global *wnd variable.
  Use bit-shift to convert page size to byte.

PR: 237664, 246458
Submitted by: ota@j.email.ne.jp

3 years agoMFC r361672, r361675, r361676, r361680:
Konstantin Belousov [Sun, 7 Jun 2020 00:41:43 +0000 (00:41 +0000)]
MFC r361672, r361675, r361676, r361680:
rtld direct exec: add -b and -v options.

3 years agoMFC r361756, r361757:
Ryan Moeller [Sat, 6 Jun 2020 03:54:06 +0000 (03:54 +0000)]
MFC r361756, r361757:

scope6: Check for NULL afdata before dereferencing

Narrows the race window with if_detach.

Approved by:    mav (mentor)
Sponsored by:   iXsystems, Inc.
Differential Revision:  https://reviews.freebsd.org/D25017

3 years agoMFC r361763: lualoader: drop the filename and word "LUA" from errors
Kyle Evans [Sat, 6 Jun 2020 01:56:30 +0000 (01:56 +0000)]
MFC r361763: lualoader: drop the filename and word "LUA" from errors

The filename is nearly always wrong since it's /boot/lua/loader.lua, which
is not useful for diagnostics. The actual errmsg will include a lua filename
if this is relevant.

Dropping "LUA" while we're here because that's almost universally
irrelevant to whatever error follows, unless the error states that it's
actually a lua problem.

Both of these are minor nits that just detract from identifying the
pertinent information.

3 years agoMFC r361346: Retain only mutually supported TCP options after simultaneous SYN
Richard Scheffenegger [Fri, 5 Jun 2020 18:00:36 +0000 (18:00 +0000)]
MFC r361346: Retain only mutually supported TCP options after simultaneous SYN

When receiving a parallel SYN in SYN-SENT state, remove all the
options only we supported locally before sending the SYN,ACK.

This addresses a consistency issue on parallel opens.

Also, on such a parallel open, the stack could be coaxed into
running with timestamps enabled, even if administratively disabled.

This does NOT contain the merge of the change to BBR since at this
time that code does not exist in stable/12, and there is no plan to
merge BBR(v1) to stable/12.

Reviewed by: tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor, blanket)
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D23371

3 years agoMFC r361624:
Andrey V. Elsukov [Fri, 5 Jun 2020 09:56:51 +0000 (09:56 +0000)]
MFC r361624:
  Fix O_IP_FLOW_LOOKUP opcode handling.

  Do not check table value matching when table lookup has failed.

3 years agofix up r361823, libprocstat zfs support, on powerpc
Andriy Gapon [Fri, 5 Jun 2020 07:37:52 +0000 (07:37 +0000)]
fix up r361823, libprocstat zfs support, on powerpc

This fixes a build failure:
  In file included from .../zfs_context.h:104,
                   from .../libprocstat/zfs_defs.c:53:
  .../vm/vm_page.h:204: error: field 'md' has incomplete type

In this branch, on powerpc, struct md_page is visible only if either AIM
or BOOKE is defined.
This is a direct commit.

3 years agoMFC r361363,r361434: libprocstat: fix ZFS support
Andriy Gapon [Fri, 5 Jun 2020 06:34:04 +0000 (06:34 +0000)]
MFC r361363,r361434: libprocstat: fix ZFS support

First of all, znode_phys_t hasn't been used for storing file attributes
for a long time now.  Modern ZFS versions use a System Attribute table
with a flexible layout.  But more importantly all the required
information is available in znode_t itself.

It's not easy to include zfs_znode.h in userland without breaking code
because the most interesting parts of the header are kernel-only. And
hardcoding field offsets is too fragile.  So, I created a new
compilation unit that includes zfs_znode.h using some mild kludges to
get it and its dependencies to compile in userland.  The compilation
unit exports interesting field offsets and does not have any other code.

PR: 194117
Sponsored by: Panzura

3 years agoMFC r361318, r361331-r361332
Kyle Evans [Fri, 5 Jun 2020 02:56:42 +0000 (02:56 +0000)]
MFC r361318, r361331-r361332

r361318:
ls: fix a --color regression from r337956

The regression is in-fact that I flipped the default from never to auto. The
incorrect impression was based on an alias that I failed to notice,
installed by the Linux distribution that I used for testing compatibility
here. Users that want the old default should be doing so with a shell alias
as is done elsewhere, rather than making this decision in ls(1).

Many thanks to rgrimes for pointing out the alias that I clearly overlooked
that resulted in this; if you despised colors in your terminal from this,
consider buying him a beer at the next venue that you see him at.

r361331:
ls(1): actually restore proper behavior

Highlights:
- CLICOLOR in the environment should imply --color=auto to maintain
  compatibility with historical behavior
- -G should set CLICOLOR and imply --color=auto

The manpage has been updated to draw the connection between -G and --color;
the former is in-fact a sort of compromise between --color=always and
--color=auto, where we'll output color regardless of the environment lacking
CLICOLOR/COLORTERM assuming stdout is a tty.

r361332:
ls: fix WITHOUT_LS_COLORS build

*sigh* references to colorflags should be gated by COLORLS.

Relnotes: yes

3 years agoMFC r361709: lualoader: improve drawer error handling
Kyle Evans [Fri, 5 Jun 2020 02:52:07 +0000 (02:52 +0000)]
MFC r361709: lualoader: improve drawer error handling

At least one user has landed in a scenario where logo files appear to be
misnamed, and we failed to find them. Our fallback for missing logodefs is
orb/orbbw, based on the color status. In a scenario where we can't locate
the logos, though, this is not ideal. Add in one more layer of fallback
to properly just don't draw any logo if the fan has been jam packed with
foreign material.

PR: 246046

3 years agoMFC rS361348: DCTCP: update alpha only once after loss recovery.
Richard Scheffenegger [Thu, 4 Jun 2020 21:02:24 +0000 (21:02 +0000)]
MFC rS361348: DCTCP: update alpha only once after loss recovery.

In mixed ECN marking and loss scenarios it was found, that
the alpha value of DCTCP is updated two times. The second
update happens with freshly initialized counters indicating
to ECN loss. Overall this leads to alpha not adjusting as
quickly as expected to ECN markings, and therefore lead to
excessive loss.

Reported by: Cheng Cui
Reviewed by: chengc_netapp.com, rrs, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor, blanket)
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D24817

3 years agoMFC r361699, r361711:
Ryan Moeller [Thu, 4 Jun 2020 17:23:49 +0000 (17:23 +0000)]
MFC r361699, r361711:

Assign default security flavor when converting old export args

vfs_export requires security flavors be explicitly listed when
exporting as of r360900.

Use the default AUTH_SYS flavor when converting old export args to
ensure compatibility with the legacy mount syscall.

Reported by:    rmacklem
Reviewed by:    rmacklem
Approved by:    mav (mentor)
Sponsored by:   iXsystems, Inc.
Differential Revision:  https://reviews.freebsd.org/D25045

3 years agoMFC r361273: iwm: improve rfkill handling
Andriy Gapon [Thu, 4 Jun 2020 13:03:13 +0000 (13:03 +0000)]
MFC r361273: iwm: improve rfkill handling

Previously the driver handled the bit within itself, but did not expose
the state change to net80211 and interface layers.
This change uses net80211 KPI for rfkill signaling.
The code is modeled after similar code in iwn and wpi.

3 years agoMFC r361279:
Kristof Provost [Wed, 3 Jun 2020 18:09:31 +0000 (18:09 +0000)]
MFC r361279:

bnxt: isc_nrxd_max and isc_ntxd_max must be powers of two

3 years agoDisable clang's -fintegrated-cc1 stage by default
Dimitry Andric [Wed, 3 Jun 2020 16:51:30 +0000 (16:51 +0000)]
Disable clang's -fintegrated-cc1 stage by default

In bug 246630, it was found that part of the rescue binary could be
compiled to very slightly different (but still equivalent) machine code,
depending on the number of simultaneous make jobs (via the -j option).

This turned out to be caused by the upstream change that made clang's
first stage compiler (i.e. the -cc1 stage) run as part of the initial
clang process invocation, instead of forking and exec'ing a new clang
process.

We are currently investigating the root cause for the difference in
output, but while that is ongoing, disable the integrated cc1 stage for
now to work around it. You can always turn it on explicitly by using the
-fintegrated-cc1 option, or turn it off with -fno-integrated-cc1.

Direct commit to stable/{11,12}, so this can hopefully end up in the
upcoming 11.4-RELEASE.

Reported by: Fabian Keil <fk@fabiankeil.de>
PR: 246630

3 years agoMFC r361654:
Mark Johnston [Wed, 3 Jun 2020 14:54:54 +0000 (14:54 +0000)]
MFC r361654:
ctld: Fix a memory leak in uclparse_conf().

PR: 246596

3 years agoMFC r361548: ifconfig(8): spell "groupname" consistently with SYNOPSYS.
Eugene Grosbein [Wed, 3 Jun 2020 04:48:00 +0000 (04:48 +0000)]
MFC r361548: ifconfig(8): spell "groupname" consistently with SYNOPSYS.

3 years agoMFC 361400: Do not try to fill socket send buffer to the last byte.
Alexander Motin [Tue, 2 Jun 2020 20:42:25 +0000 (20:42 +0000)]
MFC 361400: Do not try to fill socket send buffer to the last byte.

Setting so_snd.sb_lowat to at least 1/8 of the socket buffer size allows
send thread more actively use PDUs coalescing, that dramatically reduces
TCP lock congestion and number of context switches, when the socket is
full and PDUs are small.

3 years agoMFC r361604: Make struct ctl_be_lun first element of struct ctl_be_*_lun.
Alexander Motin [Tue, 2 Jun 2020 20:40:10 +0000 (20:40 +0000)]
MFC r361604: Make struct ctl_be_lun first element of struct ctl_be_*_lun.

It allows to remove some extra pointer dereferences and slightly tightens
up the code by unification.

3 years agoMFC r361590: Remove ctl_free_beio() LUN and ctl_io dependencies.
Alexander Motin [Tue, 2 Jun 2020 20:39:34 +0000 (20:39 +0000)]
MFC r361590: Remove ctl_free_beio() LUN and ctl_io dependencies.

This slightly simplifies the code, plus may be a ground for asynchronous
buffer free.

3 years agoMFC r361536: Properly check kern_sg_entries for S/G list.
Alexander Motin [Tue, 2 Jun 2020 20:38:18 +0000 (20:38 +0000)]
MFC r361536: Properly check kern_sg_entries for S/G list.

ctl_data_print() is called in core context, so does not even know meaning
of ext_sg_entries.

3 years agoMFC r361502, r361509: Fix fallout of r319722 in CTL HA.
Alexander Motin [Tue, 2 Jun 2020 20:37:04 +0000 (20:37 +0000)]
MFC r361502, r361509: Fix fallout of r319722 in CTL HA.

ha_lso is a listening socket (unless bind() has failed), so should use
solisten_upcall_set(NULL, NULL), not soupcall_clear().

3 years agoMFC r361263, r361338:
Mark Johnston [Tue, 2 Jun 2020 00:57:48 +0000 (00:57 +0000)]
MFC r361263, r361338:
Define a module version for accept filter modules.

PR: 245870

3 years agoMFC r361655:
Mark Johnston [Tue, 2 Jun 2020 00:56:10 +0000 (00:56 +0000)]
MFC r361655:
certctl.8: Correct the HISTORY section.

PR: 246190

3 years agoMFC r361657: elf_common.h: define DF_1_PIE
Ed Maste [Tue, 2 Jun 2020 00:49:13 +0000 (00:49 +0000)]
MFC r361657: elf_common.h: define DF_1_PIE

DF_1_PIE indicates that the object is a position-independent executable.

Reference:
https://docs.oracle.com/cd/E36784_01/html/E36857/chapter6-42444.html

3 years agoMFC r361442
Peter Grehan [Mon, 1 Jun 2020 05:14:01 +0000 (05:14 +0000)]
MFC r361442
Fix pci-passthru MSI issues with OpenBSD guests

PR: 245392

3 years agoUpdate to bmake-20200517
Simon J. Gerraty [Sun, 31 May 2020 21:43:59 +0000 (21:43 +0000)]
Update to bmake-20200517

MFC of r341652, r342376, r361307

Changes since 20180512 are mostly portability related
hence the large gap in versions imported.

There are however some bug fixes, and a rework of filemon handling.
In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace
and elimination of filemon(4) which has not had the TLC it needs.

FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c
allows use of that, with a bit less overhead than the ktrace model.

Summary of changes from ChangeLog

o str.c: empty string does not match % pattern
  plus unit-test changes
o var.c: import handling of old sysV style modifier using '%'
o str.c: refactor brk_string
o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD
  a blank command is perfectly valid.
o meta.c: meta_oodate, check for corrupted meta file
  earlier and more often.
* meta.c: meta_compat_parent check for USE_FILEMON
  patch from Soeren Tempel
o meta.c: fix compat mode, need to call meta_job_output()
o job.c: extra fds for meta mode not needed if using filemon_dev
o meta.c: avoid passing NULL to filemon_*() when meta_needed()
  returns FALSE.
o filemon/filemon_{dev,ktrace}.c: allow selection of
  filemon implementation.  filemon_dev.c uses the kernel module
  while filemon_ktrace.c leverages the fktrace api available in
  NetBSD.  filemon_ktrace.c can hopefully form the basis for
  adding support for other tracing mechanisms such as strace on
  Linux.
o meta.c: when target is out-of-date per normal make rules
  record value of .OODATE in meta file.
o parse.c: don't pass NULL to realpath(3)
  some versions cannot handle it.
o parse.c: ParseDoDependency: free paths rather than assert
o parse.c: ParseVErrorInternal use .PARSEDIR
  and apply if relative, and then use .PARSEFILE
  for consistent result.
o parse.c: ParseVErrorInternal use .CURDIR if .PARSEDIR
  is relative
o var.c: avoid SEGFAULT in .unexport-env
  when MAKELEVEL is not set
o var.c: add :q
o dir.c: cleanup caching of stats

plus more unit-tests

4 years agoMFC r361112,r361117: sh: Fix double INTON with vfork
Jilles Tjoelker [Sat, 30 May 2020 13:39:56 +0000 (13:39 +0000)]
MFC r361112,r361117: sh: Fix double INTON with vfork

The shell maintains a count of the number of times SIGINT processing has
been disabled via INTOFF, so SIGINT processing resumes when all disables
have enabled again (INTON).

If an error occurs in a vfork() child, the processing of the error enables
SIGINT processing again, and the INTON in vforkexecshell() causes the count
to become negative.

As a result, a later INTOFF may not actually disable SIGINT processing. This
might cause memory corruption if a SIGINT arrives at an inopportune time.

Note that various places such as errors in non-special builtins
unconditionally reset the count to 0, so the problem might still not always
be visible.

PR: 246497

4 years agoDirect commit to stable/12: Only install ebsnvme-id on amd64 for now.
Colin Percival [Sat, 30 May 2020 02:56:13 +0000 (02:56 +0000)]
Direct commit to stable/12: Only install ebsnvme-id on amd64 for now.

This port is in the "latest" ports tree but not in "quarterly", so we
have a package for amd64 but not for aarch64.

This commit should be reverted when we have a new quarterly branch.

Sponsored by: https://www.patreon.com/cperciva

4 years agoMFC r361350: Add ebsnvme-id to EC2 AMIs and enable /dev/aws/disk
Colin Percival [Sat, 30 May 2020 02:52:24 +0000 (02:52 +0000)]
MFC r361350: Add ebsnvme-id to EC2 AMIs and enable /dev/aws/disk

Sponsored by: https://www.patreon.com/cperciva

4 years agoMFC r361143: Add /etc/autofs/special_efs to EC2 AMIs
Colin Percival [Sat, 30 May 2020 02:50:26 +0000 (02:50 +0000)]
MFC r361143: Add /etc/autofs/special_efs to EC2 AMIs

Sponsored by: https://www.patreon.com/cperciva

4 years agoMFC r361095:
Mark Johnston [Sat, 30 May 2020 01:17:26 +0000 (01:17 +0000)]
MFC r361095:
pf: Add a new zone for per-table entry counters.

4 years agoMFC r361364: net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING
Andriy Gapon [Fri, 29 May 2020 07:38:57 +0000 (07:38 +0000)]
MFC r361364: net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING

This is useful when a wireless driver is stopped or started in response
to events like an RF Kill button press.  Applications like
wpa_supplicant depend on such events to have a correct view of interface
state.

4 years agoMFC r361330: libprocstat: fix reading of file descriptor table via kvm
Andriy Gapon [Fri, 29 May 2020 07:37:27 +0000 (07:37 +0000)]
MFC r361330: libprocstat: fix reading of file descriptor table via kvm

This seems to have been broken since r247602 (from year 2013!).
Can be easily tested with
  fstat -N /boot/kernel/kernel -M /var/crash/vmcore.last

Sponsored by: Panzura

4 years agoMFC r358308:
Warner Losh [Thu, 28 May 2020 23:23:49 +0000 (23:23 +0000)]
MFC r358308:

    Before issing the REMOVE_DEVICE command to the firmware, make sure that all
    commands have completed.

    It's not OK to force complete any pending commands before we send the
    REMOVE_DEVICE. Instead, make sure that all pending commands are complete before
    sending that. By trying to second guess the firmware here, we run the risk of
    completing commands twice, which leads to corruption.

    This removes the forced completion of commands introduced in r218811. So it's a
    partial backout of that commit, but replaces it with a more rebust
    mechanism. Either these commands will complete due to the TARGET RESET, or they
    will timeout and be aborted, but they will all complete.

    Add assert that all commands are complete to REMOVE_DEVICE completion
    routine. We attempt to assure this programatically, so we shouldn't have any
    commands in the queue because we've waited for them all. Any commands that make
    it into our action routine after we mark the target in removal will complete
    immediately with an error.

    When we're removing a target that's not a volume, advertise up the stack that
    it's actually gone, as opposed to having a transient selection error we should
    retry. Do this both in the action routine, and when we get a notification of an
    aborted command. We don't do this for volumes because the driver tries hard not
    to advertise to the OS a volume has disappeared.

    Apply these changes to both mpr and mps since they are based on quite similar
    designs.

    Discussed with: scottl@
    Differential Revision: https://reviews.freebsd.org/D23768

4 years agoInclude the shells/bash port on Vagrant images, which prevents
Glen Barber [Thu, 28 May 2020 18:57:55 +0000 (18:57 +0000)]
Include the shells/bash port on Vagrant images, which prevents
a shell issue during startup.

Approved by: re (kib, insta-MFC)
PR: 245051
Sponsored by: Rubicon Communications, LLC (netgate.com)

4 years agoMFC r361313:
Ryan Moeller [Thu, 28 May 2020 17:08:39 +0000 (17:08 +0000)]
MFC r361313:

Deduplicate fsid comparisons

Comparing fsid_t objects requires internal knowledge of the fsid structure
and yet this is duplicated across a number of places in the code.

Simplify by creating a fsidcmp function (macro).

Reviewed by:    mjg, rmacklem
Approved by:    mav (mentor)
Sponsored by:   iXsystems, Inc.
Differential Revision:  https://reviews.freebsd.org/D24749

4 years agoMFC r361060:
Konstantin Belousov [Thu, 28 May 2020 01:53:35 +0000 (01:53 +0000)]
MFC r361060:
Add memalign(3).

4 years agoMFC r361303, r361349, r361394, r361398, r361537:
Konstantin Belousov [Wed, 27 May 2020 21:56:45 +0000 (21:56 +0000)]
MFC r361303, r361349, r361394, r361398, r361537:
Change link_map::l_addr to mean load offset in ABI-compatible way.
Add link_map::l_refname.
Add rtld feature indicators.

4 years agoMFC r361302:
Konstantin Belousov [Wed, 27 May 2020 18:23:14 +0000 (18:23 +0000)]
MFC r361302:
amd64: Add a knob to flush RSB on context switches if machine has SMEP.

4 years agoMFC r361299:
Konstantin Belousov [Wed, 27 May 2020 18:17:40 +0000 (18:17 +0000)]
MFC r361299:
Do not consider CAP_RDCL_NO as an indicator for all MDS vulnerabilities
handled by hardware.

4 years agoMFC r361272:
Cy Schubert [Wed, 27 May 2020 17:49:32 +0000 (17:49 +0000)]
MFC r361272:

Silence the once per second CTRL-EVENT-SCAN-FAILED errors when the WiFi
radio is disabled through the communication device toggle key (also known
as the RF raidio kill button). Only the CTRL-EVENT-DISCONNECTED will be
issued.

Submitted by: avg
Reported by: avg

4 years agoMFC r361286:
Mark Johnston [Wed, 27 May 2020 15:06:03 +0000 (15:06 +0000)]
MFC r361286:
Avoid hard-coding pipe buffer sizes in the pipe and fifo kqueue tests.

4 years agoMFC r361292: vt: fix duplicate keymap descriptions
Ed Maste [Wed, 27 May 2020 01:04:03 +0000 (01:04 +0000)]
MFC r361292: vt: fix duplicate keymap descriptions

PR: 246495
Submitted by: Jorge Maidana

4 years agoloader: fix userboot's ability to detect a guest's interpreter
Kyle Evans [Tue, 26 May 2020 19:34:05 +0000 (19:34 +0000)]
loader: fix userboot's ability to detect a guest's interpreter

Some time after r338418, I believe with -Os/-Oz -ffunction-sections
-fdata-sections, the bootprog_interp variable that held our "$Interpreter:"
marker started getting strip from all loaders, with exception to userboot
since it used bootprog_interp to determine what flavor of userboot it was.

At some point, it had been brought to my attention that this was no longer
working and I had worked up some potential solutions to use the variable
that involved printing it out. My vague recollection is that this was
rejected, and I forgot to explore the alternatives; I cannot find records of
this discussion anymore.

Fast forward to present day, Andrew reported that it was non-functional and
offered (effectively) this patch (sans comment) to stop the compiler from
optimizing it out by assigning it to a volatile variable. This removes
concerns about user-facing change while retaining the interpreter marker.
Furthermore, it could certainly be uglier.

4 years agoMFC r360980:
Mark Johnston [Tue, 26 May 2020 14:06:07 +0000 (14:06 +0000)]
MFC r360980:
Re-enable proc_test:symbol_lookup after r360979.

PR: 244732

4 years agoMFC r360979:
Mark Johnston [Tue, 26 May 2020 14:05:37 +0000 (14:05 +0000)]
MFC r360979:
librtld_db: Fix shlib mapping offsets.

PR: 244732

4 years agoMFC r361262:
Mark Johnston [Tue, 26 May 2020 14:05:06 +0000 (14:05 +0000)]
MFC r361262:
Use the symbolic name for "modmetadata_set".

4 years agoMFC r360984:
Konstantin Belousov [Tue, 26 May 2020 13:35:41 +0000 (13:35 +0000)]
MFC r360984:
Make include/malloc.h usable again.

4 years agoMFC r360956: zfs allow/unallow should work with numeric uid/gid
Andriy Gapon [Tue, 26 May 2020 05:55:46 +0000 (05:55 +0000)]
MFC r360956: zfs allow/unallow should work with numeric uid/gid

And that should work even (especially) if there is no matching user or
group name.  This change allows to see and modify delegations for
deleted groups and users.

The change is originally by Xin Li.
illumos report: https://www.illumos.org/issues/6037
OpenZFS (ZoL) PR: https://github.com/openzfs/zfs/pull/10280

4 years agoMFC r360657: acpi_video: support systems without non-essential methods
Andriy Gapon [Tue, 26 May 2020 05:54:00 +0000 (05:54 +0000)]
MFC r360657: acpi_video: support systems without non-essential methods

Only _BCL and _BCM methods seem to be essential to the driver's
operation.  If _BQC is missing then we can assume that the current
brightness is whatever we set by the last _BCM invocation.  If _DCS or
_DGS is missing then we can make assumptions as well.

The change is based on a patch suggested by Anthony Jenkins
<Scoobi_doo@yahoo.com> in PR 207086.

PR: 207086

4 years agoRegenerate llvm config headers to correctly enable zlib support
Dimitry Andric [Mon, 25 May 2020 16:06:30 +0000 (16:06 +0000)]
Regenerate llvm config headers to correctly enable zlib support

During the initial upgrade to 10.0.0 in r357120, I generated these
headers once, but they were missing zlib-related settings at that time.
These should have been regenerated again during the merge of the final
10.0.0 release.

Direct commit to stable/{11,12}, since head has gotten 10.0.1 in the
mean time, with up-to-date generated headers.

Reported by: hyama99@gmail.com
PR: 246244

4 years agoMFC r361438:
Cy Schubert [Mon, 25 May 2020 13:19:52 +0000 (13:19 +0000)]
MFC r361438:

Chase r361344. Update unbound version strings.

Reported by: mike tancsa <mike@sentex.net>

4 years agoMFC r360221-r360223
Cy Schubert [Mon, 25 May 2020 13:16:35 +0000 (13:16 +0000)]
MFC r360221-r360223

r360221:
In preparation for update to sqlite3-3.31.1 (3310100),
recommit r357201: MFV r357163, which was reverted by r357522
due to segfault under PowerPc.

Update sqlite3-3.30.1 (3300100) --> sqlite3-3.31.0 (3310000)

r360222:
MFV r360158:

Update sqlite3-3.31.0 (3310000) --> sqlite3-3.31.1 (3310100)

Tested by: Mark Millard <marklmi at yahoo.com>
With to be committed PowerPC patch

r360223:
Fix PowerPC segfault.

The segfault fix was originally developed by our upstream, sqlite.org,
to address S/390 and Sparc segfaults, both of which are big endian.
Our PowerPC is also big endian, which this patch also fixes.

Reported by: Mark Millard <marklmi at yahoo.com>
Tested by: Mark Millard <marklmi at yahoo.com>
Obtained from: https://www.sqlite.org/src/vinfo/04885763c4cd00cb?diff=1
https://sqlite.org/forum/forumpost/672291a5b2

4 years agoFix a mismerge in r361454.
Mark Johnston [Mon, 25 May 2020 13:14:40 +0000 (13:14 +0000)]
Fix a mismerge in r361454.

This is a direct commit to stable/12.

Reported by: Jenkins

4 years agoMFC r360906:
Mark Johnston [Mon, 25 May 2020 12:49:57 +0000 (12:49 +0000)]
MFC r360906:
Add a basic table entry counter regression test.

4 years agoMFC r360903:
Mark Johnston [Mon, 25 May 2020 12:45:10 +0000 (12:45 +0000)]
MFC r360903:
pf: Don't allocate per-table entry counters unless required.

4 years agoMFC r361344: MFV r361322:
Cy Schubert [Sun, 24 May 2020 16:47:27 +0000 (16:47 +0000)]
MFC r361344: MFV r361322:

Update unbound 1.9.6 --> 1.10.1.

Bug Fixes:
 - CVE-2020-12662 Unbound can be tricked into amplifying an incoming
   query into a large number of queries directed to a target.
 - CVE-2020-12663 Malformed answers from upstream name servers can be
   used to make Unbound unresponsive.

Reported by: emaste
Relnotes: yes
Security: CVE-2020-12662, CVE-2020-12663

4 years agoMFC r361250:
Benedict Reuschling [Sun, 24 May 2020 10:19:26 +0000 (10:19 +0000)]
MFC r361250:

The -F flag of swapon(8) requires -a to work.

Before this change, swapon(8) implied that -F works as a standalone option,
which is not the case and would produce a usage message. This change extends
the description of the -F option to mention that -a is required with it.

PR: 238551
Submitted by: Christian Baltini

4 years agoMFC r361249:
Benedict Reuschling [Sun, 24 May 2020 10:16:47 +0000 (10:16 +0000)]
MFC r361249:

Fix a typo: argments -> arguments

PR: 243294
Submitted by: Igor Ostapenko
MFC after: 5 days

4 years agoMFC r361248:
Benedict Reuschling [Sun, 24 May 2020 10:12:31 +0000 (10:12 +0000)]
MFC r361248:
Update SYNOPSIS section to be consistent regarding -u, -i, and -I.

Apparently, when the -u, -i and -I options where added to sed(1), it was
forgotten to add them to both lines in the SYNOPSIS section. They were only
added to the second line, although they apply to both.

With the updated SYNOPSIS, it is now allowed (and consistent) to run:

sed -i BAK s/foo/bar/g some_file

PR: 240556
Submitted by: Oliver Fromme
MFC after: 5 days

4 years agoMFC r361337: indent(1): add fallthrough markers
Piotr Pawel Stefaniak [Sun, 24 May 2020 09:46:44 +0000 (09:46 +0000)]
MFC r361337: indent(1): add fallthrough markers

4 years agoMFC r361277:
Konstantin Belousov [Sat, 23 May 2020 11:56:42 +0000 (11:56 +0000)]
MFC r361277:
mlx5_core: add more port module event types to decode.

Sponsored by: Mellanox Technologies

4 years agoMFC r361276:
Konstantin Belousov [Sat, 23 May 2020 11:55:13 +0000 (11:55 +0000)]
MFC r361276:
mlx5_core: add "PMD type not enabled" port module event type.

Sponsored by: Mellanox Technologies

4 years agoRevert mlock_helper.c test code changes from r361350.
Mark Johnston [Sat, 23 May 2020 03:32:08 +0000 (03:32 +0000)]
Revert mlock_helper.c test code changes from r361350.

They were not intended to be merged, since the MFC did not change the
max_wired sysctl name.  This is a direct commit to stable/12.

Reported by: lwhsu

4 years agoReenable sys.geom.class.multipath.misc.fail_on_error on stable/12
Alan Somers [Fri, 22 May 2020 22:17:44 +0000 (22:17 +0000)]
Reenable sys.geom.class.multipath.misc.fail_on_error on stable/12

The failing test was fixed by r361403.  Direct commit to stable/12 because
the test was never disabled on head.

PR: 244158
Reported by: lwhsu

4 years agoMFC r360829:
Alan Somers [Fri, 22 May 2020 22:13:55 +0000 (22:13 +0000)]
MFC r360829:

fusefs: fix two small bugs in the tests' expectations

These two errors have been present since the tests' introduction.
Coincidentally every test (I think there's only one) that cares about that
field also works when the field's value is 0.

4 years agoMFC r360828:
Alan Somers [Fri, 22 May 2020 22:12:07 +0000 (22:12 +0000)]
MFC r360828:

fusefs: better dtrace probes for asynchronous invalidation operations

4 years agoMFC r360807:
Alan Somers [Fri, 22 May 2020 19:09:43 +0000 (19:09 +0000)]
MFC r360807:

Fix the sys.geom.class.multipath.misc.fail_on_error test on stable/12

This test uses a gnop feature (delay probability) that isn't available on
stable/12.  But it's unnecessary; the test works fine without it.  Removing
it simplifies the test and, once MFCed, will allow it to pass on stable/12.

PR: 244158
Reported by: lwhsu

4 years agoMFC r354941,r354948: 10601 10757 Pool allocation classes
Andriy Gapon [Fri, 22 May 2020 16:51:00 +0000 (16:51 +0000)]
MFC r354941,r354948: 10601 10757 Pool allocation classes

MFV r354382,r354385: 10601 10757 Pool allocation classes

illumos/illumos-gate@663207adb1669640c01c5ec6949ce78fd806efae
https://github.com/illumos/illumos-gate/commit/663207adb1669640c01c5ec6949ce78fd806efae

10601 Pool allocation classes
https://www.illumos.org/issues/10601
  illumos port of ZoL Pool allocation classes. Includes at least these two
  commits:
  441709695 Pool allocation classes misplacing small file blocks
  cc99f275a Pool allocation classes

10757 Add -gLp to zpool subcommands for alt vdev names
https://www.illumos.org/issues/10757
  Port from ZoL of
  d2f3e292d Add -gLp to zpool subcommands for alt vdev names
  Note that a subsequent ZoL commit changed -p to -P
  a77f29f93 Change full path subcommand flag from -p to -P

Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Portions contributed by: HÃ¥kan Johansson <f96hajo@chalmers.se>
Portions contributed by: Richard Yao <ryao@gentoo.org>
Portions contributed by: Chunwei Chen <david.chen@nutanix.com>
Portions contributed by: loli10K <ezomori.nozomu@gmail.com>
Author: Don Brady <don.brady@delphix.com>

11541 allocation_classes feature must be enabled to add log device

illumos/illumos-gate@c1064fd7ce62fe763a4475e9988ffea3b22137de
https://github.com/illumos/illumos-gate/commit/c1064fd7ce62fe763a4475e9988ffea3b22137de

https://www.illumos.org/issues/11541
  After the allocation_classes feature was integrated, one can no longer add a
  log device to a pool unless that feature is enabled. There is an explicit check
  for this, but it is unnecessary in the case of log devices, so we should handle
  this better instead of forcing the feature to be enabled.

Author: Jerry Jelinek <jerry.jelinek@joyent.com>

FreeBSD notes.
I faithfully added the new -g, -L, -P flags, but only -g does something:
vdev GUIDs are displayed instead of device names.  -L, resolve symlinks,
and -P, display full disk paths, do nothing at the moment.
The use of special vdevs is backward compatible for read-only access, so
root pools should be bootable, but exercise caution.

MFV r354383: 10592 misc. metaslab and vdev related ZoL bug fixes

illumos/illumos-gate@555d674d5d4b8191dc83723188349d28278b2431
https://github.com/illumos/illumos-gate/commit/555d674d5d4b8191dc83723188349d28278b2431

https://www.illumos.org/issues/10592
  This is a collection of recent fixes from ZoL:
  8eef997679b Error path in metaslab_load_impl() forgets to drop ms_sync_lock
  928e8ad47d3 Introduce auxiliary metaslab histograms
  425d3237ee8 Get rid of space_map_update() for ms_synced_length
  6c926f426a2 Simplify log vdev removal code
  21e7cf5da89 zdb -L should skip leak detection altogether
  df72b8bebe0 Rename range_tree_verify to range_tree_verify_not_present
  75058f33034 Remove unused vdev_t fields

4 years agoMFC r361352:
Mark Johnston [Fri, 22 May 2020 15:42:45 +0000 (15:42 +0000)]
MFC r361352:
Fix the build after r361033 when ACPI is disabled.

4 years agoMFC r354804,r354806,r354807,r354885: 10499 Multi-modifier protection (MMP)
Andriy Gapon [Fri, 22 May 2020 13:27:02 +0000 (13:27 +0000)]
MFC r354804,r354806,r354807,r354885: 10499 Multi-modifier protection (MMP)

MFV r354378,r354379,r354386: 10499 Multi-modifier protection (MMP)

10499 Multi-modifier protection (MMP)
illumos/illumos-gate@e0f1c0afa46cc84d4b1e40124032a9a87310386e
https://github.com/illumos/illumos-gate/commit/e0f1c0afa46cc84d4b1e40124032a9a87310386e
https://www.illumos.org/issues/10499
  Port the following ZFS commits from ZoL to illumos.
  379ca9cf2 Multi-modifier protection (MMP)
  bbffb59ef Fix multihost stale cache file import
  0d398b256 Do not initiate MMP writes while pool is suspended

10701 Correct lock ASSERTs in vdev_label_read/write
illumos/illumos-gate@58447f688d5e308373ab16a3b129bc0ba0fbc154
https://github.com/illumos/illumos-gate/commit/58447f688d5e308373ab16a3b129bc0ba0fbc154
https://www.illumos.org/issues/10701
  Port of ZoL commit:
  0091d66f4e Correct lock ASSERTs in vdev_label_read/write
  At a minimum, this fixes a blown assert during an MMP test run when running on
  a DEBUG build.

11770 additional mmp fixes
illumos/illumos-gate@4348eb901228d2f8fa50bb132a34248e8662074e
https://github.com/illumos/illumos-gate/commit/4348eb901228d2f8fa50bb132a34248e8662074e
https://www.illumos.org/issues/11770
  Port a few additional MMP fixes from ZoL that came in after our
  initial MMP port.
  4ca457b065 ZTS: Fix mmp_interval failure
  ca95f70dff zpool import progress kstat
  (only minimal changes from above can be pulled in right now)
  060f0226e6 MMP interval and fail_intervals in uberblock

Note from the committer (me).
I do not have any use for this feature and I have not tested it.  I only
did smoke testing with multihost=off.
Please be aware.
I merged the code only to make future merges easier.

Since r354804 libzpool depends on libzfs for get_system_hostid symbol.
Except for zstreamdump, all binaries linked with libzpool were already
linked with libzfs.  So, zstreamdump is the only fall-out.

4 years agoMFC r361073:
Konstantin Belousov [Fri, 22 May 2020 13:14:21 +0000 (13:14 +0000)]
MFC r361073:
Implement RTLD_DEEPBIND.

PR: 246462

4 years agoMFC r342743 (by romain):
Konstantin Belousov [Fri, 22 May 2020 13:13:34 +0000 (13:13 +0000)]
MFC r342743 (by romain):
Add man page for dlvsym(3).

4 years agoMFC r354333,r354359: zfs: enable SPA_PROCESS on the kernel side
Andriy Gapon [Fri, 22 May 2020 12:25:57 +0000 (12:25 +0000)]
MFC r354333,r354359: zfs: enable SPA_PROCESS on the kernel side

The purpose of this change is to group kernel threads specific to a
particular ZFS pool under a kernel process.  There can be many dozens of
threads per pool.  This change improves observability of those threads.

This change consists of several subchanges:
1. illumos taskq_create_proc can now pass its process parameter to
taskqueue.  Also, use zfsproc instead of NULL for taskq_create.  Caveat:
zfsproc might not be initialized yet.  But in that case it is still NULL,
so not worse than before.

2. illumos sys/proc.h: kthread id is stored in t_did field, not t_tid.

3. zfs: enable SPA_PROCESS on the kernel side.  The change is a bit hairy
as newproc() is implemented privately to spa.c.  I couldn't think of a
better way to populate process name than to poke inside the argument for
the process routine.

4. illumos thread_create: allow assigning thread to process other than
zfsproc.

5. zfs: expose spa_proc to other users, assign sync and quiesce threads
to it.

Pool-specific threads created using (relatively new) zthr mechanism are
still assigned to the zfskern process rather than to a respective
zpool-xxx process.  I am going to address this a bit later.

4 years agoMFC r353679: document taskqueue_start_threads_in_proc
Andriy Gapon [Fri, 22 May 2020 12:20:50 +0000 (12:20 +0000)]
MFC r353679: document taskqueue_start_threads_in_proc

While here, fix taskqueue_start_threads_cpuset that was documented under
old name of taskqueue_start_threads_pinned.

4 years agoMFC r361006: linuxkpi: print stack trace in WARN_ON macros
Andriy Gapon [Fri, 22 May 2020 12:10:16 +0000 (12:10 +0000)]
MFC r361006: linuxkpi: print stack trace in WARN_ON macros

4 years agoMFC r361002: snd_hda: fix typos related to quirks set via 'config' tunable
Andriy Gapon [Fri, 22 May 2020 12:08:31 +0000 (12:08 +0000)]
MFC r361002: snd_hda: fix typos related to quirks set via 'config' tunable

4 years agoMFC r361001: sound/hda: newer AMD devices still require the same PCIe snoop
Andriy Gapon [Fri, 22 May 2020 12:06:53 +0000 (12:06 +0000)]
MFC r361001: sound/hda: newer AMD devices still require the same PCIe snoop

So, replicate the ATI vendor snoop configuration for the AMD vendor.
I think that this should fix a number of cases where users currently
have to resort to polling or disabling MSI.

4 years agoMFC r360779: gpioiic_attach: fix a NULL pointer crash on hints-based systems
Andriy Gapon [Fri, 22 May 2020 12:05:01 +0000 (12:05 +0000)]
MFC r360779: gpioiic_attach: fix a NULL pointer crash on hints-based systems

The attach method uses GPIO_GET_BUS() to get a "newbus" device
that provides a pin.  But on hints-based systems a GPIO controller
driver might not be fully initialized yet and it does not know gpiobus
hanging off it.  Thus, GPIO_GET_BUS() cannot be called yet.
The reason is that controller drivers typically create a child gpiobus
using gpiobus_attach_bus() and that leads to the following call chain:
gpiobus_attach_bus() -> gpiobus_attach() ->
bus_generic_attach(gpiobus) -> gpioiic_attach().
So, gpioiic_attach() is called before gpiobus_attach_bus() returns.

I observed this bug with nctgpio driver on amd64.
I think that the problem was introduced in r355276.

The fix is to avoid calling GPIO_GET_BUS() from the attach method.
Instead, we know that on hints-based systems only the parent gpiobus can
provide the pins.
Nothing is changed for FDT-based systems.

4 years agoMFC r360692: usbhid: add several missing usages from Digitizer page
Andriy Gapon [Fri, 22 May 2020 12:03:17 +0000 (12:03 +0000)]
MFC r360692: usbhid: add several missing usages from Digitizer page

4 years agoMFC r360499: ig4iic_acpi_probe: remove set but unused variable
Andriy Gapon [Fri, 22 May 2020 12:01:29 +0000 (12:01 +0000)]
MFC r360499: ig4iic_acpi_probe: remove set but unused variable

4 years agoMFC r360246: acpi_video: fix a crash in detach with an LCD output
Andriy Gapon [Fri, 22 May 2020 11:59:50 +0000 (11:59 +0000)]
MFC r360246: acpi_video: fix a crash in detach with an LCD output

The crash happened because of a video output object was removed from a
wrong container, crt_units instead of lcd_units.

4 years agoMFC r360242: acpi_iicbus: set device description in the probe method
Andriy Gapon [Fri, 22 May 2020 11:57:48 +0000 (11:57 +0000)]
MFC r360242: acpi_iicbus: set device description in the probe method

Kernel prints the device announcement before the attach method is
called, so if the correct description is not set by the probe method,
then the announcement would have an incorrect one.

4 years agoMFC r360241: ig4: ensure that drivers always attach in correct order
Andriy Gapon [Fri, 22 May 2020 11:55:54 +0000 (11:55 +0000)]
MFC r360241: ig4: ensure that drivers always attach in correct order

Use DRIVER_MODULE_ORDERED(SI_ORDER_ANY) so that ig4's ACPI attachment
happens after iicbus and acpi_iicbus drivers are registered.

4 years agoMFC r358381: use ZFS_MAX_DATASET_NAME_LEN instead of MAXPATHLEN for dataset names
Andriy Gapon [Fri, 22 May 2020 11:53:07 +0000 (11:53 +0000)]
MFC r358381: use ZFS_MAX_DATASET_NAME_LEN instead of MAXPATHLEN for dataset names

The change affects only FreeBSD specific code as the common code already
mostly uses the more idiomatic and correct ZFS_MAX_DATASET_NAME_LEN.

4 years agoMFC r358380,r358382: dsl_dataset_promote_sync: populate 'oldname' before using it
Andriy Gapon [Fri, 22 May 2020 11:41:08 +0000 (11:41 +0000)]
MFC r358380,r358382: dsl_dataset_promote_sync: populate 'oldname' before using it

It's very unlikely that zfsvfs_update_fromname() and
zvol_rename_minors() ever did anything during the promote operation as
the old name was not initialized.

4 years agoMFC r361075:
Hans Petter Selasky [Fri, 22 May 2020 08:59:12 +0000 (08:59 +0000)]
MFC r361075:
Assign process group of the TTY under the "proctree_lock".

This fixes a race where concurrent calls to doenterpgrp() and
leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp
changing value so that tty_rel_pgrp() misses clearing it to NULL. For
more details refer to the use of pgdelete() in the kernel.

No functional change intended.

Panic backtrace:
__mtx_lock_sleep() # page fault due to using destroyed mutex
tty_signal_pgrp()
tty_ioctl()
ptsdev_ioctl()
kern_ioctl()
sys_ioctl()
amd64_syscall()

Sponsored by: Mellanox Technologies

4 years agoMFC r361260: Update leap-seconds to leap-seconds.3676924800.
Xin LI [Fri, 22 May 2020 02:06:56 +0000 (02:06 +0000)]
MFC r361260: Update leap-seconds to leap-seconds.3676924800.