]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agols(1): Use \& as an escape character for the ',' option
Gordon Bergling [Sat, 10 Oct 2020 13:39:13 +0000 (13:39 +0000)]
ls(1): Use \& as an escape character for the ',' option

Reported by: karels@, xtouqh at hotmail dot com
MFC after: 1 day

3 years agocpuset(1): Fix a typo
Gordon Bergling [Sat, 10 Oct 2020 13:01:04 +0000 (13:01 +0000)]
cpuset(1): Fix a typo

- 'at at' -> 'at a'

MFC after: 1 week

3 years agosigevent(3): Fix a typo
Gordon Bergling [Sat, 10 Oct 2020 12:06:39 +0000 (12:06 +0000)]
sigevent(3): Fix a typo

- asychronous -> asynchronous

MFC after: 1 week

3 years agodtrace_audit(4): Fix a typo
Gordon Bergling [Sat, 10 Oct 2020 12:05:54 +0000 (12:05 +0000)]
dtrace_audit(4): Fix a typo

- asynchonously -> asynchronously

MFC after: 1 week

3 years agoarm: Check dtb version against the one we're expecting to find
Emmanuel Vadot [Sat, 10 Oct 2020 07:20:59 +0000 (07:20 +0000)]
arm: Check dtb version against the one we're expecting to find

Reviewed by: imp, emaste, mmel
Differential Revision: https://reviews.freebsd.org/D26725

3 years agoBrand our DTS with the Linux version it was imported from
Emmanuel Vadot [Sat, 10 Oct 2020 07:18:51 +0000 (07:18 +0000)]
Brand our DTS with the Linux version it was imported from

DTS must be synced with the kernel, add a freebsd,dts-version string in
the root node of each DTS that we compile so we can later in the kernel
check that it contain a correct value.

Reviewed by: imp, mmel
Differential Revision: https://reviews.freebsd.org/D26724

3 years agozfs: use cache_rename
Mateusz Guzik [Sat, 10 Oct 2020 04:18:49 +0000 (04:18 +0000)]
zfs: use cache_rename

3 years agovfs: support lockless dirfd lookups
Mateusz Guzik [Sat, 10 Oct 2020 03:48:17 +0000 (03:48 +0000)]
vfs: support lockless dirfd lookups

3 years agomodules/crypto: reenable assembly optimized skein implementation
Ed Maste [Sat, 10 Oct 2020 01:13:14 +0000 (01:13 +0000)]
modules/crypto: reenable assembly optimized skein implementation

r366344 corrected the optimized amd64 skein assembly implementation, so
we can now enable it again.

Also add a dependency on this Makefile for the skein_block object, so
that it will be rebuit (similar to r366362).

PR: 248221
Sponsored by: The FreeBSD Foundation

3 years agoModify mountd.c so that it does not always malloc 4K for the map credentials.
Rick Macklem [Sat, 10 Oct 2020 00:01:40 +0000 (00:01 +0000)]
Modify mountd.c so that it does not always malloc 4K for the map credentials.

r362163 upgraded mountd so that it could handle MAX_NGROUPS
groups for the anonymous user credentials (the ones provided by
-maproot and -mapall exports options).
The problem is that this resulted in every export structure growing by
about 4Kbytes, because the cr_groups field went from 16->MAX_NGROUPS.

This patch fixes this by only including a small 32 element cr_groups in the
structure and then malloc()'ng cr_groups when a larger one is needed.
The value of SMALLNGROUPS is arbitrarily set to 32, assuming most users
used by -maproot or -mapall will be in <= 32 groups.

Reviewed by: kib, freqlabs
Differential Revision: https://reviews.freebsd.org/D26521

3 years agoUse unlocked page lookup for inmem() to avoid object lock contention
Bryan Drewery [Fri, 9 Oct 2020 23:49:42 +0000 (23:49 +0000)]
Use unlocked page lookup for inmem() to avoid object lock contention

Reviewed By: kib, markj
Submitted by: mlaier
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D26653

3 years agocxgbe(4): More fixes for the T6 FCS error counter.
Navdeep Parhar [Fri, 9 Oct 2020 22:23:39 +0000 (22:23 +0000)]
cxgbe(4): More fixes for the T6 FCS error counter.

r365732 was the first attempt to get an accurate count but it was
writing to some read-only registers to clear them and that obviously
didn't work.  Instead, note the counter's value when it is supposed to
be cleared and subtract it from future readings.

dev.<port>.stats.rx_fcs_error should not be serviced from the MPS
register for T6.

The stats.* sysctls should all use T5_PORT_REG for T5 and above.  This
must have been missed in the initial T5 support years ago.  Fix it while
here.

MFC after: 3 days
Sponsored by: Chelsio Communications

3 years agovfs: fix a panic when truncating comming from copy_file_range
Mateusz Guzik [Fri, 9 Oct 2020 20:31:42 +0000 (20:31 +0000)]
vfs: fix a panic when truncating comming from copy_file_range

Truncating requires an exclusive lock, but it was not taken if the
filesystem indicates support for shared writes. This only concerns
ZFS.

In particular fixes cp of files which have trailing holes.

Reported by: bdrewery

3 years agoDon't invoke semunload() if seminit() fails during MOD_LOAD.
John Baldwin [Fri, 9 Oct 2020 20:20:42 +0000 (20:20 +0000)]
Don't invoke semunload() if seminit() fails during MOD_LOAD.

