]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC r347441:
Emmanuel Vadot [Tue, 16 Jun 2020 20:38:55 +0000 (20:38 +0000)]
MFC r347441:

efibootmgr: Do not add the new boot entry in dry-run is specified

While here fix a typo.

Sponsored-by: Ampere Computing, LLC
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D20212

3 years agoMFC r351144:
Emmanuel Vadot [Tue, 16 Jun 2020 20:36:22 +0000 (20:36 +0000)]
MFC r351144:

arm64: Add EspressoBin DTB to the build

This will compile the espressobin dts to a dtb file and this will be
install in /boot/dtb/marvell/ during installkernel.

3 years agoMFC r347440, r347929-r347930, r349588
Emmanuel Vadot [Tue, 16 Jun 2020 20:35:01 +0000 (20:35 +0000)]
MFC r347440, r347929-r347930, r349588

r347440:
ahci: Check if bus is cache-coherent

We do this for FDT systems but not for ACPI ones.
Check the presence of the _CCA attribute.

Sponsored by: Ampere Computing, LLC
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D20144

r347929:
pci: ecam: Do not warn on mismatch of bus_end

We cannot know the bus end number before parsing the MCFG table
so don't set the bus_end before that. If the MCFG table doesn't
exist we will set the configuration base address based on the _CBA
value and set the bus_end to the maximal number allowed by PCI.

Sponsored by: Ampere Computing, LLC

Differential Revision: https://reviews.freebsd.org/D20213

r347930:
pci: ecam: Correctly parse memory and IO region

When activating a resource do not compare the resource id to the adress.
Treat IO region as MEMORY region too.

Submitted by: Tuan Phan <tphan@amperecomputing.com> (Original Version)
Sponsored by: Ampere Computing, LLC
Differential Revision: https://reviews.freebsd.org/D20214

r349588:
arm64: efi: Map memory IO region as device

Reviewed by: andrew
Sponsored by: Ampere Computing, LLC

3 years agoMFC r346683:
Emmanuel Vadot [Tue, 16 Jun 2020 20:23:57 +0000 (20:23 +0000)]
MFC r346683:

bsdinstall: up the interface before calling dhclient

3 years agoMFC r346332:
Emmanuel Vadot [Tue, 16 Jun 2020 20:22:56 +0000 (20:22 +0000)]
MFC r346332:

ofw_graph: Add functions for graph bindings

Those functions are helpers to work on graph bindings.
graphs are mostly use with video related devices.
See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/graph.txt?id=4436a3711e3249840e0679e92d3c951bcaf25515

Differential Revision: https://reviews.freebsd.org/D19877

3 years agoMFC r361977: libusb: improve compatibility
Kyle Evans [Tue, 16 Jun 2020 12:21:55 +0000 (12:21 +0000)]
MFC r361977: libusb: improve compatibility

Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API.
Descriptions and functionality for these derived from the
documentation at [0].  The current set of capabilities are all supported by
libusb.

These were detected as missing after updating net/freerdp to 2.1.1, which
attempted to use both.

