]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFV r361280:
mm [Wed, 20 May 2020 20:58:48 +0000 (20:58 +0000)]
MFV r361280:
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

4 years agoRemove copyinfrom() and copyinstrfrom().
jhb [Wed, 20 May 2020 20:58:17 +0000 (20:58 +0000)]
Remove copyinfrom() and copyinstrfrom().

These functions were added in 2001 and are currently unused.
copyinfrom() looks to have never been used.  copyinstrfrom() was used
for two weeks before the code was refactored to remove it's sole use.

Reviewed by: brooks, kib
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24928

4 years agovt: fix duplicate keymap descriptions
emaste [Wed, 20 May 2020 20:24:37 +0000 (20:24 +0000)]
vt: fix duplicate keymap descriptions

PR: 246495
Submitted by: Jorge Maidana
MFC after: 1 week

4 years agoMerge freebsd32_exec_setregs() into exec_setregs() on MIPS.
jhb [Wed, 20 May 2020 19:51:39 +0000 (19:51 +0000)]
Merge freebsd32_exec_setregs() into exec_setregs() on MIPS.

The stack pointer was being decremented by 64k twice previously.

Reviewed by: brooks
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24930

4 years agopkgbase: use -dev,-dbg instead of -development,-debug
emaste [Wed, 20 May 2020 19:45:22 +0000 (19:45 +0000)]
pkgbase: use -dev,-dbg instead of -development,-debug

-development is long and awkward, and is also inconsistent with prior art
from the Linux world, which uses -dev (Debian) or -devel (Red Hat).  Follow
the Debian convention, and similarly for debug info packages.

Also remove redundant pkgbase development tag from includes.  We already tag
include files with package=runtime,dev; there is no need to separately tag
them as dev.

Discussed with: bapt
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24139

4 years agoDon't block on the range lock in zfs_getpages().
markj [Wed, 20 May 2020 18:29:23 +0000 (18:29 +0000)]
Don't block on the range lock in zfs_getpages().

After r358443 the vnode object lock no longer synchronizes concurrent
zfs_getpages() and zfs_write() (which must update vnode pages to
maintain coherence).  This created a potential deadlock between ZFS
range locks and VM page busy locks: a fault on a mapped file will cause
the fault page to be busied, after which zfs_getpages() locks a range
around the file offset in order to map adjacent, resident pages;
zfs_write() locks the range first, and then must busy vnode pages when
synchronizing.

Solve this by adding a non-blocking mode for ZFS range locks, and using
it in zfs_getpages().  If zfs_getpages() fails to acquire the range
lock, only the fault page will be populated.

Reported by: bdrewery
Reviewed by: avg
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24839

4 years agoAvoid hard-coding pipe buffer sizes in the pipe and fifo kqueue tests.
markj [Wed, 20 May 2020 17:48:18 +0000 (17:48 +0000)]
Avoid hard-coding pipe buffer sizes in the pipe and fifo kqueue tests.

Fix some style issues in the modified tests while here.

Reported by: Jenkins via lwhsu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agovmm(4): Add 12 user ABI compat after r349948
cem [Wed, 20 May 2020 17:27:54 +0000 (17:27 +0000)]
vmm(4): Add 12 user ABI compat after r349948

Reported by: kp
Reviewed by: jhb, kp
Tested by: kp
Differential Revision: https://reviews.freebsd.org/D24929

4 years agosrc.conf.5: regen after r361282, GNU_DIFF knob descriptions
emaste [Wed, 20 May 2020 17:27:22 +0000 (17:27 +0000)]
src.conf.5: regen after r361282, GNU_DIFF knob descriptions

4 years agoUpdate GNU_DIFF knob descriptions
emaste [Wed, 20 May 2020 17:20:48 +0000 (17:20 +0000)]
Update GNU_DIFF knob descriptions

After r317209 the WITH_/WITHOUT_GNU_DIFF knob controls only diff3;
diff is always BSD diff.

MFC after: 1 week

4 years agoUpdate vendor/libarchive/dist to git fc6563f5130d8a7ee1fc27c0e55baef35119f26c
mm [Wed, 20 May 2020 16:13:02 +0000 (16:13 +0000)]
Update vendor/libarchive/dist to git fc6563f5130d8a7ee1fc27c0e55baef35119f26c

Libarchive 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

4 years agobnxt: isc_nrxd_max and isc_ntxd_max must be powers of two
kp [Wed, 20 May 2020 16:07:37 +0000 (16:07 +0000)]
bnxt: isc_nrxd_max and isc_ntxd_max must be powers of two

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

4 years agoFix i386 build for r361275
lwhsu [Wed, 20 May 2020 13:51:27 +0000 (13:51 +0000)]
Fix i386 build for r361275

kponsored by: The FreeBSD Foundation

4 years agomlx5_core: add more port module event types to decode.
kib [Wed, 20 May 2020 11:20:45 +0000 (11:20 +0000)]
mlx5_core: add more port module event types to decode.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
MFC after: 3 days