The module handler code invokes a MOD_UNLOAD event immediately if
MOD_LOAD fails.  The result was that if seminit() failed, semunload()
was invoked twice.  semunload() is not idempotent however and would
try to remove it's process_exit eventhandler twice resulting in a
panic.

Reviewed by: kib, markj
Obtained from: CheriBSD
MFC after: 1 month
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26696

3 years agoFix a few mandoc issues
Gordon Bergling [Fri, 9 Oct 2020 19:12:44 +0000 (19:12 +0000)]
Fix a few mandoc issues

- skipping paragraph macro: Pp after Sh
- sections out of conventional order: Sh EXAMPLES
- whitespace at end of input line
- normalizing date format

3 years agocache: fix vexec panic when racing against vgone
Mateusz Guzik [Fri, 9 Oct 2020 19:10:00 +0000 (19:10 +0000)]
cache: fix vexec panic when racing against vgone

Use of dead_vnodeops would result in a panic instead of returning the intended
EOPNOTSUPP error.

While here make sure to abort, not just try to return a partial result.
The former allows the regular lookup to restart from scratch, while the latter
makes it stuck with an unusable vnode.

Reported by: kevans

3 years agobpf(4): Update the man page to reflect reality
Gordon Bergling [Fri, 9 Oct 2020 15:50:50 +0000 (15:50 +0000)]
bpf(4): Update the man page to reflect reality

PR: 131918
Submitted by: guy at alum dot mit dot edu
Reviewed by: gnn, gbe
Approved by: gnn
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25993

3 years agoRemove gratuitous use of '' around arguments
Warner Losh [Fri, 9 Oct 2020 15:45:34 +0000 (15:45 +0000)]
Remove gratuitous use of '' around arguments

There's no need to use ' here, so remove it. This use causes no
problems, but is a bad example.

3 years agoAvoid using single quotes in arguments to logger.
Warner Losh [Fri, 9 Oct 2020 15:29:05 +0000 (15:29 +0000)]
Avoid using single quotes in arguments to logger.

Single quotes interfere with the workaround put in with r335753 and
aren't necessary in this case. I believe that all the underling issues
with r335753 have been corrected, but need to do more extensive
followup before reverting it as a bad idea.

PR: 240411
MFC After: 2 days (to give it time to get into 12.2)

3 years agocol(1): Fix a couple of bugs
Mark Johnston [Fri, 9 Oct 2020 15:27:37 +0000 (15:27 +0000)]
col(1): Fix a couple of bugs

- When flushing extra lines after all input has been processed, make
  sure that local state is reinitialized correctly.
- When -f is specified, make sure to end output with a full newline.
- Fix some style issues and update comments.
- Add some regression tests.

PR: 249308
Submitted by: Yang Zhong <yzhong@freebsdfoundation.org>
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D26536

3 years agosyslogd: Avoid trimming host names in RFC 5424 mode
Mark Johnston [Fri, 9 Oct 2020 15:19:29 +0000 (15:19 +0000)]
syslogd: Avoid trimming host names in RFC 5424 mode

RFC 5424 says that implementations should log hostnames in FQDN
format.  Only trim host names in RFC 3164 mode.

PR: 250014
Submitted by: Dmitry Wagin <dmitry.wagin@ya.ru>
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D26644

3 years agoFix a few mandoc issues
Gordon Bergling [Fri, 9 Oct 2020 15:14:19 +0000 (15:14 +0000)]
Fix a few mandoc issues

- whitespace at end of input line
- skipping paragraph macro: Pp at the end of Sh
- new sentence, new line
- consider using OS macro: Fx
- AUTHORS section without An macro
- skipping paragraph macro: Pp before Ss

3 years agoRISC-V LINT kernel config
Mitchell Horne [Fri, 9 Oct 2020 14:45:41 +0000 (14:45 +0000)]
RISC-V LINT kernel config

Create the RISC-V NOTES and LINT files. As of r366559, LINT configs are
no longer generated but checked in to the tree.

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

3 years agoAdd DSCP support for network QoS to iscsi initiator.
Richard Scheffenegger [Fri, 9 Oct 2020 14:33:09 +0000 (14:33 +0000)]
Add DSCP support for network QoS to iscsi initiator.

Allow the DSCP codepoint also to be configurable
for the traffic in the direction from the initiator
to the target, such that writes and any requests
are also treated in the appropriate QoS class.

Reviewed by: mav
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26714

3 years agoFix a few mandoc issues
Gordon Bergling [Fri, 9 Oct 2020 14:03:45 +0000 (14:03 +0000)]
Fix a few mandoc issues

- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order
- normalizing date format
- AUTHORS section without An macro

3 years agoAdd iommu_get_dev_ctx() helper that allows to instantiate an iommu context
Ruslan Bukin [Fri, 9 Oct 2020 13:11:14 +0000 (13:11 +0000)]
Add iommu_get_dev_ctx() helper that allows to instantiate an iommu context
for a given device_t.

Submitted by: andrew
Reviewed by: kib
Sponsored by: DARPA, AFRL

3 years agoStop sending tiny new data segments during SACK recovery
Richard Scheffenegger [Fri, 9 Oct 2020 12:44:56 +0000 (12:44 +0000)]
Stop sending tiny new data segments during SACK recovery