[0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html

3 years agoMFC r361715:
Vladimir Kondratyev [Mon, 15 Jun 2020 22:41:28 +0000 (22:41 +0000)]
MFC r361715:

[psm] Do not disable trackpoint when hw.psm.elantech.touchpad_off is enabled

PR: 246117
Reported by: Alexander Sieg <ports@xanderio.de>

MFC r361718:

[psm] Workaround active PS/2 multiplexor hang

which happens on some laptops after returning to legacy multiplexing mode
at initialization stage.

PR: 242542
Reported by: Felix Palmen <felix@palmen-it.de>

3 years agoMFC r360624:
Vladimir Kondratyev [Mon, 15 Jun 2020 22:32:59 +0000 (22:32 +0000)]
MFC r360624:

[evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys.

"F lock" is a switch between two sets of scancodes for function keys F1-F12
found on some Logitech and Microsoft PS/2 keyboards [1]. When "F lock" is
pressed, then F1-F12 act as function keys and produce usual keyscans for
these keys. When "F lock" is depressed, F1-F12 produced the same keyscans
but prefixed with E0.
Some laptops use [2] E0-prefixed F1-F12 scancodes for non-standard keys.

[1] https://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html
[2] https://reviews.freebsd.org/D21565

MFC r360625:

[evdev] Sync event codes with Linux kernel 5.6

3 years agoMFC r353127:
Yuri Pankov [Mon, 15 Jun 2020 15:59:44 +0000 (15:59 +0000)]
MFC r353127:

Pre-generate Big5 charmap from CLDR data.

The one used previously was missing the characters in 0-127 range,
making various tools try to escape them in output.

PR: 235100
Reviewed by: bapt
Tested by: Ting-Wei Lan <lantw44@gmail.com>
Differential Revision: https://reviews.freebsd.org/D21794

3 years agoMFC r362095, r362145
Cy Schubert [Mon, 15 Jun 2020 03:10:53 +0000 (03:10 +0000)]
MFC r362095, r362145

r362095:
MFV r362082:

Update sqlite3 3.31.1 --> 3.32.0.

PR: 247149
Reported by: spam123@bitbert.com
Reminded by: emaste
Security: CVE-2020-11655, CVE-2020-13434, CVE-2020-13435,
CVE-2020-13630, CVE-2020-13631, CVE-2020-13632

r362145:
MFV r362143:

Update sqlite3 to 3.32.2 (3320200).

CVE-2020-11655: SQLite through 3.31.1 allows attackers to cause a denial of
service (segmentation fault) via a malformed window-function query because
the AggInfo object's initialization is mishandled.

CVE-2020-13434: SQLite through 3.32.0 has an integer overflow in
sqlite3_str_vappendf in printf.c.

CVE-2020-13435: SQLite through 3.32.0 has a segmentation fault in
sqlite3ExprCodeTarget in expr.c.

CVE-2020-13630: ext/fts3/fts3.c in SQLite before 3.32.0 has a
use-after-free in fts3EvalNextRow, related to the snippet feature

CVE-2020-13631: SQLite before 3.32.0 allows a virtual table to be renamed
to the name of one of its shadow tables, related to alter.c and build.c.

CVE-2020-13632: ext/fts3/fts3_snippet.c in SQLite before 3.32.0 ha s a
NULL pointer dereference via a crafted matchinfo() query.

PR: 247149
Reported by: spam123@bitbert.com
Security: vuxml: c4ac9c79-ab37-11ea-8b5e-b42e99a1b9c3
https://nvd.nist.gov/vuln/detail/CVE-2020-11655
https://nvd.nist.gov/vuln/detail/CVE-2020-13434
https://nvd.nist.gov/vuln/detail/CVE-2020-13435
https://nvd.nist.gov/vuln/detail/CVE-2020-13630
https://nvd.nist.gov/vuln/detail/CVE-2020-13631
https://nvd.nist.gov/vuln/detail/CVE-2020-13632

3 years agoMFC r361945, r362036:
Mark Johnston [Mon, 15 Jun 2020 03:02:59 +0000 (03:02 +0000)]
MFC r361945, r362036:
Stop computing a "sharedram" value when emulating Linux sysinfo(2).

3 years agoRevert r362187, it contained some unintended changes.
Mark Johnston [Mon, 15 Jun 2020 03:02:19 +0000 (03:02 +0000)]
Revert r362187, it contained some unintended changes.

This is a direct commit to stable/12.

3 years agoMFC r361945, r362036:
Mark Johnston [Mon, 15 Jun 2020 03:01:28 +0000 (03:01 +0000)]
MFC r361945, r362036:
Stop computing a "sharedram" value when emulating Linux sysinfo(2).

3 years agoUpdate Subversion and dependencies to 1.14.0 LTS.
Dimitry Andric [Sun, 14 Jun 2020 17:36:43 +0000 (17:36 +0000)]
Update Subversion and dependencies to 1.14.0 LTS.

MFC r344438 (by emaste):

svn: support building with WITH_PIE

Subversion builds and links against its own .a archives using local
rules, so did not benefit from with the WITH_PIE library support added
in r344179.  Apply the same _pie suffix locally.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D19246

MFC r352156 (by imp):

Remove directory empty after r266735

MFC r357299 (by cem):

contrib/apr: Remove scope leak UB

In apr_vformatter, the variable buf was declared inside a limited scope
region, but a pointer to it is leaked outside of that region and used
later.  This is undefined behavior.  Fix by moving the buf variable to
function scope.

Reported by: Coverity
CID: 1192541

MFC r357301 (by cem):

contrib/apr: Rip out bogus [CS]PRNG implementation

This construction used some relatively slow design involving SHA2; even if
it were fed real entropy (unclear; external to the design), it did not
handle fork in a safe way, and it was difficult to audit for correctness.
So just rip it out and use the very simple and known-correct arc4random(3)
interface in its place.

MFC r361677:

Change Makefiles under usr.bin/svn to make them easier to incrementally
update. No functional change intended.

MFC r361678:

Update apr to 1.7.0. See contrib/apr/CHANGES for a summary of changes.

MFC r361681:

Change more Makefiles under usr.bin/svn to make them easier to
incrementally update. No functional change intended.

MFC r361684 (by kevans):

apr: build some needed emulated 64-bit atomic bits after r361678

This should fix the build on armv{6,7}, mips, and mips64, which all need
emulated 64-bit atomics for apr.

MFC r361691:

Follow-up r361678 (update apr to 1.7.0) by also regenerating the apr
internal headers through the upstream configure script, with some minor
custom tweaks.

MFC r361692:

Update apr-util to 1.6.1. See contrib/apr-util/CHANGES for a summary of
changes.

MFC r361693:

Update Subversion to 1.14.0 LTS. See contrib/subversion/CHANGES for a
summary of changes, or for a more thorough overview:

https://subversion.apache.org/docs/release-notes/1.14

NOTE: there is no need to dump and reload repositories, and the working
copy format is still the same as Subversion 1.8 through 1.13.

Relnotes: yes

3 years agoMFC r362056:
Hans Petter Selasky [Sun, 14 Jun 2020 05:25:06 +0000 (05:25 +0000)]
MFC r362056:
Add missing range checks when receiving USB ethernet packets.

Found by: Ilja Van Sprundel, IOActive
Sponsored by: Mellanox Technologies

3 years agoMFC r361294:
Martin Matuska [Fri, 12 Jun 2020 22:59:59 +0000 (22:59 +0000)]
MFC r361294:
Update libarchive to 3.4.3

Relevant vendor changes:
  PR #1352: support negative zstd compression levels
  PR #1359: improve zstd version checking
  PR #1348: support RHT.security.selinux from GNU tar
  PR #1357: support for archives compressed with pzstd
  PR #1367: fix issues in acl tests
  PR #1372: child handling cleanup
  PR #1378: fix memory leak from passphrase callback

Relnotes: yes

3 years agoMFC r361562:
Alan Somers [Fri, 12 Jun 2020 20:39:42 +0000 (20:39 +0000)]
MFC r361562:

geli: fix a livelock during panic

During any kind of shutdown, kern_reboot calls geli's pre_sync event hook,
which tries to destroy all unused geli devices. But during a panic, geli
can't destroy any devices, because the scheduler is stopped, so it can't
switch threads. A livelock results, and the system never dumps core.

This commit fixes the problem by refusing to destroy any devices during
panic, used or otherwise.

PR: 246207
Reviewed by: jhb
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D24697

3 years agoMFC r361439:
Alan Somers [Fri, 12 Jun 2020 20:33:00 +0000 (20:33 +0000)]
MFC r361439:

[skip ci] ip.4: fix typos

3 years agoMFC r361401:
Alan Somers [Fri, 12 Jun 2020 20:32:26 +0000 (20:32 +0000)]
MFC r361401:

Fix issues with FUSE_ACCESS when default_permissions is disabled

This patch fixes two issues relating to FUSE_ACCESS when the
default_permissions mount option is disabled:

* VOP_ACCESS() calls with VADMIN set should never be sent to a fuse server
  in the form of FUSE_ACCESS operations. The FUSE protocol has no equivalent
  of VADMIN, so we must evaluate such things kernel-side, regardless of the
  default_permissions setting.

* The FUSE protocol only requires FUSE_ACCESS to be sent for two purposes:
  for the access(2) syscall and to check directory permissions for
  searchability during lookup. FreeBSD sends it much more frequently, due to
  differences between our VFS and Linux's, for which FUSE was designed. But
  this patch does eliminate several cases not required by the FUSE protocol:

  * for any FUSE_*XATTR operation
  * when creating a new file
  * when deleting a file
  * when setting timestamps, such as by utimensat(2).

* Additionally, when default_permissions is disabled, this patch removes one
  FUSE_GETATTR operation when deleting a file.

PR: 245689
Reported by: MooseFS FreeBSD Team <freebsd@moosefs.pro>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D24777

3 years agoMFC r361399:
Alan Somers [Fri, 12 Jun 2020 20:27:37 +0000 (20:27 +0000)]
MFC r361399:

Disable nullfs cacheing on top of fusefs

Nullfs cacheing can keep a large number of vnodes active.  That results in
more active FUSE file handles, causing some FUSE servers to use extra
resources.  Disable nullfs cacheing for fusefs, just like we already do for
NFSv4.

PR: 245688
Reported by: MooseFS FreeBSD Team <freebsd@moosefs.pro>

3 years agoMFC r361223:
Alan Somers [Fri, 12 Jun 2020 20:11:25 +0000 (20:11 +0000)]
MFC r361223:

fusefs: fix intermittency in some ENOENT tests

When a FUSE operation other than LOOKUP returns ENOENT, the kernel will
reclaim that vnode, resuling in a FUSE_FORGET being sent a short while
later.  Many of the ENOENT tests weren't expecting those FUSE_FORGET
operations.  They usually passed by luck since FUSE_FORGET is often delayed.
This commit adds appropriate expectations.

3 years agoMFC r351516: Announce PCI Segment Groups supported to PCI host _OSC.
Alexander Motin [Fri, 12 Jun 2020 15:37:55 +0000 (15:37 +0000)]
MFC r351516: Announce PCI Segment Groups supported to PCI host _OSC.

According to ACPI 6.3 specification:
    The OS sets this bit to 1 if it supports PCI Segment Groups as defined
    by the _SEG object, and access to the configuration space of devices
    in PCI Segment Groups as described by this specification.  Otherwise,
    the OS sets this bit to 0.

As far as I see we support both of those as PCI domains for quite a while.

3 years agoMFC r361135:
Fedor Uporov [Fri, 12 Jun 2020 13:54:41 +0000 (13:54 +0000)]
MFC r361135:
Restrict the max runp and runb return values in case of extents mapping.

This restriction already present in case of indirect mapping, do the same
in case of extents.

PR: 246182
Reported by: Teran McKinney

3 years agoMFC r361134:
Fedor Uporov [Fri, 12 Jun 2020 13:53:50 +0000 (13:53 +0000)]
MFC r361134:
Fix incorrect inode link count check in case of rename.

The check was incorrect because the directory inode link count have
min value 2 after dir_nlink extfs feature introduction.

3 years agoMFC r361133:
Fedor Uporov [Fri, 12 Jun 2020 13:52:11 +0000 (13:52 +0000)]
MFC r361133:
Add inode bitmap tail initialization.

Make ext2fs compatible with changes introduced in e2fsprogs v1.45.2.
Now the tail of inode bitmap is filled with 0xff pattern explicitly during
bitmap initialization phase to avoid e2fsck error like:
"Padding at end of inode bitmap is not set."

3 years agofix up r362086, MFC of r361620, add missing VOP_UNLOCK argument
Andriy Gapon [Fri, 12 Jun 2020 07:36:32 +0000 (07:36 +0000)]
fix up r362086, MFC of r361620, add missing VOP_UNLOCK argument

The useless argument has been dropped in head, but not in this branch.

Pointy hat to: avg

3 years agoMFC r361621: do not enable pci bridge decoding on resume until I/O windows are restored
Andriy Gapon [Fri, 12 Jun 2020 07:25:40 +0000 (07:25 +0000)]
MFC r361621: do not enable pci bridge decoding on resume until I/O windows are restored

PCI bus driver restores most but not all of a child PCI-PCI bridge
configuration.  The bridge's I/O windows are restored by pcib driver and
that happens later in time.  This can be problematic because the Command
register is restored before the windows are restored.  If the firmware
programs the windows incorrectly or even does not program them at all,
then the bridge can start claiming I/O cycles that are not intended for
it.  This will continue until the correct windows are restored.

I have observed this problem with a buggy BIOS where after resuming from
S3 an I/O port window of a PCI-PCI bridge was configured with zero base
and limit causing the bridge to claim 0x0 - 0xFFF port range.  That
interfered with ACPI port access including ACPI PM Timer at port 0x808,
thus wreaking havoc in the time keeping.

The solution is to restore the Command register of PCI-PCI bridges after
the windows are restored in pcib driver.  While here, I decided that for
other PCI device types (normal and cardbus) it's better to restore the
Command register after their BARs are restored.

3 years agoMFC r361620: corefile_open_last: don't keep a locked vnode while locking other ones
Andriy Gapon [Fri, 12 Jun 2020 07:23:27 +0000 (07:23 +0000)]
MFC r361620: corefile_open_last: don't keep a locked vnode while locking other ones

Consider this scenario:
- kern.corefile=/var/coredumps/%N.%U.%I.core
- multiple processes with the same name crash at the same time

It's possible that one process selects existing file N as oldvp while it
keeps looking for an unused file number.  Another process scans through
files and stumbles upon N.  That process would be blocked on the vnode
lock while holding the directory vnode exclusively locked.  The first
process would, thus, get blocked on the directory's vnode lock.

More generally, holding a file's vnode lock (oldvp) while trying to lock
its directory (for the next lookup) is a violation of the vnode locking
order.

I have observed this deadlock in the wild.

So, the change to keep oldvp "opened" but unlocked and to lock it again
only if it's to be returned as the result.
As kib noted, an alternative would be to keep the directory locked and
to use VOP_LOOKUP directly for scanning through existing core files.

3 years agoMFC r361957-r361960
Cy Schubert [Fri, 12 Jun 2020 01:03:51 +0000 (01:03 +0000)]
MFC r361957-r361960

r361957:
MFV r361936:

Upstream commit message:

[PATCH 1/3] WPS UPnP: Do not allow event subscriptions with URLs to
other networks

The UPnP Device Architecture 2.0 specification errata ("UDA errata
16-04-2020.docx") addresses a problem with notifications being allowed
to go out to other domains by disallowing such cases. Do such filtering
for the notification callback URLs to avoid undesired connections to
external networks based on subscriptions that any device in the local
network could request when WPS support for external registrars is
enabled (the upnp_iface parameter in hostapd configuration).

Obtained from: https://w1.fi/security/2020-1/\
0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch
Security: VU#339275 and CVE-2020-12695

r361958:
MFV r361937:

Upstream commit message:

[PATCH 2/3] WPS UPnP: Fix event message generation using a long URL path

More than about 700 character URL ended up overflowing the wpabuf used
for building the event notification and this resulted in the wpabuf
buffer overflow checks terminating the hostapd process. Fix this by
allocating the buffer to be large enough to contain the full URL path.
However, since that around 700 character limit has been the practical
limit for more than ten years, start explicitly enforcing that as the
limit or the callback URLs since any longer ones had not worked before
and there is no need to enable them now either.

Obtained from: https://w1.fi/security/2020-1/\
0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch
Security: VU#339275 and CVE-2020-12695

r361959:
MFV r361938:

Upstream commit message:

[PATCH 3/3] WPS UPnP: Handle HTTP initiation failures for events more
properly

While it is appropriate to try to retransmit the event to another
callback URL on a failure to initiate the HTTP client connection, there
is no point in trying the exact same operation multiple times in a row.
Replve the event_retry() calls with event_addr_failure() for these cases
to avoid busy loops trying to repeat the same failing operation.

These potential busy loops would go through eloop callbacks, so the
process is not completely stuck on handling them, but unnecessary CPU
would be used to process the continues retries that will keep failing
for the same reason.

Obtained from: https://w1.fi/security/2020-1/\
0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch
Security: VU#339275 and CVE-2020-12695

r361960:
Post CVE-2020-12695 cleanup patch:

Resolve a Linuxism to fix the build.

3 years agoMFC r361805: em(4): Add support for Comet Lake Mobile Platform
Eric Joyner [Fri, 12 Jun 2020 00:42:05 +0000 (00:42 +0000)]
MFC r361805: em(4): Add support for Comet Lake Mobile Platform

This change introduces Comet Lake Mobile Platform support in the e1000
driver along with shared code patches described below.

  - Cast return value of e1000_ltr2ns() to higher type to avoid overflow
  - Remove useless statement of assigning act_offset
  - Add initialization of identification LED
  - Fix flow control setup after connected standby:
    After connected standby the driver blocks resets during
    "AdapterStart" and skips flow control setup. This change adds
    condition in e1000_setup_link_ich8lan() to always setup flow control
    and to setup physical interface only when there is no need to block
    resets.

Sponsored by: Intel Corporation

3 years agoMFC r357061:
Kristof Provost [Thu, 11 Jun 2020 16:51:13 +0000 (16:51 +0000)]
MFC r357061:

pf: Apply kif flags to new group members

If we have a 'set skip on <ifgroup>' rule this flag it set on the group
kif, but must also be set on all members. pfctl does this when the rules
are set, but if groups are added afterwards we must also apply the flags
to the new member. If not, new group members will not be skipped until
the rules are reloaded.

3 years agoMFC r342660 (by scottl):
Mark Johnston [Thu, 11 Jun 2020 14:48:20 +0000 (14:48 +0000)]
MFC r342660 (by scottl):
Port over the SCSI sense handling fix from mpr(4) in r342528, and fix
whitespace to match.

PR: 223813
Reported and tested by: farrokhi

3 years agoMFC r361785, r361801 (by mckusick), r361803 (by se), r361814 (by mckusick),
Konstantin Belousov [Thu, 11 Jun 2020 11:36:49 +0000 (11:36 +0000)]
MFC r361785, r361801 (by mckusick), r361803 (by se), r361814 (by mckusick),
    r361875 (by mckusick):
Fixes for UFS fdatasync(2).

3 years agoMFC r361891:
Benedict Reuschling [Thu, 11 Jun 2020 10:00:56 +0000 (10:00 +0000)]
MFC r361891:

Add EXAMPLES to cover all flags except -f since it is analogous to -s.

An EXAMPLE section was adding with some basic examples that show the use of
uniq(1) with various flags.

Submitted by: fernape@
Approved by: bcr@
Relnotes: yes (EXAMPLE section for uniq(1))
Differential Revision: https://reviews.freebsd.org/D25149

3 years agoMFC r361788: superio: do not assume that current LDN cannot change after config exit
Andriy Gapon [Thu, 11 Jun 2020 05:28:08 +0000 (05:28 +0000)]
MFC r361788: superio: do not assume that current LDN cannot change after config exit

That assumption should be true when superio(4) uses the hardware
exlusively.  But it turns out to not hold on some real systems.
So, err on the side of correctness rather than performance.
Clear current_ldn in sio_conf_exit.

3 years agoMFC r361787: ifconfig.8: fix cpability and flag descriptions for list scan / sta
Andriy Gapon [Thu, 11 Jun 2020 05:26:23 +0000 (05:26 +0000)]
MFC r361787: ifconfig.8: fix cpability and flag descriptions for list scan / sta

Some capability descriptions under list scan actually described flags.
Some capability descriptions were missing.
Some flag descriptions under list sta actually described capabilites.

3 years agoMFC r361760
Vincenzo Maffione [Wed, 10 Jun 2020 20:05:53 +0000 (20:05 +0000)]
MFC r361760

netmap: vtnet: clean up rxsync disabled logs

3 years agoMFC r361759
Vincenzo Maffione [Wed, 10 Jun 2020 20:05:07 +0000 (20:05 +0000)]
MFC r361759

netmap: vtnet: fix race condition in rxsync

This change prevents a race that happens when rxsync dequeues
N-1 rx packets (with N being the size of the netmap rx ring).
In this situation, the loop exits without re-enabling the
rx interrupts, thus causing the VQ to stall.

3 years agoMFC r361758
Vincenzo Maffione [Wed, 10 Jun 2020 20:04:20 +0000 (20:04 +0000)]
MFC r361758

netmap: vtnet: add vtnrx_nm_refill index to receive queues

The new index tracks the next netmap slot that is going
to be enqueued into the virtqueue. The index is necessary
to prevent the receive VQ and the netmap rx ring from going
out of sync, considering that we never enqueue N slots, but
at most N-1. This change fixes a bug that causes the VQ
and the netmap ring to go out of sync after N-1 packets
have been received.

3 years agoMFC r361746
Vincenzo Maffione [Wed, 10 Jun 2020 20:03:11 +0000 (20:03 +0000)]
MFC r361746

netmap: vale: fix disabled logs

3 years agoMFC r361745
Vincenzo Maffione [Wed, 10 Jun 2020 20:02:38 +0000 (20:02 +0000)]
MFC r361745

netmap: vtnet: call netmap_rx_irq() under VQ lock

The netmap_rx_irq() function normally wakes up user-space threads
waiting for more packets. In this case, it is not necessary to
call it under the driver queue lock. However, if the interface is
attached to a VALE switch, netmap_rx_irq() ends up calling rxsync
on the interface (see netmap_bwrap_intr_notify()). Although
concurrent rxsyncs are serialized through the kring lock
(see nm_kr_tryget()), the lock acquire operation is not blocking.
As a result, it may happen that netmap_rx_irq() is called on
an RX ring while another instance is running, causing the
second call to fail, and received packets stall in the receive VQ.
We fix this issue by calling netmap_irx_irq() under the VQ lock.

3 years agoMFC r361744
Vincenzo Maffione [Wed, 10 Jun 2020 19:59:11 +0000 (19:59 +0000)]
MFC r361744

netmap: vtnet: honor NM_IRQ_RESCHED

The netmap_rx_irq() function may return NM_IRQ_RESCHED to inform the
driver that more work is pending, and that netmap expects netmap_rx_irq()
to be called again as soon as possible.
This change implements this behaviour in the vtnet driver.

3 years agoMFC r361698
Vincenzo Maffione [Wed, 10 Jun 2020 19:58:03 +0000 (19:58 +0000)]
MFC r361698

netmap: if_vtnet: avoid netmap ring wraparound

netmap assumes the one "slot" is left unused to distinguish
the empty ring and full ring conditions. This assumption was
violated by vtnet_netmap_rxq_populate().

3 years agoMFC r361697
Vincenzo Maffione [Wed, 10 Jun 2020 19:57:10 +0000 (19:57 +0000)]
MFC r361697

netmap: if_vtnet: replace vtnet_free_used()

The functionality contained in this function is duplicated,
as it is already available in vtnet_txq_free_mbufs()
and vtnet_rxq_free_mbufs().

3 years agoMFC r361696
Vincenzo Maffione [Wed, 10 Jun 2020 19:55:36 +0000 (19:55 +0000)]
MFC r361696

netmap: vtnet: fix RX virtqueue initialization bug

The vtnet_netmap_rxq_populate() function erroneously assumed
that kring->nr_hwcur = 0, i.e. the kring was in the initial
state. However, this is not always the case: for example,
when a vtnet reinit is triggered by some changes in the
interface flags or capenable.
This patch changes the behaviour of vtnet_netmap_kring_refill()
so that it always starts publishing the netmap buffers starting
from the current value of kring->nr_hwcur.

3 years agoMFC r361749:
Andrey V. Elsukov [Wed, 10 Jun 2020 13:06:13 +0000 (13:06 +0000)]
MFC r361749:
  Add if_reassign method to all tunneling interfaces.

  After r339550 tunneling interfaces have started handle appearing and
  disappearing of ingress IP address on the host system.
  When such interfaces are moving into VNET jail, they lose ability to
  properly handle ifaddr_event_ext event. And this leads to need to
  reconfigure tunnel to make it working again.

  Since moving an interface into VNET jail leads to removing of all IP
  addresses, it looks consistent, that tunnel configuration should also
  be cleared. This is what will do if_reassign method.

  Reported by: John W. O'Brien <john saltant com>

3 years agoMFC r361748:
Ryan Moeller [Wed, 10 Jun 2020 03:57:10 +0000 (03:57 +0000)]
MFC r361748:

tmpfs: Preserve alignment of struct fid fields

On 64-bit platforms, the two short fields in `struct tmpfs_fid` are padded to
the 64-bit alignment of the long field.  This pushes the offsets of the
subsequent fields by 4 bytes and makes `struct tmpfs_fid` bigger than
`struct fid`.  `tmpfs_vptofh()` casts a `struct fid *` to `struct tmpfs_fid *`,
causing 4 bytes of adjacent memory to be overwritten when the struct fields are
set.  Through several layers of indirection and embedded structs, the adjacent
memory for one particular call to `tmpfs_vptofh()` happens to be the stack
canary for `nfsrvd_compound()`.  Half of the canary ends up being clobbered,
going unnoticed until eventually the stack check fails when `nfsrvd_compound()`
returns and a panic is triggered.

Instead of duplicating fields of `struct fid` in `struct tmpfs_fid`, narrow the
struct to cover only the unique fields for tmpfs and assert at compile time
that the struct fits in the allotted space.  This way we don't have to
replicate the offsets of `struct fid` fields, we just use them directly.

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

3 years agoMFC r361725, r361728:
Konstantin Belousov [Tue, 9 Jun 2020 09:04:57 +0000 (09:04 +0000)]
MFC r361725, r361728:
Do not allow to load ET_DYN object with DF_1_PIE flag set.

3 years agoMFC r361630: Remove session locking from cfiscsi_pdu_update_cmdsn().
Alexander Motin [Tue, 9 Jun 2020 02:03:30 +0000 (02:03 +0000)]
MFC r361630: Remove session locking from cfiscsi_pdu_update_cmdsn().

cs_cmdsn can be incremented with single atomic.  expcmdsn/maxcmdsn set in
cfiscsi_pdu_prepare() based on cs_cmdsn are not required to be updated
synchronously, only monotonically, that is achieved with lock there.

3 years agoMFC r361625: Report STATUS_QUEUED/SENT in `ctladm dumpooa` output.
Alexander Motin [Tue, 9 Jun 2020 02:01:39 +0000 (02:01 +0000)]
MFC r361625: Report STATUS_QUEUED/SENT in `ctladm dumpooa` output.

3 years agoMFC r361616: Move EXPDATASN/R2TSN from PDU to CTL_PRIV_FRONTEND.
Alexander Motin [Tue, 9 Jun 2020 02:01:09 +0000 (02:01 +0000)]
MFC r361616: Move EXPDATASN/R2TSN from PDU to CTL_PRIV_FRONTEND.

We any way have per-I/O space in CTL_PRIV_FRONTEND, while for PDU private
fields I have better use ideas.  Plus to me such use of PDU fields looked
a layering violation.

3 years agoMFC r361609: Remove PDU_TOTAL_TRANSFER_LEN() macro.
Alexander Motin [Tue, 9 Jun 2020 02:00:36 +0000 (02:00 +0000)]
MFC r361609: Remove PDU_TOTAL_TRANSFER_LEN() macro.

I don't see a point to copy io->scsiio.kern_total_len into the request
PDU private field.  The io is going to stay with us till the end, and
kern_total_len field is not changed after being first initialized.

3 years agoMFC r361740: lld: Set DF_1_PIE for -pie
Ed Maste [Tue, 9 Jun 2020 00:27:54 +0000 (00:27 +0000)]
MFC r361740: lld: Set DF_1_PIE for -pie

DF_1_PIE originated from Solaris[1].

GNU ld[2] sets the flag on non-Solaris platforms.

It can help distinguish PIE from ET_DYN.
eu-classify from elfutils uses this to recognize PIE[3].

glibc uses this flag to reject dlopen'ing a PIE[4]

[1] https://docs.oracle.com/cd/E36784_01/html/E36857/chapter6-42444.html
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5fe2850dd96483f176858fd75c098313d5b20bc2
[3] https://sourceware.org/git/?p=elfutils.git;a=commit;h=3f489b5c7c78df6d52f8982f79c36e9a220e8951
[4] https://sourceware.org/bugzilla/show_bug.cgi?id=24323

Sponsored by: The FreeBSD Foundation

3 years agoMFC r361739: llvm: Add DF_1_PIE
Ed Maste [Tue, 9 Jun 2020 00:25:53 +0000 (00:25 +0000)]
MFC r361739: llvm: Add DF_1_PIE

Sponsored by: The FreeBSD Foundation

3 years agoMFC r361792:
Mark Johnston [Mon, 8 Jun 2020 21:38:52 +0000 (21:38 +0000)]
MFC r361792:
Update vt(4) config option names to chase r303043.

PR: 246080

3 years agoMFC r361793:
Mark Johnston [Mon, 8 Jun 2020 21:35:24 +0000 (21:35 +0000)]
MFC r361793:
dhclient: Fix a logic bug remove_protocol().

PR: 245971

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.