4 years agomlx5_core: add "PMD type not enabled" port module event type.
kib [Wed, 20 May 2020 11:10:10 +0000 (11:10 +0000)]
mlx5_core: add "PMD type not enabled" port module event type.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
MFC after: 3 days

4 years agoHyperV socket implementation for FreeBSD
whu [Wed, 20 May 2020 11:03:59 +0000 (11:03 +0000)]
HyperV socket implementation for FreeBSD

This change adds Hyper-V socket feature in FreeBSD. New socket address
family AF_HYPERV and its kernel support are added.

Submitted by: Wei Hu <weh@microsoft.com>
Reviewed by: Dexuan Cui <decui@microsoft.com>
Relnotes: yes
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D24061

4 years agodev/xenstore: fix return with locks held
royger [Wed, 20 May 2020 11:01:10 +0000 (11:01 +0000)]
dev/xenstore: fix return with locks held

Fix returning from xenstore device with locks held, which triggers the
following panic:

# cat /dev/xen/xenstore
^C
userret: returning with the following locks held:
exclusive sx evtchn_ringc_sx (evtchn_ringc_sx) r = 0 (0xfffff8000650be40) locked @ /usr/src/sys/dev/xen/evtchn/evtchn_dev.c:262

Note this is not a security issue since access to the device is
limited to root by default.

Sponsored by: Citrix Systems R&D
MFC after: 1 week

4 years agoiwm: improve rfkill handling
avg [Wed, 20 May 2020 08:15:09 +0000 (08:15 +0000)]
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.

Reviewed by: adrian
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24923

4 years agoSilence the once per second CTRL-EVENT-SCAN-FAILED errors when the WiFi
cy [Wed, 20 May 2020 04:16:13 +0000 (04:16 +0000)]
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
MFC after: 1 week

4 years agopowerpc/radix mmu: No need for delayed TLB invalidation
jhibbits [Wed, 20 May 2020 02:33:41 +0000 (02:33 +0000)]
powerpc/radix mmu: No need for delayed TLB invalidation

x86 needs delayed TLB invalidation because invalidation requires an
expensive IPI.  PowerPC has had a TLB invalidation instruction since the
POWER1 in 1990, so there's no need to delay anything.

4 years agoMake sys.net.if_bridge_test depend on python; sys.net.if_bridge_test.span
trasz [Tue, 19 May 2020 21:55:29 +0000 (21:55 +0000)]
Make sys.net.if_bridge_test depend on python; sys.net.if_bridge_test.span
requires it.

MFC after: 2 weeks
Sponsored by: DARPA

4 years agoMake sys.netinet.output and sys.netinet6.output6 tests depend on python;
trasz [Tue, 19 May 2020 21:48:45 +0000 (21:48 +0000)]
Make sys.netinet.output and sys.netinet6.output6 tests depend on python;
they need to be able to run net_receiver.py.

MFC after: 2 weeks
Sponsored by: DARPA

4 years agolz4 hash table does not start zeroed
tsoome [Tue, 19 May 2020 19:53:12 +0000 (19:53 +0000)]
lz4 hash table does not start zeroed

illumos issue: https://www.illumos.org/issues/12757

Submitted by: andyf

4 years agoMention new jail(8) command hooks in RELNOTES
freqlabs [Tue, 19 May 2020 18:41:46 +0000 (18:41 +0000)]
Mention new jail(8) command hooks in RELNOTES

Reported by: 0mp
Approved by: mmacy (mentor)

4 years agoMention new dd flags in RELNOTES
freqlabs [Tue, 19 May 2020 18:38:46 +0000 (18:38 +0000)]
Mention new dd flags in RELNOTES

Approved by: mmacy (mentor)
Sponsored by: iXsystems, Inc.

4 years agoDefine a module version for accept filter modules.
markj [Tue, 19 May 2020 18:35:08 +0000 (18:35 +0000)]
Define a module version for accept filter modules.

Otherwise accept filters compiled into the kernel do not preempt
preloaded accept filter modules.  Then, the preloaded file registers its
accept filter module before the kernel, and the kernel's attempt fails
since duplicate accept filter list entries are not permitted.  This
causes the preloaded file's module to be released, since
module_register_init() does a lookup by name, so the preloaded file is
unloaded, and the accept filter's callback points to random memory since
preload_delete_name() unmaps the file on x86 as of r336505.

Add a new ACCEPT_FILTER_DEFINE macro which wraps the accept filter and
module definitions, and ensures that a module version is defined.

PR: 245870
Reported by: Thomas von Dein <freebsd@daemon.de>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoUse the symbolic name for "modmetadata_set".
markj [Tue, 19 May 2020 18:34:50 +0000 (18:34 +0000)]
Use the symbolic name for "modmetadata_set".

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agocxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of a
np [Tue, 19 May 2020 16:28:20 +0000 (16:28 +0000)]
cxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of a
fatal error.

Submitted by: Krishnamraju Eraparaju @ Chelsio
MFC after: 2 weeks
Sponsored by: Chelsio Communications