Consider the currently in-use TCP options when
calculating the amount of new data to be injected during
SACK loss recovery. That addresses the effect that very small
(new) segments could be injected on partial ACKs while
still performing a SACK loss recovery.

Reported by: Liang Tian
Reviewed by: tuexen, chengc_netapp.com
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26446

3 years agoAdd IP(V6)_VLAN_PCP to set 802.1 priority per-flow.
Richard Scheffenegger [Fri, 9 Oct 2020 12:06:43 +0000 (12:06 +0000)]
Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow.

This adds a new IP_PROTO / IPV6_PROTO setsockopt (getsockopt)
option IP(V6)_VLAN_PCP, which can be set to -1 (interface
default), or explicitly to any priority between 0 and 7.

Note that for untagged traffic, explicitly adding a
priority will insert a special 801.1Q vlan header with
vlan ID = 0 to carry the priority setting

Reviewed by: gallatin, rrs
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26409

3 years agoFix EINVAL message when CPU binding information is requested for IRQ.
Andrey V. Elsukov [Fri, 9 Oct 2020 11:24:19 +0000 (11:24 +0000)]
Fix EINVAL message when CPU binding information is requested for IRQ.

`cpuset -g -x N` along with requested information always prints
message `cpuset: getdomain: Invalid argument'. The EINVAL is returned
from kern_cpuset_getdomain(), since it doesn't expect CPU_LEVEL_WHICH
and CPU_WHICH_IRQ parameters.

To fix the error, do not call cpuset_getdomain() when `-x' is specified.

MFC after: 1 week

3 years agoExtend netstat to display TCP stack and detailed congestion state (2)
Richard Scheffenegger [Fri, 9 Oct 2020 10:55:19 +0000 (10:55 +0000)]
Extend netstat to display TCP stack and detailed congestion state (2)

Extend netstat to display TCP stack and detailed congestion state

Adding the "-c" option used to show detailed per-connection
congestion control state for TCP sessions.

This is one summary patch, which adds the relevant variables into
xtcpcb. As previous "spare" space is used, these changes are ABI
compatible.

Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26518

3 years agoExtend netstat to display TCP stack and detailed congestion state
Richard Scheffenegger [Fri, 9 Oct 2020 10:07:41 +0000 (10:07 +0000)]
Extend netstat to display TCP stack and detailed congestion state

Adding the "-c" option used to show detailed per-connection
congestion control state for TCP sessions.

This is one summary patch, which adds the relevant variables into
xtcpcb. As previous "spare" space is used, these changes are ABI
compatible.

Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26518

3 years agoMFV: r366539
Jung-uk Kim [Fri, 9 Oct 2020 05:27:02 +0000 (05:27 +0000)]
MFV: r366539

Merge ACPICA 20200925.

3 years agoCorrect the primary to find(1)
Li-Wen Hsu [Fri, 9 Oct 2020 04:03:57 +0000 (04:03 +0000)]
Correct the primary to find(1)

Sponsored by: The FreeBSD Foundation

3 years agoRemove now-unused files
Warner Losh [Fri, 9 Oct 2020 01:48:21 +0000 (01:48 +0000)]
Remove now-unused files

makeLINT.mk isn't needed or used anymore, remove it and all the files
it uses.

Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D26540

3 years agoCreate in-tree LINT files
Warner Losh [Fri, 9 Oct 2020 01:48:14 +0000 (01:48 +0000)]
Create in-tree LINT files

Now that config(8) has supported include for 19 years, transition to
including the NOTES files. include support didn't exist at the time,
nor did the envvar stuff recently added. Now that it does, eliminate
the building of LINT files by just including everything you need.

Note: This may cause conflicts with updating in some cases.
find sys -name LINT\* -rm
is suggested across this commit to remove the generated LINT
files.

Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D26540

3 years agoMake vn_generic_copy_file_range() interruptible via a signal.
Rick Macklem [Fri, 9 Oct 2020 01:04:28 +0000 (01:04 +0000)]
Make vn_generic_copy_file_range() interruptible via a signal.

Without this patch, when vn_generic_copy_file_range() is
doing a large copy, it will remain in the function for a
considerable amount of time, delaying handling of any
outstanding signals until the copy completes.

This patch adds checks for signals that need to be
processed after each successful data copy cycle.
When sig_intr() returns non-zero, vn_generic_copy_file_range()
will return.
The check "if (len < savlen)" ensures that some data
has been copied, so that progress will be made.

Note that, since copy_file_range(2) is allowed to
return fewer bytes copied than requested, it
will never return EINTR/ERESTART when sig_intr()
returns non-zero.

Reviewed by: kib, asomers
Differential Revision: https://reviews.freebsd.org/D26620

3 years agoStop ignoring makeLINT generated files
Warner Losh [Fri, 9 Oct 2020 00:27:45 +0000 (00:27 +0000)]
Stop ignoring makeLINT generated files

We're going to check these files in shortly since we don't need to
generate them anymore. Generated files cause issues for different work
flows anyway.

Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D26540

3 years agoEliminate building LINT makefiles
Warner Losh [Fri, 9 Oct 2020 00:27:40 +0000 (00:27 +0000)]
Eliminate building LINT makefiles

LINT config files are about to be checked in directly. Eliminate
building them by hand here from NOTES files.

Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D26540

3 years agoInitial support for implementing the bootXXX.efi workaround
Warner Losh [Fri, 9 Oct 2020 00:16:26 +0000 (00:16 +0000)]
Initial support for implementing the bootXXX.efi workaround

Too many version of UEFI firmware (so far only confirmed on amd64)
don't really support efibootmgr selection of boot. That's the most
reliable, when it works, since there's no guesswork. However, many do
not save, unmolested, the variables that efibootmgr sets, so as a
fallback we also install loader.efi as bootXXX.efi (where XXX is
either aa64 or x64) if it doesn't already exist in /efi/boot on the
ESP. The standard only defines this for removable devices, but it's
almost ubiquitously used as a fallback. Many BIOSes implement a drive
selection feature that takes over the efibootmgr protocol, rendinering
it useless (either generally, or for those vendors not on the short
list). bootxxx.efi works around this. However, we don't install it
unconditionally there, as that breaks some popular multi-boot setups.

MFC After: 1 week
Differential Revision: https://reviews.freebsd.org/D26428

3 years agovm_page_dump_index_to_pa(): Add braces to the expression involving + and &.
Konstantin Belousov [Thu, 8 Oct 2020 22:46:15 +0000 (22:46 +0000)]
vm_page_dump_index_to_pa(): Add braces to the expression involving + and &.

The precedence of the '&' operator is less than of '+'.  Added braces
do change the order of evaluation into the natural one, in my opinion.
On the other hand, the value of the expression should not change since
all elements should have page-aligned values.

This fixes a gcc warning reported.

Reported by: adrian
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agoDo not leak B_BARRIER.
Konstantin Belousov [Thu, 8 Oct 2020 22:41:02 +0000 (22:41 +0000)]
Do not leak B_BARRIER.

Normally when a buffer with B_BARRIER is written, the flag is cleared
by g_vfs_strategy() when creating bio.  But in some cases FFS buffer
might not reach g_vfs_strategy(), for instance when copy-on-write
reports an error like ENOSPC.  In this case buffer is returned to
dirty queue and might be written later by other means.  Among then
bdwrite() reasonably asserts that B_BARRIER is not set.

In fact, the only current use of B_BARRIER is for lazy inode block
initialization, where write of the new inode block is fenced against
cylinder group write to mark inode as used.  The situation could be
seen that we break dependency by updating cg without written out
inode.  Practically since CoW was not able to find space for a copy of
inode block, for the same reason cg group block write should fail.

Reported by: pho
Discussed with: chs, imp, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D26511

3 years agosig_intr(9): return early if AST is not scheduled.
Konstantin Belousov [Thu, 8 Oct 2020 22:34:34 +0000 (22:34 +0000)]
sig_intr(9): return early if AST is not scheduled.

Check td_flags for relevant AST requests lock-less.  This opens the
race slightly wider where sig_intr() returns false negative, but might
be it is worth it.

Requested by: mjg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agoDo not allow to use O_BENEATH as an oracle.
Konstantin Belousov [Thu, 8 Oct 2020 22:31:11 +0000 (22:31 +0000)]
Do not allow to use O_BENEATH as an oracle.

Specifically, if lookup() returned any error and the topping directory
was not latched, which means that (non-existent) path did not returned
to the topping location, give ENOTCAPABLE a priority over the lookup()
error.

PR: 249960
Reviewed by: emaste, ngie
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D26695

3 years ago[PowerPC] add machdep.uprintf_signal sysctl
Alfredo Dal'Ava Junior [Thu, 8 Oct 2020 22:00:31 +0000 (22:00 +0000)]
[PowerPC] add machdep.uprintf_signal sysctl

Add support for sysctl 'machdep.uprintf_signal' that prints debugging
information on trap signal.

Reviewed by: jhibbits, luporl, bdragon
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D26004

3 years agotimer_restore is now unused, remove it
Warner Losh [Thu, 8 Oct 2020 20:56:11 +0000 (20:56 +0000)]
timer_restore is now unused, remove it

apm was the only consumer of timer_restore. Now that it's gone, this
can be removed.

3 years agoRemove APM BIOS support
Warner Losh [Thu, 8 Oct 2020 20:56:06 +0000 (20:56 +0000)]
Remove APM BIOS support

APM BIOS was relevant only to early laptops (approximately P166 or
P200 and slower). These have not been relevant for a long time, and
this code has been untested for a long time (as far as I can
tell). The APM compat code in ACPI and the apm(8) command is not being
retired. Both of these items are still in use (apm(8) is more
scriptable than the replacement acpiconf, for the most part). This has
been commented out of i386 GENERIC since 2002. This code is not
relevant to any other port.

Discussed on: arch@

3 years agoRemove apm screen saver.
Warner Losh [Thu, 8 Oct 2020 20:56:00 +0000 (20:56 +0000)]
Remove apm screen saver.

APM BIOS support is about to be removed. Remove the apm screen saver
and its module. They are about to be irrelevant.

3 years agoRemove apm module
Warner Losh [Thu, 8 Oct 2020 20:55:55 +0000 (20:55 +0000)]
Remove apm module

The apm code is about to be removed. Remove the module since it's
about to be useless.