4 years agoUpdate leap-seconds to leap-seconds.3676924800.
delphij [Tue, 19 May 2020 16:06:03 +0000 (16:06 +0000)]
Update leap-seconds to leap-seconds.3676924800.

Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800
MFC after: 3 days

4 years agoStop performing a full icache sync when the DIC and IDC flags are set
andrew [Tue, 19 May 2020 16:04:27 +0000 (16:04 +0000)]
Stop performing a full icache sync when the DIC and IDC flags are set

The DIC and IDC bits in the CTR_EL0 register signal to the kernel when it
can relax the instruction cache synchronisation operations. The IDC bit
means we can relax cleaning the data cache to the point of unification
while the DIC bit means we don't need to invalidate the instruction cache
for data coherence. In both cases an appropriate barrier is still needed.

For now only implement the case where both bits are set, as is the case
on the Neoverse-N1 as used in the Amazon AWS Graviton 2 CPU. Note that
this behaviour is a optional on the N1 so we may later need to implement
only one or the other bit being set.

There is a tunable to disable each flag on boot.

Testing on a 4 core Graviton 2 instance found a significant improvement
in sys and real time when running "make buildkernel -j4", with no
significant difference in user time.

Reviewed by: markj
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D24853

4 years agoCreate MSI/MSI-X isrcs as needed in the GICv3 ITS driver
andrew [Tue, 19 May 2020 15:27:20 +0000 (15:27 +0000)]
Create MSI/MSI-X isrcs as needed in the GICv3 ITS driver

Previously we would create an isrc for each MSI/MSI-X interrupt. This
causes issues for other interrupt sources in the system, e.g. a GPIO
driver, as they may be unable to allocate interrupts. This works around
this by allocating the isrc only when needed.

Reported by: alisaidi@amazon.com
Reviewed by: mmel
Sponsored by: Innovaate UK
Differential Revision: https://reviews.freebsd.org/D24876

4 years agobsdinstall: do a `certctl rehash` upon installation of configuration
kevans [Tue, 19 May 2020 15:19:39 +0000 (15:19 +0000)]
bsdinstall: do a `certctl rehash` upon installation of configuration

If certctl is installed on the system we're configuring, do a certctl
rehash.

Note that certctl may not be present if the world we've installed was built
either WITHOUT_OPENSSL or WITHOUT_CAROOT. In this scenario, we don't
currently see if the host has a certctl as this may be an indication that
the system *shouldn't* have certs installed into /etc/ssl.

Reviewed by: allanjude, dteske
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D24640

4 years agoFix Typo in ng_hci_le_connection_complete_ep struct.
takawata [Tue, 19 May 2020 13:58:52 +0000 (13:58 +0000)]
Fix Typo in ng_hci_le_connection_complete_ep struct.

PR: 246538
Submitted by: Marc Veldman

4 years agoBelatedly add a RELNOTES entry for r347532.
markj [Tue, 19 May 2020 13:54:33 +0000 (13:54 +0000)]
Belatedly add a RELNOTES entry for r347532.

4 years agoAdd LE Whitelist commands to hccontrol
takawata [Tue, 19 May 2020 13:44:32 +0000 (13:44 +0000)]
Add LE Whitelist commands to hccontrol

PR: 214555
Submitted by Marc Veldman

4 years agoThe -F flag of swapon(8) requires -a to work.
bcr [Tue, 19 May 2020 12:16:44 +0000 (12:16 +0000)]
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
MFC after: 5 days

4 years agoFix a typo: argments -> arguments
bcr [Tue, 19 May 2020 11:05:27 +0000 (11:05 +0000)]
Fix a typo: argments -> arguments

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

4 years agoUpdate SYNOPSIS section to be consistent regarding -u, -i, and -I.
bcr [Tue, 19 May 2020 09:17:20 +0000 (09:17 +0000)]
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 agolinuxkpi: Add irq_work.h
manu [Tue, 19 May 2020 09:04:35 +0000 (09:04 +0000)]
linuxkpi: Add irq_work.h

Since handlers are call in a thread context we can simply use a workqueue
to emulate those functions.
The DRM code was patched to do that already, having it in linuxkpi allows us
to not patch the upstream code.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24859

4 years agolinuxkpi: add pci_dev_present
manu [Tue, 19 May 2020 08:44:33 +0000 (08:44 +0000)]
linuxkpi: add pci_dev_present

pci_dev_present shows if a set of pci ids are present in the system.
It just wraps pci_find_device.
Needed by DRMv5.2

Submitted by: Austing Shafer (ashafer@badland.io)
Differential Revision: https://reviews.freebsd.org/D24796

4 years agolinuxkpi: Add __init_waitqueue_head
manu [Tue, 19 May 2020 08:43:17 +0000 (08:43 +0000)]
linuxkpi: Add __init_waitqueue_head

The only difference with init_waitqueue_head is that the name and the
lock class key are provided but we don't use those so use init_waitqueue_head
directly.

Sponsored-by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24861