3 years agoFix a loop condition
Mitchell Horne [Thu, 8 Oct 2020 18:29:17 +0000 (18:29 +0000)]
Fix a loop condition

The correct way to identify the end of the metadata is two adjacent
entries set to zero/MODINFO_END. I made a typo and this was checking the
first entry twice.

Reported by: rpokala
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

3 years agoAdd a routine to dump boot metadata
Mitchell Horne [Thu, 8 Oct 2020 18:02:05 +0000 (18:02 +0000)]
Add a routine to dump boot metadata

The boot metadata (also referred to as modinfo, or preload metadata)
provides information about the size and location of the kernel,
pre-loaded modules, and other metadata (e.g. the EFI framebuffer) to be
consumed during by the kernel during early boot. It is encoded as a
series of type-length-value entries and is usually constructed by
loader(8) and passed to the kernel. It is also faked on some
architectures when booted by other means.

Although much of the module information is available via kldstat(8),
there is no easy way to debug the metadata in its entirety. Add some
routines to parse this data and allow it to be printed to the console
during early boot or output via a sysctl.

Since the output can be lengthly, printing to the console is gated
behind the debug.dump_modinfo_at_boot kenv variable as well as the
BOOTVERBOSE flag. The sysctl to print the metadata is named
debug.dump_modinfo.

Reviewed by: tsoome
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26687

3 years agoRace in 32-bit fixed
Warner Losh [Thu, 8 Oct 2020 17:30:05 +0000 (17:30 +0000)]
Race in 32-bit fixed

Use install insteald of install.sh for 32-bit builds to fight races there.

Reviewed by: markj

3 years agoImport ACPICA 20200925.
Jung-uk Kim [Thu, 8 Oct 2020 16:44:28 +0000 (16:44 +0000)]
Import ACPICA 20200925.

3 years ago[pf] /etc/rc.d/pf should REQUIRE routing
Pawel Biernacki [Thu, 8 Oct 2020 11:45:10 +0000 (11:45 +0000)]
[pf] /etc/rc.d/pf should REQUIRE routing

When a system with pf_enable="YES" in /etc/rc.conf uses hostnames in
/etc/pf.conf, these hostnames cannot be resolved via external nameservers
because the default route is not yet set. This results in an empty
(all open) ruleset.

Since r195026 already put netif back to REQUIRE, this change does not affect
the issue that the firewall should rather have been setup before any
network traffic can occur.

PR: 211928
Submitted by: Robert Schulze
Reported by: Robert Schulze
Tested by: Mateusz Kwiatkowski
No objections from: kp
MFC after: 3 days

3 years agoTry a bit harder to get the USB device descriptor in case the initial read fails.
Hans Petter Selasky [Thu, 8 Oct 2020 11:30:22 +0000 (11:30 +0000)]
Try a bit harder to get the USB device descriptor in case the initial read fails.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoThe ethernet header structure is read-only. Add const keyword.
Hans Petter Selasky [Thu, 8 Oct 2020 11:25:19 +0000 (11:25 +0000)]
The ethernet header structure is read-only. Add const keyword.

(This is a diff reduction towards D26254)

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoRemove yet another useless assignment, adding a KASSERT just in case.
Edward Tomasz Napierala [Thu, 8 Oct 2020 11:04:32 +0000 (11:04 +0000)]
Remove yet another useless assignment, adding a KASSERT just in case.

Reviewed by: kp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26698

3 years agoAllow evdev's rcpt_mask and sysmouse_t_axis parameters to be specified in
Hans Petter Selasky [Thu, 8 Oct 2020 10:59:49 +0000 (10:59 +0000)]
Allow  evdev's rcpt_mask and sysmouse_t_axis parameters to be specified in
/boot/loader.conf .

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agocxgbe(4): knobs to drop various kinds of undesirable frames on ingress.
Navdeep Parhar [Thu, 8 Oct 2020 10:00:13 +0000 (10:00 +0000)]
cxgbe(4): knobs to drop various kinds of undesirable frames on ingress.

These kind of drops come for free in the sense that they do not use the
filter TCAM or any other resource that wouldn't normally be used during
rx.  Frames dropped by the hardware get counted in the MAC's rx stats
but are not delivered to the driver.

hw.cxgbe.attack_filter
Set to 1 to enable the "attack filter".  Default is 0.  The attack
filter will drop an incoming frame if any of these conditions is true:
src ip/ip6 == dst ip/ip6; tcp and src/dst ip is not unicast; src/dst ip
is loopback (127.x.y.z); src ip6 is not unicast; src/dst ip6 is loopback
(::1/128) or unspecified (::/128); tcp and src/dst ip6 is mcast
(ff00::/8).

hw.cxgbe.drop_ip_fragments
Set to 1 to drop all incoming IP fragments.  Default is 0.  Note that
this drops valid frames.

hw.cxgbe.drop_pkts_with_l2_errors
Set to 1 to drop incoming frames with Layer 2 length or checksum errors.
Default is 1.

hw.cxgbe.drop_pkts_with_l3_errors
Set to 1 to drop incoming frames with IP version, length, or checksum
errors.  Default is 0.

hw.cxgbe.drop_pkts_with_l4_errors
Set to 1 to drop incoming frames with Layer 4 length, checksum, or other
errors.  Default is 0.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