4 years agoReplace snprintf() by SCTP_SNPRINTF() and let SCTP_SNPRINTF() map
tuexen [Tue, 19 May 2020 07:23:35 +0000 (07:23 +0000)]
Replace snprintf() by SCTP_SNPRINTF() and let SCTP_SNPRINTF() map
to snprintf() on FreeBSD. This allows to check for failures of snprintf()
on platforms other than FreeBSD kernel.

4 years agoRevert r361209:
tuexen [Tue, 19 May 2020 07:21:11 +0000 (07:21 +0000)]
Revert r361209:

cem noted that on FreeBSD snprintf() can not fail and code should not
check for that.

A followup commit will replace the usage of snprintf() in the SCTP
sources with a variadic macro SCTP_SNPRINTF, which will simply map to
snprintf() on FreeBSD and do a checking similar to r361209 on
other platforms.

4 years agoRevert r361237, it's fixed by r361231
lwhsu [Tue, 19 May 2020 07:16:09 +0000 (07:16 +0000)]
Revert r361237, it's fixed by r361231

PR: 246560
Sponsored by: The FreeBSD Foundation

4 years agoBelated RELNOTES entry for r361238
kevans [Tue, 19 May 2020 03:19:01 +0000 (03:19 +0000)]
Belated RELNOTES entry for r361238

This may get revised later if the larger change lands, but we should note
this.

4 years agozfs: reject read(2) of a dirfd with EISDIR
kevans [Tue, 19 May 2020 02:41:05 +0000 (02:41 +0000)]
zfs: reject read(2) of a dirfd with EISDIR

This is independent of the recently-discussed global change, which is still
in review/discussion stage.

This is effectively a measure for consistency in the ZFS world, where
FreeBSD was the only platform (as far as I could find) that allowed this.
What ZFS exposes is decidedly not useful for any real purposes, to
paraphrase (hopefully faithfully) jhb's findings when exploring this:

The size of a directory in ZFS is the number of directory entries within.
When reading a directory, you would instead get the leading part of its raw
contents; the amount you get being dictated by the "size," i.e. number of
directory entries. There's decidedly (luckily) no stack disclosure happening
here, though the behavior is bizarre and almost certainly a historical
accident.

This change has already been upstreamed to OpenZFS.

MFC after: 1 week

4 years agoTemporarily disable test case causes kernel panic in CI:
lwhsu [Tue, 19 May 2020 02:07:08 +0000 (02:07 +0000)]
Temporarily disable test case causes kernel panic in CI:

- sys.netinet.so_reuseport_lb_test.basic_ipv6

PR: 246560
Sponsored by: The FreeBSD Foundation

4 years agopowerpc/mmu: Don't use the cache instructions to zero pages
jhibbits [Tue, 19 May 2020 01:06:31 +0000 (01:06 +0000)]
powerpc/mmu: Don't use the cache instructions to zero pages

A page (even physmem) can be marked as cache-inhibited.  Attempting to use
'dcbz' to zero a page mapped cache-inhibited triggers an alignment
exception, which is fatal in kernel.  This was seen when testing hardware
acceleration with X on POWER9.

At some point in the future, this should be changed to a more straight
forward zero loop instead of bzero(), and a similar change be made to the
other pmaps.

Reported by: pkubaj@

4 years agoFix NULL-pointer bug from r361228.
karels [Tue, 19 May 2020 01:05:13 +0000 (01:05 +0000)]
Fix NULL-pointer bug from r361228.

Note that in_pcb_lport and in_pcb_lport_dest can be called with a NULL
local address for IPv6 sockets; handle it.  Found by syzkaller.

Reported by: cem
MFC after: 1 month

4 years agoblacklistd.conf.5: typo/grammar fixes
emaste [Tue, 19 May 2020 00:15:19 +0000 (00:15 +0000)]
blacklistd.conf.5: typo/grammar fixes

PR: 246467
Submitted by: Mike Lempriere

4 years agoRevert 357780, `dtrace -c` has been fixed in head`
lwhsu [Mon, 18 May 2020 23:43:48 +0000 (23:43 +0000)]
Revert 357780, `dtrace -c` has been fixed in head`

PR: 244053
Sponsored by: The FreeBSD Foundation

4 years agoAllow TCP to reuse local port with different destinations
karels [Mon, 18 May 2020 22:53:12 +0000 (22:53 +0000)]
Allow TCP to reuse local port with different destinations

Previously, tcp_connect() would bind a local port before connecting,
forcing the local port to be unique across all outgoing TCP connections
for the address family. Instead, choose a local port after selecting
the destination and the local address, requiring only that the tuple
is unique and does not match a wildcard binding.

Reviewed by: tuexen (rscheff, rrs previous version)
MFC after: 1 month
Sponsored by: Forcepoint LLC
Differential Revision: https://reviews.freebsd.org/D24781

4 years agoRemove assignment without effect.
tuexen [Mon, 18 May 2020 19:48:38 +0000 (19:48 +0000)]
Remove assignment without effect.

MFC after: 3 days

4 years agoDon't check an unsigned variable for being negative.
tuexen [Mon, 18 May 2020 19:35:46 +0000 (19:35 +0000)]
Don't check an unsigned variable for being negative.

MFC after: 3 days.

4 years agoRemove redundant assignment.
tuexen [Mon, 18 May 2020 19:23:01 +0000 (19:23 +0000)]
Remove redundant assignment.

MFC after: 3 days

4 years agoCleanup, no functional change intended.
tuexen [Mon, 18 May 2020 18:42:43 +0000 (18:42 +0000)]
Cleanup, no functional change intended.

MFC after: 3 days

4 years agofusefs: fix intermittency in some ENOENT tests
asomers [Mon, 18 May 2020 18:36:32 +0000 (18:36 +0000)]
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.

MFC after: 2 weeks

4 years agoAvoid an integer underflow.
tuexen [Mon, 18 May 2020 18:32:58 +0000 (18:32 +0000)]
Avoid an integer underflow.

MFC after: 3 days

4 years agoRemove redundant check.
tuexen [Mon, 18 May 2020 18:27:10 +0000 (18:27 +0000)]
Remove redundant check.

MFC after: 3 days

4 years agoCorrect the order of arguments to copyin() for Q_SETQUOTA.
jhb [Mon, 18 May 2020 16:47:44 +0000 (16:47 +0000)]
Correct the order of arguments to copyin() for Q_SETQUOTA.

MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24656

4 years agoGNU as: move deprecation message after option parsing
emaste [Mon, 18 May 2020 16:07:14 +0000 (16:07 +0000)]
GNU as: move deprecation message after option parsing

Some cmake test parses the output of the first line of as --version, and
emits an error if it does not contain some expected strings:

Checking whether the ASM compiler is GNU using "--version" did not match
"(GNU assembler)|(GCC)|(Free Software Foundation)"

Emit the deprecation message later, after parsing argv and thus --version.

PR: 246540
Reported by: dch
Sponsored by: The FreeBSD Foundation

4 years agoAllow the FACS and XFACS to be zero in acpidump.
andrew [Mon, 18 May 2020 15:05:59 +0000 (15:05 +0000)]
Allow the FACS and XFACS to be zero in acpidump.

These are allowed to be zero when the hardware reduced APCI flag is set

Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D23207

4 years agobhyve(8): Add the netgraph network backend decription to the manpage.
afedorov [Mon, 18 May 2020 15:03:52 +0000 (15:03 +0000)]
bhyve(8): Add the netgraph network backend decription to the manpage.

Reviewed by: vmaffione, bcr
Approved by: vmaffione (mentor)
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D24846

4 years agoFix logical condition by looking at usecs.
tuexen [Mon, 18 May 2020 15:02:15 +0000 (15:02 +0000)]
Fix logical condition by looking at usecs.

This issue was found by cpp-check running on the userland stack.

MFC after: 3 days

4 years agoWhitespace change.
tuexen [Mon, 18 May 2020 15:00:18 +0000 (15:00 +0000)]
Whitespace change.

MFC after: 3 days

4 years agoTemporarily disable failing case in CI of amd64:
lwhsu [Mon, 18 May 2020 12:36:28 +0000 (12:36 +0000)]
Temporarily disable failing case in CI of amd64:

- lib.libexecinfo.backtrace_test.backtrace_fmt_basic

PR: 246537
Sponsored by: The FreeBSD Foundation

4 years agoHandle failures of snprintf().
tuexen [Mon, 18 May 2020 10:07:01 +0000 (10:07 +0000)]
Handle failures of snprintf().

MFC after: 3 days

4 years agoAdd ebsnvme-id to EC2 AMIs and enable /dev/aws/disk
cperciva [Mon, 18 May 2020 02:14:25 +0000 (02:14 +0000)]
Add ebsnvme-id to EC2 AMIs and enable /dev/aws/disk

The ebsnvme-id utility exposes information about EC2 disks -- for
Elastic Block Store volumes, their volume IDs and "linux device
names", and for Instance Store (aka "Ephemeral") disks, their
serial numbers.

The dev_aws_disk rc.d script and associated devd.conf rule maintains
a tree under /dev/aws/disk:
/dev/aws/disk/ebs/<volume ID>
/dev/aws/disk/linuxname/<linux device name>
/dev/aws/disk/ephemeral/<serial number>
which are symlinks to the corresponding nda or nvd devices.

MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva

4 years agoRevert r360833, r360882: certctl rehash in installworld
kevans [Mon, 18 May 2020 01:48:55 +0000 (01:48 +0000)]
Revert r360833, r360882: certctl rehash in installworld

This was solving the correct-ish problem in the wrong place. Noted by
brooks; while he didn't request a prompt revert, doing so now will
facilitate proper testing for the revised version of this.

4 years agocertctl: don't fall over flat with relative DESTDIR
kevans [Mon, 18 May 2020 01:35:44 +0000 (01:35 +0000)]
certctl: don't fall over flat with relative DESTDIR

Up until now, all of our DESTDIR use has been with absolute paths. It turned
out that the cd in/out dance we do here breaks us down later on, as the
relative path no longer resolves.

Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're
inspecting, rather than cd'ing into it and globbing it up.