3 years agoImport tzdata 2020b
Philip Paeps [Thu, 8 Oct 2020 00:35:36 +0000 (00:35 +0000)]
Import tzdata 2020b

Changes: https://github.com/eggert/tz/blob/2020b/NEWS

MFC after: 3 days

3 years agoImport tzdata 2020b
Philip Paeps [Thu, 8 Oct 2020 00:28:03 +0000 (00:28 +0000)]
Import tzdata 2020b

3 years agoHandle kmod local relocation failures gracefully
Mitchell Horne [Wed, 7 Oct 2020 23:14:49 +0000 (23:14 +0000)]
Handle kmod local relocation failures gracefully

It is possible for elf_reloc_local() to fail in the unlikely case of
an unsupported relocation type. If this occurs, do not continue to
process the file.

Reviewed by: kib, markj (earlier version)
MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26701

3 years agonet80211: whitespace
Bjoern A. Zeeb [Wed, 7 Oct 2020 22:52:24 +0000 (22:52 +0000)]
net80211: whitespace

Fix indentation for the multi-line copies of
ieee80211_add_channel_list_5ghz() for the 3 bands.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years ago80211: ifconfig replace MS() with _IEEE80211_MASKSHIFT()
Bjoern A. Zeeb [Wed, 7 Oct 2020 22:29:26 +0000 (22:29 +0000)]
80211: ifconfig replace MS() with _IEEE80211_MASKSHIFT()

As we did in the kernel in r366112 replace the MS() macro with the version(s)
added to the kernel: _IEEE80211_MASKSHIFT().  Also provide its counter part.
This will later allow use to use other macros defined in net80211 headers
here in ifconfig.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agoLinuxKPI: add a bitfield.h implementation.
Bjoern A. Zeeb [Wed, 7 Oct 2020 22:07:26 +0000 (22:07 +0000)]
LinuxKPI: add a bitfield.h implementation.

This code was iteratively implemented during the work on various WiFi
drivers -- from individual functions to a macro-created implementations
for the various bit sized needed (and then extended to more for
comepleteness). Some of the bit combinations do not seem to make sense
so are left out.

The __bf_shf(x) was obtained from D26681 [1].

Requested by: manu [1]
Reviewed by: hselasky, manu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26708

3 years ago80211: non-functional changes
Bjoern A. Zeeb [Wed, 7 Oct 2020 21:56:58 +0000 (21:56 +0000)]
80211: non-functional changes

Sort a few VHT160 and 80+80 lines, update some comments, and remove
a superfluous ','.

No functional changes intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agobhyveload(8): Implement loader_callbacks::diskwrite
Conrad Meyer [Wed, 7 Oct 2020 20:31:13 +0000 (20:31 +0000)]
bhyveload(8): Implement loader_callbacks::diskwrite

The method was optional prior to r365938, which made it mandatory but did add
any test that an implementation provides the method nor implement it for
bhyveload.  The code path might not be hit unless the user's loader was
configured to write to a file on disk, such as with nextboot(8).

Reviewed by: grehan, tsoome
Approved by: bhyve
X-MFC-With: r365938
Differential Revision: https://reviews.freebsd.org/D26710

3 years agoPrint symbol index for unsupported relocation types
Mitchell Horne [Wed, 7 Oct 2020 18:48:10 +0000 (18:48 +0000)]
Print symbol index for unsupported relocation types

It is unlikely, but possible, that an unrecognized or unsupported
relocation type is encountered while trying to load a kernel module. If
this occurs we should offer the symbol index as a hint to the user.

While here, fix some small style issues.

Reviewed by: markj, kib (amd64 part, in D26701)
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

3 years agoProperly cleanup driver during remove_one() in mlx5core.
Hans Petter Selasky [Wed, 7 Oct 2020 17:46:49 +0000 (17:46 +0000)]
Properly cleanup driver during remove_one() in mlx5core.

Cleanup all host resources, SYSCTLs, MSIX vectors and memory used
by the host and only leave the device allocated memory behind, if any,
because it may still be in use, when the PCI remove function is called.
Else future probe calls may fail due to SYSCTLs already existing.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMinor cleanups.
Michael Tuexen [Wed, 7 Oct 2020 15:22:48 +0000 (15:22 +0000)]
Minor cleanups.

MFC after: 3 days

3 years agoul(1): Remove references to colcrt(1) and nroff(1)
Fernando ApesteguĂ­a [Wed, 7 Oct 2020 14:43:16 +0000 (14:43 +0000)]
ul(1): Remove references to colcrt(1) and nroff(1)

colcrt(1) and nroff(1) where removed in r319664.
Remove references to these commands in ul(1) man page.

PR: 244127
Reported by: freebsd@tim.thechases.com
Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D2614

3 years agoDon't use critical section when calling intr_irq_handler() - that function
Edward Tomasz Napierala [Wed, 7 Oct 2020 12:11:11 +0000 (12:11 +0000)]
Don't use critical section when calling intr_irq_handler() - that function
enters critical section by itself anyway.

Reviewed by: kp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26694

3 years agoFix typo.
Konstantin Belousov [Wed, 7 Oct 2020 10:58:56 +0000 (10:58 +0000)]
Fix typo.

Sponsored by: Mellanox Technologies/NVIDIA Networking
MFC after: 3 days