MFC after: 3 days

4 years agoAdd a function nfsm_set() to initialize "struct nfsrv_descript" for building
rmacklem [Mon, 18 May 2020 00:07:45 +0000 (00:07 +0000)]
Add a function nfsm_set() to initialize "struct nfsrv_descript" for building
mbuf lists.

This function is currently trivial, but will that will change when
support for building NFS messages in ext_pgs mbufs is added.
Adding support for ext_pgs mbufs is needed for KERN_TLS, which will
be used to implement nfs-over-tls.

4 years agoNon-functional changes, cleanups.
tuexen [Sun, 17 May 2020 22:31:38 +0000 (22:31 +0000)]
Non-functional changes, cleanups.

MFC after: 3 days

4 years agoAdd /etc/autofs/special_efs to EC2 AMIs
cperciva [Sun, 17 May 2020 21:54:59 +0000 (21:54 +0000)]
Add /etc/autofs/special_efs to EC2 AMIs

Since Amazon Elastic File System is only available within AWS, it seems
more appropriate to have this added only in EC2 AMIs rather than
"polluting" non-EC2 images with it.

Reviewed by: gjb
MFC after: 7 days
Relnotes: Amazon EFS filesystems can be automounted by enabling autofs
and placing "/efs -efs" into /etc/auto_master.
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D24791

4 years agolinuxkpi: Add offsetofend macro
manu [Sun, 17 May 2020 20:14:49 +0000 (20:14 +0000)]
linuxkpi: Add offsetofend macro

This calculate the offset of the end of the member in the given struct.
Needed by DRM in Linux v5.3

Sponsored-by: The FreeBSD Foudation
Differential Revision: https://reviews.freebsd.org/D24849

4 years agolinuxkpi: Add __mutex_init
manu [Sun, 17 May 2020 20:12:16 +0000 (20:12 +0000)]
linuxkpi: Add __mutex_init

Same as mutex_init, the lock_class_key argument seems to be only used for
debug in Linux, simply ignore it for now.
Needed by DRM in Linux v5.3

Sponsored-by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24848

4 years agolinuxkpi: Add atomic_dec_and_mutex_lock
manu [Sun, 17 May 2020 20:09:11 +0000 (20:09 +0000)]
linuxkpi: Add atomic_dec_and_mutex_lock

This function decrement the counter and if the result is 0 it acquires
the mutex and returns 1, if not it simply returns 0.
Needed by DRM from Linux v5.3

Sponsored-by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24847

4 years agoRemove redundant checks for nhop validity.
melifaro [Sun, 17 May 2020 15:32:36 +0000 (15:32 +0000)]
Remove redundant checks for nhop validity.
 Currently NH_IS_VALID() simly aliases to RT_LINK_IS_UP(), so we're
 checking the same thing twice.

In the near future the implementation of this check will be simpler,
 as there are plans to introduce control-plane interface status monitoring
 similar to ipfw interface tracker.

4 years agoAdd BE architectures support.
fsu [Sun, 17 May 2020 14:52:54 +0000 (14:52 +0000)]
Add BE architectures support.