3 years agoTemporarily skip failing test cases in CI:
Li-Wen Hsu [Wed, 7 Oct 2020 09:53:24 +0000 (09:53 +0000)]
Temporarily skip failing test cases in CI:

sys.capsicum.functional.Capability__NoBypassDAC
sys.capsicum.functional.Pdfork__OtherUserForked

PR: 250178, 250179
Sponsored by: The FreeBSD Foundation

3 years agoUse intmax_t to print uint64_t values.
Warner Losh [Wed, 7 Oct 2020 07:55:55 +0000 (07:55 +0000)]
Use intmax_t to print uint64_t values.

This fixes the 32-bit build where the types are different.

3 years agoRevert r358001 in favor of r366509
Li-Wen Hsu [Wed, 7 Oct 2020 07:55:55 +0000 (07:55 +0000)]
Revert r358001 in favor of r366509

Sponsored by: The FreeBSD Foundation

3 years agoSkip test written in Googltest in the wrapper script
Li-Wen Hsu [Wed, 7 Oct 2020 07:23:29 +0000 (07:23 +0000)]
Skip test written in Googltest in the wrapper script

This leaves the main test body untouched and only skip running in the CI env,
makes doing local test easier while developing.

PR: 244165
Sponsored by: The FreeBSD Foundation

3 years agoMove kernel env global variables, etc to sys/kenv.h
Warner Losh [Wed, 7 Oct 2020 06:16:37 +0000 (06:16 +0000)]
Move kernel env global variables, etc to sys/kenv.h

The kernel globals for kenv are confined to 2 files that need them and
a few that likely shouldn't (but as written the code does). Move them
from sys/systm.h to sys/kenv.h. This removed a XXX from systm.h and
cleans it up a little bit...

3 years agocam: Add quirk for Samsung MZ7* behind a SATA-to-SAS interposer
Warner Losh [Wed, 7 Oct 2020 05:44:35 +0000 (05:44 +0000)]
cam: Add quirk for Samsung MZ7* behind a SATA-to-SAS interposer

Sometimes, this drive will be present in the system such that the the
firmware identification string doesn't start with ATA, such as when
it's behind a SATA-to-SAS interposer. Add another quirk for that.

Submitted by: github user mr44er
Github PR: 423

3 years agonvmecontrol: Update wdc module for newer WDC NVMe products
Warner Losh [Wed, 7 Oct 2020 05:36:05 +0000 (05:36 +0000)]
nvmecontrol: Update wdc module for newer WDC NVMe products

Update the to log fetch operation for latest WDC NVMe products.

Tested on HGST SN100 (a few years old) and WDC SN720 (more recent).

Submitted by: Akhilesh Rn <Akhilesh.RN@wdc.com> (minor style tweak by me)
Github PR: 435

3 years agonvme: Note where the CCB was released for passthrough command
Warner Losh [Tue, 6 Oct 2020 23:35:26 +0000 (23:35 +0000)]
nvme: Note where the CCB was released for passthrough command

3 years agocam: Assert we have a reference when freeing sim
Warner Losh [Tue, 6 Oct 2020 23:33:56 +0000 (23:33 +0000)]
cam: Assert we have a reference when freeing sim

Before we decrement refcount to sleep on the sim, assert that the
refcount >= 1. If it were 0 here, we'd never wake up.

3 years agoRemove unused function cpu_boot()
Mitchell Horne [Tue, 6 Oct 2020 23:16:56 +0000 (23:16 +0000)]
Remove unused function cpu_boot()

The prototype was added with the creation of kern_shutdown.c in r17658,
but it appears to have never been implemented. Remove it now.

Reviewed by: cem, kib
Differential Revision: https://reviews.freebsd.org/D26702

3 years agoadd the FILESYSTEMS placeholder and note that it's the default early_late_divider
John-Mark Gurney [Tue, 6 Oct 2020 22:53:11 +0000 (22:53 +0000)]
add the FILESYSTEMS placeholder and note that it's the default early_late_divider

3 years agoext2fs: minor typo.
Pedro F. Giffuni [Tue, 6 Oct 2020 21:31:04 +0000 (21:31 +0000)]
ext2fs: minor typo.

Obtained from: Dragonfly
MFC after: 3 days

3 years agobridge: call member interface ioctl() without NET_EPOCH
Kristof Provost [Tue, 6 Oct 2020 19:19:56 +0000 (19:19 +0000)]
bridge: call member interface ioctl() without NET_EPOCH

We're not allowed to hold NET_EPOCH while sleeping, so when we call ioctl()
handlers for member interfaces we cannot be in NET_EPOCH.  We still need some
protection of our CK_LISTs, so hold BRIDGE_LOCK instead.

That requires changing BRIDGE_LOCK into a sleepable lock, and separating the
BRIDGE_RT_LOCK, to protect bridge_rtnode lists. That lock is taken in the data
path (while in NET_EPOCH), so it cannot be a sleepable lock.

While here document the locking strategy.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D26418

3 years agoDon't permit DRM buffer mappings to be upgraded to executable.
John Baldwin [Tue, 6 Oct 2020 18:13:15 +0000 (18:13 +0000)]
Don't permit DRM buffer mappings to be upgraded to executable.

Reviewed by: kib
MFC after: 1 month
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26697