Author of most initial version: pfg (https://reviews.freebsd.org/D23259)

Reviewed by:    pfg
MFC after:      3 months

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

4 years agoRestrict the max runp and runb return values in case of extents mapping.
fsu [Sun, 17 May 2020 14:10:46 +0000 (14:10 +0000)]
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
MFC after: 2 weeks

4 years agoFix incorrect inode link count check in case of rename.
fsu [Sun, 17 May 2020 14:03:13 +0000 (14:03 +0000)]
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.

4 years agoAdd inode bitmap tail initialization.
fsu [Sun, 17 May 2020 14:00:54 +0000 (14:00 +0000)]
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."

4 years agoReenable sys.geom.class.gate.ggate_test.ggated in CI
asomers [Sun, 17 May 2020 02:41:50 +0000 (02:41 +0000)]
Reenable sys.geom.class.gate.ggate_test.ggated in CI

Should be fixed by r360613

PR: 244737
Reported by: lwhsu

4 years ago[ath_rate_sample] Fix correct status when completing frames with short failures.
adrian [Sat, 16 May 2020 21:59:41 +0000 (21:59 +0000)]
[ath_rate_sample] Fix correct status when completing frames with short failures.

My preivous logic was a bit wrong.  This caused transmissions that failed due
to a mix of short and long retries to count intermediate rates as OK if the
LONG retry count indicated some retries had made it to this intermediate rate,
but the SHORT retry count was the one that caused the whole transmit to fail.

Now status is passed in again - and this is the status for the whole transmission -
and then update_stats() does some quick math to see if the current transmission
series hit its long retry count or not before updating things as a success
or failure.

4 years agosh/tests: Fix keywords on newly added test
jilles [Sat, 16 May 2020 19:38:58 +0000 (19:38 +0000)]
sh/tests: Fix keywords on newly added test

4 years agoEnsure that an stcb is not dereferenced when it is about to be
tuexen [Sat, 16 May 2020 19:26:39 +0000 (19:26 +0000)]
Ensure that an stcb is not dereferenced when it is about to be
freed.
This issue was found by SYZKALLER.

MFC after: 3 days

4 years ago[ath] Flip athratestats to use two columns for now.
adrian [Sat, 16 May 2020 18:49:37 +0000 (18:49 +0000)]
[ath] Flip athratestats to use two columns for now.

Yeah I have too many rates on the screen now...

4 years agoMove the devmatch rc.d script before netif in the boot process.
cperciva [Sat, 16 May 2020 18:37:48 +0000 (18:37 +0000)]
Move the devmatch rc.d script before netif in the boot process.

Prior to this change, using lagg to aggregate wired and wireless networks
was broken in the (relatively common) case where wifi drivers + firmware
are loaded by devmatch, since the interface didn't exist at the time when
the lagg interface was being created.

Suggested by: imp
MFC after: 3 days

4 years agosysctl: fix setting net.isr.dispatch during early boot
kaktus [Sat, 16 May 2020 17:05:44 +0000 (17:05 +0000)]
sysctl: fix setting net.isr.dispatch during early boot

Fix another collateral damage of r357614: netisr is initialised way before
malloc() is available hence it can't use sysctl_handle_string() that
allocates temporary buffer.  Handle that internally in
sysctl_netisr_dispatch_policy().

PR: 246114
Reported by: delphij
Reviewed by: kib
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D24858

4 years agosh: Fix double INTON with vfork
jilles [Sat, 16 May 2020 16:29:23 +0000 (16:29 +0000)]
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. As
of r360452, it causes the shell to abort when it would unsafely allocate or
free memory in certain ways.

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
Reported by: jbeich
MFC after: 2 weeks

4 years agocam: ANSIfy 0-argument function definitions
cem [Sat, 16 May 2020 14:33:08 +0000 (14:33 +0000)]
cam: ANSIfy 0-argument function definitions

No functional change.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D24854

4 years agoImplement synchronize_srcu_expedited() in the LinuxKPI.
hselasky [Sat, 16 May 2020 14:27:50 +0000 (14:27 +0000)]
Implement synchronize_srcu_expedited() in the LinuxKPI.

Differential Revision: https://reviews.freebsd.org/D24798
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years ago[ath] ok ok, fix the indenting now that I have 5 column packet sizes.
adrian [Sat, 16 May 2020 06:09:24 +0000 (06:09 +0000)]
[ath] ok ok, fix the indenting now that I have 5 column packet sizes.

Now things line up nicely again.  There's a lot of them, and I don't have a long
enough screen right now, but they at least line up right.

4 years ago[ath_rate_sample] Limit the tx schedules for A-MPDU ; don't take short retries
adrian [Sat, 16 May 2020 05:07:45 +0000 (05:07 +0000)]
[ath_rate_sample] Limit the tx schedules for A-MPDU ; don't take short retries
into account and remove the requirement that the MCS rate is "higher" if we're
 considering a new rate.

Ok, another fun one.

* In order for reliable non-software retried higher MCS rates, the TX schedules
  (inconsistently!) use hard-coded lower rates at the end of the schedule.
  Now, hard-coded is a problem because (a) it means that aggregate formation
  is limited by the SLOWEST rate, so I never formed large AMDU frames for
  3 stream rates, and (b) if the AP disables lower rates as base rates, it
  complains about "unknown rix" every frame you transmit at that rate.

  So, for now just disable the third and fourth schedule entry for AMPDUs.
  Now I'm forming 32k and 64k aggregates for the higher density MCS rates
  much more reliably.

  It would be much nicer if the rate schedule stuff wasn't fixed but instead
  I'd just populate ath_rc_series[] when I fetch the rates.  This is all a
  holdover of ye olde pre-11n stuff and I really just need to nuke it.

  But for now, ye hack.

* The check for "is this MCS rate better" based on MCS itself is just garbage.
  It meant things like going MCS0->7 would be fine, and say 0->8->16 is fine,
  (as they're equivalent encoding but 1,2,3 spatial streams), BUT it meant
  going something like MCS7->11 would fail even though it's likely that
  MCS11 would just be better, both for EWMA/BER and throughput.

  So for now just use the average tx time.  The "right" way for this comparison
  would be to compare PHY bitrates rather than MCS / rate indexes, but I'm not
  yet there.  The bit rates ARE available in the PHY index, but honestly
  I have a lot of other cleaning up to here before I think about that.

* Don't include the RTS/CTS retry count (and thus time) into the average tx time
  caluation.  It just makes temporarily failures make the rate look bad by
  QUITE A LOT, as RTS/CTS exchanges are (a) long, and (b) mostly irrelevant
  to the actual rate being tried.  If we keep hitting RTS/CTS failures then
  there's something ELSE wrong on the channel, not our selected rate.

4 years agoprocctl(2): correct a minor cut-n-pasto
kevans [Sat, 16 May 2020 04:52:29 +0000 (04:52 +0000)]
procctl(2): correct a minor cut-n-pasto

This is clearly describing PROC_PROTMAX_FORCE_DISABLE, rather than
PROC_ASL_FORCE_DISABLE.

Submitted by: sigsys@gmail.com

4 years agoelftoolchain: Add powerpc64 definition to elftoolchain config
jhibbits [Sat, 16 May 2020 03:52:30 +0000 (03:52 +0000)]
elftoolchain: Add powerpc64 definition to elftoolchain config

powerpc is already in place, but powerpc64 is needed separately.

4 years agoAdd BSM record conversion for a number of syscalls:
csjp [Sat, 16 May 2020 03:45:15 +0000 (03:45 +0000)]
Add BSM record conversion for a number of syscalls:

- thr_kill(2) and thr_exit(2) generally (no argument auditing here.
- A set of syscalls for the process descriptor family, specifically:
  pdfork(2), pdgetpid(2) and pdkill(2)

  For these syscalls, audit the file descriptor. In the case of pdfork(2)
  a pointer to an integer (file descriptor) is passed in as an argument.
  We audit the post initialized file descriptor (not the random garbage
  that would have been passed in). We will also audit the child process
  which was created from the fork operation (similar to what is done for
  the fork(2) syscall).

  pdkill(2) we audit the signal value and fd, and finally pdgetpid(2)
  just the file descriptor:

- Following is a sample of the produced audit trails:

  header,111,11,pdfork(2),0,Sat May 16 03:07:50 2020, + 394 msec
  argument,0,0x39d,child PID
  argument,2,0x2,flags
  argument,1,0x8,fd
  subject,root,root,0,root,0,924,0,0,0.0.0.0
  return,success,925

  header,79,11,pdgetpid(2),0,Sat May 16 03:07:50 2020, + 394 msec
  argument,1,0x8,fd
  subject,root,root,0,root,0,924,0,0,0.0.0.0
  return,success,0
  trailer,79

  header,135,11,pdkill(2),0,Sat May 16 03:07:50 2020, + 395 msec
  argument,1,0x8,fd
  argument,2,0xf,signal
  process_ex,root,root,0,root,0,925,0,0,0.0.0.0
  subject,root,root,0,root,0,924,0,0,0.0.0.0
  return,success,0
  trailer,135

MFC after:      1 week

4 years agopowerpc/qoriq: Add more devices to config for desktop usage
jhibbits [Sat, 16 May 2020 03:33:28 +0000 (03:33 +0000)]
powerpc/qoriq: Add more devices to config for desktop usage

The most likely users of the QORIQ64 config nowadays are users of AmigaOne
X5000 systems, which are desktops.  They need a framebuffer and
keyboard/mouse, so add these to the config so it works by default once
drm-current-kmod is installed.

4 years agolibalias: retire cuseeme support
emaste [Sat, 16 May 2020 02:29:10 +0000 (02:29 +0000)]
libalias: retire cuseeme support

The CU-SeeMe videoconferencing client and associated protocol is at this
point a historical artifact; there is no need to retain support for this
protocol today.

Reviewed by: philip, markj, allanjude
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24790

4 years ago[ath_rate_sample] Fix logic for determining whether to bump up an MCS rate.
adrian [Sat, 16 May 2020 01:56:06 +0000 (01:56 +0000)]
[ath_rate_sample] Fix logic for determining whether to bump up an MCS rate.

* Fix formatting, cause reasons;
* Put back the "and the chosen rate is within 90% of the current rate" logic;
* Ensure the best rate and the current rate aren't the same; this ...
* ... fixes the packets_since_switch[] tracking to actually conut how many
  frames since the rate switched, so now I know how stable stuff is; and
* Ensure that MCS can go up to a higher MCS at this or any other spatial stream.
  My previous quick hack attempt was doing > rather than >= so you had to go
  to both a higher root MCS rate (0..7) and spatial stream. Eg, you couldn't
  go from MCS0 (1ss) to MCS8 (2ss) this way.

The best rate and switching rate logic still have a bunch more work to do
because they're still quite touchy when it comes to average tx time but at least
now it's choosing higher rates correctly when it wants to try a higher rate.

Tested:

* AR9380, STA mode

4 years agoSend Lid status notification via devd from acpi_lid_status_update.
cperciva [Sat, 16 May 2020 01:50:28 +0000 (01:50 +0000)]
Send Lid status notification via devd from acpi_lid_status_update.

Some laptops don't send ACPI "lid status changed" notifications upon
opening the lid if the system was currently suspended.  In r358219
this was partially fixed, updating the "lid_status" variable upon
resume even if there is no "status changed" notification from ACPI.

Unfortunately the fix in r358219 did not include notifying userland
via devd; this causes problems on systems using upowerd (e.g. KDE),
since upowerd remembers the most recent devd notification about the
lid status rather than querying the sysctl to get the current status.

This showed up as two symptoms when KDE's "When laptop lid closed: Sleep"
option is set:
1. 50% of the time, closing the lid would not trigger S3 sleep.
2. 50% of the time, plugging/unplugging AC power would trigger S3 sleep.

PR: 246477
MFC after: 3 days