3 years agoSimplify swcr_authcompute() after removal of deprecated algorithms.
John Baldwin [Tue, 6 Oct 2020 18:07:52 +0000 (18:07 +0000)]
Simplify swcr_authcompute() after removal of deprecated algorithms.

- Just use sw->octx != NULL to handle the HMAC case when finalizing
  the MAC.

- Explicitly zero the on-stack auth context.

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D26688

3 years agoCheck if_capenable, not if_capabilities when enabling rate limiting.
John Baldwin [Tue, 6 Oct 2020 18:02:33 +0000 (18:02 +0000)]
Check if_capenable, not if_capabilities when enabling rate limiting.

if_capabilities is a read-only mask of supported capabilities.
if_capenable is a mask under administrative control via ifconfig(8).

Reviewed by: gallatin
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D26690

3 years agoStore the send tag type in the common send tag header.
John Baldwin [Tue, 6 Oct 2020 17:58:56 +0000 (17:58 +0000)]
Store the send tag type in the common send tag header.

Both cxgbe(4) and mlx5(4) wrapped the existing send tag header with
their own identical headers that stored the type that the
type-specific tag structures inherited from, so in practice it seems
drivers need this in the tag anyway.  This permits removing these
extra header indirections (struct cxgbe_snd_tag and struct
mlx5e_snd_tag).

In addition, this permits driver-independent code to query the type of
a tag, e.g. to know what type of tag is being queried via
if_snd_query.

Reviewed by: gallatin, hselasky, np, kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D26689

3 years agoReset delayed SACK state when restarting an SCTP association.
Michael Tuexen [Tue, 6 Oct 2020 14:26:05 +0000 (14:26 +0000)]
Reset delayed SACK state when restarting an SCTP association.

MFC after: 3 days

3 years agoriscv: Remove outdated condition in page_fault_handler
Jessica Clarke [Tue, 6 Oct 2020 13:03:31 +0000 (13:03 +0000)]
riscv: Remove outdated condition in page_fault_handler

Since r366355 and r366284 we panic on access faults rather than treating
them like page faults so this condition is never true.

Reviewed by: jhb (mentor), markj, mhorne
Approved by: jhb (mentor), markj, mhorne
Differential Revision: https://reviews.freebsd.org/D26686

3 years agoriscv: Handle supervisor instruction page faults
Jessica Clarke [Tue, 6 Oct 2020 13:02:20 +0000 (13:02 +0000)]
riscv: Handle supervisor instruction page faults

We should never take instruction page faults when in the kernel, but by
using the standard page fault code we should get a more-informative
message about faulting on a NOFAULT page rather than branching to the
default case here and printing an "Unknown kernel exception ..."
message.

Reviewed by: jhb (mentor), markj
Approved by: jhb (mentor), markj
Differential Revision: https://reviews.freebsd.org/D26685

3 years agoTemporarily skip failing test cases in CI:
Li-Wen Hsu [Tue, 6 Oct 2020 12:57:54 +0000 (12:57 +0000)]
Temporarily skip failing test cases in CI:

sys.capsicum.functional.ForkedOpenatTest_WithFlagInCapabilityMode___
sys.capsicum.functional.OpenatTest__WithFlag

PR: 249960
Sponsored by: The FreeBSD Foundation

3 years agoriscv: De-Arm a few names
Jessica Clarke [Tue, 6 Oct 2020 12:56:29 +0000 (12:56 +0000)]
riscv: De-Arm a few names

These names were inherited from the arm64 port and should be changed to
the RISC-V terminology.

Reviewed by: jhb (mentor), kp, markj
Approved by: jhb (mentor), kp, markj
Differential Revision: https://reviews.freebsd.org/D26671

3 years agoEnsure variables are initialized before used.
Michael Tuexen [Tue, 6 Oct 2020 11:29:08 +0000 (11:29 +0000)]
Ensure variables are initialized before used.

MFC after: 3 days

3 years agoRemove dead stores reported by clang static code analysis
Michael Tuexen [Tue, 6 Oct 2020 11:08:52 +0000 (11:08 +0000)]
Remove dead stores reported by clang static code analysis

MFC after: 3 days

3 years agointro(3): Update the list of included libraries
Gordon Bergling [Tue, 6 Oct 2020 10:51:47 +0000 (10:51 +0000)]
intro(3): Update the list of included libraries

- Extend the list of main libraries of section 3
- Extend the library functions that are included in the libc

MFC after: 2 weeks
Submitted by: Naga Chaitanya Vellanki <pnagato at protonmail dot com>
Approved by: gbe
Differential Revision: https://reviews.freebsd.org/D26476

3 years agoCleanup, no functional change intended.
Michael Tuexen [Tue, 6 Oct 2020 10:41:04 +0000 (10:41 +0000)]
Cleanup, no functional change intended.

MFC after: 3 days

3 years agolinuxkpi: Add pagemap.h
Emmanuel Vadot [Tue, 6 Oct 2020 10:41:00 +0000 (10:41 +0000)]
linuxkpi: Add pagemap.h

Add release_pages needed by drm which simply calls put_page for
all the pages provided

Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26680

3 years agolinuxkpi: Add power_supply.h
Emmanuel Vadot [Tue, 6 Oct 2020 10:39:40 +0000 (10:39 +0000)]
linuxkpi: Add power_supply.h

Add power_supply_is_system_supplied which is needed by drm.

Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26679