]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC 350813: tools/tools/crypto: cryptokeytest: Fix build with newer OpenSSL
John Baldwin [Fri, 4 Dec 2020 01:11:09 +0000 (01:11 +0000)]
MFC 350813: tools/tools/crypto: cryptokeytest: Fix build with newer OpenSSL

Also, drag into this decade.

3 years agoMFC 366844: Mark asymmetric cryptography via OCF deprecated for 14.0.
John Baldwin [Fri, 4 Dec 2020 01:09:51 +0000 (01:09 +0000)]
MFC 366844: Mark asymmetric cryptography via OCF deprecated for 14.0.

Only one MIPS-specific driver implements support for one of the
asymmetric operations.  There are no in-kernel users besides
/dev/crypto.  The only known user of the /dev/crypto interface was the
engine in OpenSSL releases before 1.1.0.  1.1.0 includes a rewritten
engine that does not use the asymmetric operations due to lack of
documentation.

3 years agoMFC r367895:
Konstantin Belousov [Fri, 4 Dec 2020 00:48:11 +0000 (00:48 +0000)]
MFC r367895:
msdosfs: suspend around unmount or remount rw->ro.

3 years agoMFC r368193:
Mark Johnston [Thu, 3 Dec 2020 15:55:07 +0000 (15:55 +0000)]
MFC r368193:
qat: Fix firmware module autoloading

3 years agoMFC r368194:
Mark Johnston [Thu, 3 Dec 2020 15:54:41 +0000 (15:54 +0000)]
MFC r368194:
qat: Initialize the crypto device ID to -1 instead of 0

3 years agoMFC r367734:
Mitchell Horne [Thu, 3 Dec 2020 14:04:42 +0000 (14:04 +0000)]
MFC r367734:
bsdiff: fix off-by-one error

3 years agoMFC r368058:
Hans Petter Selasky [Thu, 3 Dec 2020 10:32:54 +0000 (10:32 +0000)]
MFC r368058:
Ensure consistent error messages from ifconfig(8).

If multiple threads are invoking "ifconfig XXX create" a race may occur
which can lead to two different error messages for the same error.

a) ifconfig: SIOCIFCREATE2: File exists
b) ifconfig: interface XXX already exists

This patch ensures ifconfig prints the same error code
for the same case.

Reviewed by: imp@ and kib@
Differential Revision: https://reviews.freebsd.org/D27380
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366286:
Cy Schubert [Thu, 3 Dec 2020 05:56:42 +0000 (05:56 +0000)]
MFC r366286:

ipfilter getifname ifdef cleanup.

3 years agoMFC r367812:
Li-Wen Hsu [Thu, 3 Dec 2020 02:21:48 +0000 (02:21 +0000)]
MFC r367812:

ipheth(4): Fix for iOS 14

Fix USB tethering for iOS 14.

Inspired by: https://github.com/libimobiledevice/libimobiledevice/issues/1038

PR: 249979
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D27250

3 years agoMFC 355686: Fix a mismerge in r355683 and remove the local gdb_port from main.
John Baldwin [Wed, 2 Dec 2020 23:16:24 +0000 (23:16 +0000)]
MFC 355686: Fix a mismerge in r355683 and remove the local gdb_port from main.

PR: 251501
Reported by: Yuichiro NAITO <naito.yuichiro@gmail.com>

3 years agoMFC r353130:
Yuri Pankov [Wed, 2 Dec 2020 22:44:40 +0000 (22:44 +0000)]
MFC r353130:

Mark "private use area" characters as printable.

At least some of the characters in E000-F8FF range are used by Powerline
fonts, and having no attributes for these ranges in UnicodeData.txt
other than "Other, Private Use" it should be safe to mark all of them as
printable.  Some actually were before r340491, so this fixes the
regression introduced there as well.

PR: 240911
Reviewed by: bapt
Tested by: Daniel Ponte <amigan@gmail.com>
Differential Revision: https://reviews.freebsd.org/D21850

3 years agoMFC r367809:
Dimitry Andric [Wed, 2 Dec 2020 21:44:41 +0000 (21:44 +0000)]
MFC r367809:

When elftoolchain's objcopy (or strip) is rewriting a file in-place,
make it create the temporary file in the same directory as the source
file by default, instead of always using $TMPDIR or /tmp. If creating
that file fails because the directory is not writable, also fallback to
$TMPDIR or /tmp.

This has also been submitted upstream as:
https://sourceforge.net/p/elftoolchain/tickets/597/

Reported by: cem
PR: 250872

3 years agoMFC r367304:
Dimitry Andric [Wed, 2 Dec 2020 21:39:54 +0000 (21:39 +0000)]
MFC r367304:

Add WITH_LLVM_CXXFILT option to install llvm-cxxfilt as c++filt

Since elftoolchain's cxxfilt is rather far behind on features, and we
ran into several bugs, add an option to use llvm-cxxfilt as an drop-in
replacement.

It supports the same options as elftoolchain cxxfilt, though it doesn't
have support for old ARM (C++ Annotated Reference Manual, not the CPU)
and GNU v2 manglings. But these are irrelevant in 2020.

Note: as we already compile the required libraries as part of libllvm,
this will not add any significant build time either.

PR: 250702
Reviewed by: emaste, yuri
Differential Revision: https://reviews.freebsd.org/D27071

MFC r367712:

Ensure make delete-old does not unlink the llvm-cxxfilt and its manpage,
after r367304 and r367324, when WITH_LLVM_CXXFILT is enabled.

Noticed by: "Herbert J. Skuhra" <herbert@gojira.at>

3 years agoMFC r368023:
Konstantin Belousov [Wed, 2 Dec 2020 00:45:35 +0000 (00:45 +0000)]
MFC r368023:
Use designated initializers for libc pthread stubs' jump table.

3 years agoMFC r368248:
Mark Johnston [Tue, 1 Dec 2020 19:35:48 +0000 (19:35 +0000)]
MFC r368248:
rtsold: Fix multiple buffer overflows

Approved by: so
Security: CVE-2020-25577

3 years agoiconv(1): Add EXAMPLE
Fernando ApesteguĂ­a [Tue, 1 Dec 2020 18:13:57 +0000 (18:13 +0000)]
iconv(1): Add EXAMPLE

Just a small example to show simple usage.

Approved by:    manpages (0mp@)
Differential Revision: https://reviews.freebsd.org/D27385

3 years agoMFC r367990:
Kristof Provost [Tue, 1 Dec 2020 16:02:52 +0000 (16:02 +0000)]
MFC r367990:

pf tests: provoke tag hashing panic

Attempt to provoke the panic fixed in r367987.

3 years agoFix error merging r354116 from OpenZFS
Alan Somers [Tue, 1 Dec 2020 15:15:18 +0000 (15:15 +0000)]
Fix error merging r354116 from OpenZFS

When we merged 4c0883fb4af0d5565459099b98fcf90ecbfa1ca1 from OpenZFS (svn
r354116), there were some merge conflicts.  One of those was resolved
incorrectly, causing "zfs receive" to fail to delete snapshots that a "zfs
send -R" stream has deleted.

This change corrects that merge conflict, and also reduces some harmless
diffs vis-a-vis OpenZFS that were also introduced by the same revision.
Direct commit to stable/12 because head has moved on to OpenZFS.

PR: 249438
Reported by: Dmitry Wagin <dmitry.wagin@ya.ru>
Reviewed by: mmacy
Sponsored by: Axcient

3 years agoMFC r367987:
Mark Johnston [Tue, 1 Dec 2020 15:11:16 +0000 (15:11 +0000)]
MFC r367987:
pf: Make tag hashing more robust

3 years agoMFC r367988:
Mark Johnston [Tue, 1 Dec 2020 15:09:02 +0000 (15:09 +0000)]
MFC r367988:
ping(8): Improve parameter validation

PR: 239974, 239977, 239978

3 years agoMFC r367989:
Mark Johnston [Tue, 1 Dec 2020 15:01:10 +0000 (15:01 +0000)]
MFC r367989:
ata(4): Release the ioport resource if device initialization fails

PR: 251346

3 years agoMFC r366933 and r366934:
Hans Petter Selasky [Tue, 1 Dec 2020 13:58:14 +0000 (13:58 +0000)]
MFC r366933 and r366934:
Add support for IP over infiniband, IPoIB, to lagg(4). Currently only
the failover protocol is supported due to limitations in the IPoIB
architecture. Refer to the lagg(4) manual page for how to configure
and use this new feature. A new network interface type,
IFT_INFINIBANDLAG, has been added, similar to the existing
IFT_IEEE8023ADLAG .

ifconfig(8) has been updated to accept a new laggtype argument when
creating lagg(4) network interfaces. This new argument is used to
distinguish between ethernet and infiniband type of lagg(4) network
interface. The laggtype argument is optional and defaults to
ethernet. The lagg(4) command line syntax is backwards compatible.

Differential Revision: https://reviews.freebsd.org/D26254
Reviewed by: melifaro@
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366931:
Hans Petter Selasky [Tue, 1 Dec 2020 13:47:16 +0000 (13:47 +0000)]
MFC r366931:
Implement mbuf hashing routines for IP over infiniband, IPoIB.
No functional change intended.

Differential Revision: https://reviews.freebsd.org/D26254
Reviewed by: melifaro@
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r366930, r366936, r366993 and r366994:
Hans Petter Selasky [Tue, 1 Dec 2020 13:44:33 +0000 (13:44 +0000)]
MFC r366930, r366936, r366993 and r366994:
Factor out generic IP over infiniband, IPoIB, definitions and code
into net/if_infiniband.c and net/infiniband.h . No functional change
intended.

Differential Revision: https://reviews.freebsd.org/D26254
Reviewed by: melifaro@
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367719:
Hans Petter Selasky [Tue, 1 Dec 2020 13:09:04 +0000 (13:09 +0000)]
MFC r367719:
Make mlx5_cmd_exec_cb() a safe API in mlx5core.

APIs that have deferred callbacks should have some kind of cleanup
function that callers can use to fence the callbacks. Otherwise things
like module unloading can lead to dangling function pointers, or worse.

The IB MR code is the only place that calls this function and had a
really poor attempt at creating this fence. Provide a good version in
the core code as future patches will add more places that need this
fence.

Linux commit:
e355477ed9e4f401e3931043df97325d38552d54

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367718:
Hans Petter Selasky [Tue, 1 Dec 2020 13:06:26 +0000 (13:06 +0000)]
MFC r367718:
Report EQE data upon CQ completion in mlx5core.

Report EQE data upon CQ completion to let upper layers use this data.

Linux commit:
4e0e2ea1886afe8c001971ff767f6670312a9b04

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r357294:
Hans Petter Selasky [Tue, 1 Dec 2020 13:03:09 +0000 (13:03 +0000)]
MFC r357294:
Widen EPOCH(9) usage in mlx5en(4).

Make completion event path mostly lockless using EPOCH(9).

Implement a mechanism using EPOCH(9) which allows us to make
the callback path for completion events mostly lockless.

Simplify draining callback events using epoch_wait().

While at it make sure all receive completion callbacks are
covered by the network EPOCH(9), because this is required
when calling if_input() and ether_input() after r357012.

Sponsored by: Mellanox Technologies

3 years agoMFC r367717:
Hans Petter Selasky [Tue, 1 Dec 2020 12:51:35 +0000 (12:51 +0000)]
MFC r367717:
Enhance the mlx5_core_create_cq() function in mlx5core.

Enhance mlx5_core_create_cq() to get the command out buffer from the
callers to let them use the output.

Linux commit:
38164b771947be9baf06e78ffdfb650f8f3e908e

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367716:
Hans Petter Selasky [Tue, 1 Dec 2020 12:45:07 +0000 (12:45 +0000)]
MFC r367716:
Use mlx5core to create/destroy all Dynamically Connected Targets, DCTs.

To prevent a hardware memory leak when a DEVX DCT object is destroyed
without calling drain DCT before, (e.g. under cleanup flow), need to
manage its creation and destruction via mlx5 core.

Linux commit:
c5ae1954c47d3fd8815bd5a592aba18702c93f33

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367715:
Hans Petter Selasky [Tue, 1 Dec 2020 12:43:22 +0000 (12:43 +0000)]
MFC r367715:
Fix error handling order in create_kernel_qp in mlx5ib.

Make sure order of cleanup is exactly the opposite of initialization.

Linux commit:
f4044dac63e952ac1137b6df02b233d37696e2f5

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367555:
Hans Petter Selasky [Tue, 1 Dec 2020 12:41:25 +0000 (12:41 +0000)]
MFC r367555:
Include GID type when deleting GIDs from HW table under RoCE in mlx4ib.
Refer to the Linux commit mentioned below for a more detailed description.

Linux commit:
a18177925c252da7801149abe217c05b80884798

Requested by: Isilon
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367622:
Hans Petter Selasky [Tue, 1 Dec 2020 12:38:28 +0000 (12:38 +0000)]
MFC r367622:
Add more USB quirks.

PR: 230038
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367615:
Hans Petter Selasky [Tue, 1 Dec 2020 12:36:21 +0000 (12:36 +0000)]
MFC r367615:
Add a tunable sysctl, hw.usb.uaudio.handle_hid, to allow disabling the
the HID volume keys support in the USB audio driver.

While at it re-organize the USB audio sysctls a bit.

Differential Revision: https://reviews.freebsd.org/D27180
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367614:
Hans Petter Selasky [Tue, 1 Dec 2020 12:32:35 +0000 (12:32 +0000)]
MFC r367614:
When doing a USB alternate setting on an USB interface we need to
re-configure the XHCI endpoint context.

Differential Revision: https://reviews.freebsd.org/D27174
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r367757, r367756, r367759, r367769:
Mateusz Piotrowski [Tue, 1 Dec 2020 09:24:15 +0000 (09:24 +0000)]
MFC r367757, r367756, r367759, r367769:

Improve readability of the lists of options

- Sort options alphabetically
- Add missing arguments (e.g., "list" to -a)
- Adjust the width of Bl

Clean up the synopsis section & fix mandoc warnings

The synopsis section had two very similar entries. The flags documented by
the first one were a strict subset of the second one. Let's just keep only
the second entry for simplicity.

Add an example for the -s flag

Partially revert r367756 (chpass(1) synopsis changes)

Let's have two entries in the synopsis:
- chpass now lists options which can be used for non-NIS-specific
  functionalities.
- ypchpass additionally lists the NIS-specific flags.

Technically, it is an artificial distinction, as chpass and ypchpass behave
identically. Nevertheless, it might help navigating the synopsis section.

Reviewed by: imp

3 years agoMFC r366285:
Cy Schubert [Mon, 30 Nov 2020 22:35:30 +0000 (22:35 +0000)]
MFC r366285:

Resurrect ipfilter's getifname, replacing the stub with the real
function.

3 years agoMFC r367530:
Michael Tuexen [Mon, 30 Nov 2020 09:45:44 +0000 (09:45 +0000)]
MFC r367530:
RFC 7323 specifies that:
* TCP segments without timestamps should be dropped when support for
  the timestamp option has been negotiated.
* TCP segments with timestamps should be processed normally if support
  for the timestamp option has not been negotiated.
This patch enforces the above.
Manually resolved merge conflicts.

MFC 367891:
Fix an issue I introuced in r367530: tcp_twcheck() can be called
with to == NULL for SYN segments. So don't assume tp != NULL.
Thanks to jhb@ for reporting and suggesting a fix.

MFC r367946:
Fix two occurences of a typo in a comment introduced in r367530.
Thanks to lstewart@ for reporting them.

PR: 250499
Reviewed by: gnn, rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D27148

3 years agoMFC r367520:
Michael Tuexen [Mon, 30 Nov 2020 09:22:33 +0000 (09:22 +0000)]
MFC r367520:

Fix a potential use-after-free bug introduced in
https://svnweb.freebsd.org/changeset/base/363046

Thanks to Taylor Brandstetter for finding this issue using fuzz testing
and reporting it in https://github.com/sctplab/usrsctp/issues/547

3 years agoMFC r367464:
Michael Tuexen [Mon, 30 Nov 2020 09:21:01 +0000 (09:21 +0000)]
MFC r367464:
The ioctl() calls using FIONREAD, FIONWRITE, FIONSPACE, and SIOCATMARK
access the socket send or receive buffer. This is not possible for
listening sockets since r319722.
Because send()/recv() calls fail on listening sockets, fail also ioctl()
indicating EINVAL.

PR: 250366
Reported by: Yong-Hao Zou
Reviewed by: glebius, rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D26897

3 years agoMFC r366750:
Michael Tuexen [Mon, 30 Nov 2020 09:18:13 +0000 (09:18 +0000)]
MFC r366750:

Improve the handling of cookie life times.
The staleness reported in an error cause is in us, not ms.
Enforce limits on the life time via sysct; and socket options
consistently. Update the description of the sysctl variable to
use the right unit. Also do some minor cleanups.
This also fixes an interger overflow issue if the peer can
modify the cookie. This was reported by Felix Weinrank by fuzz testing
the userland stack and in
https://oss-fuzz.com/testcase-detail/4800394024452096

3 years agoMFC r366517:
Michael Tuexen [Mon, 30 Nov 2020 09:16:51 +0000 (09:16 +0000)]
MFC r366517:

Minor cleanups.

3 years agoMFC r366489:
Michael Tuexen [Mon, 30 Nov 2020 09:15:30 +0000 (09:15 +0000)]
MFC r366489:

Reset delayed SACK state when restarting an SCTP association.

3 years agoMFC r366483:
Michael Tuexen [Mon, 30 Nov 2020 09:14:01 +0000 (09:14 +0000)]
MFC r366483:

Ensure variables are initialized before used.

3 years agoMFC r366482:
Michael Tuexen [Mon, 30 Nov 2020 09:12:45 +0000 (09:12 +0000)]
MFC r366482:

Remove dead stores reported by clang static code analysis

3 years agoMFC r366480:
Michael Tuexen [Mon, 30 Nov 2020 09:11:24 +0000 (09:11 +0000)]
MFC r366480:

Cleanup, no functional change intended.

3 years agoMFC 366474:
Michael Tuexen [Mon, 30 Nov 2020 09:10:05 +0000 (09:10 +0000)]
MFC 366474:

Whitespace changes.

3 years agoMFC r366426:
Michael Tuexen [Mon, 30 Nov 2020 09:08:51 +0000 (09:08 +0000)]
MFC r366426:

Use __func__ instead of __FUNCTION__ for consistency.

3 years agoMFC r366425:
Michael Tuexen [Mon, 30 Nov 2020 09:07:21 +0000 (09:07 +0000)]
MFC r366425:

Cleanup, no functional change intended.

3 years agoFix startup of gssd when /usr is a separately mounted local file system.
Rick Macklem [Sun, 29 Nov 2020 23:37:18 +0000 (23:37 +0000)]
Fix startup of gssd when /usr is a separately mounted local file system.

meowthink@gmail.com reported that the gssd daemon was not
starting, because /etc/rc.d/gssd was executed before his local
/usr file system was mounted.
He fixed the problem by adding mountcritlocal to the REQUIRED
line.

This fix seems safe and works for a separately mounted /usr file
system on a local disk.
The case of a separately mounted remote /usr file system (such as
NFS) is still broken, but there is no obvious solution for that.
Adding mountcritremote would fix the problem, but it would
cause a POLA violation, because all kerberized NFS mounts
in /etc/fstab would need the "late" option specified to work.

3 years agoMFC: r367423
Rick Macklem [Sun, 29 Nov 2020 23:23:08 +0000 (23:23 +0000)]
MFC: r367423
Add support for the new mountd -R option.

r376026 added a new "-R" option to mountd, which tells it to
not support the Mount protocol (not used by NFSv4) and not
register with rpcbind.
Rpcbind is considered a security issue by some sites now.

This patch adds a new yes/no variable called nfsv4_server_only.
When that is set, make vfs.nfsd.server_min_vers=4 and set "=R"
for mountd.
Setting vfs.nfsd.server_min_vers=4 tells nfsd to not register with rpcbind.
While here, add a check for "load_kld nfsd" failing to nfsd.

3 years agoMFC r368084:
Mateusz Piotrowski [Sun, 29 Nov 2020 14:20:42 +0000 (14:20 +0000)]
MFC r368084:

libprocstat.3: Correct two occurrences of kvm_getprocs to procstat_getprocs

Submitted by: otis_sk.freebsd.org
Reviewed by: markj

3 years agoMFC r368083:
Konstantin Belousov [Sun, 29 Nov 2020 10:36:56 +0000 (10:36 +0000)]
MFC r368083:
Remove stray semicolumn.

3 years agoMFC r368082:
Konstantin Belousov [Sun, 29 Nov 2020 10:34:49 +0000 (10:34 +0000)]
MFC r368082:
Style.

3 years agoMFC: r367027
Rick Macklem [Sun, 29 Nov 2020 01:32:53 +0000 (01:32 +0000)]
MFC: r367027
Update man page for -R option added by r376026.

This is a content change.

3 years agoMFC: r367026
Rick Macklem [Sun, 29 Nov 2020 01:22:30 +0000 (01:22 +0000)]
MFC: r367026
Add "-R" option to tell mountd to not register with rpcbind.

rpcbind is now considered a security risk for some sites.
Since an NFSv4 only NFS server does not need rpcbind,
it makes sense to have an option that implements this.

This patch adds a "-R" option that disables the Mount
protocol (not used by NFSv4) and does not register
with rpcbind.

Changes are required to /etc/rc.d/mountd and /etc/rc.d/nfsd.
Those will be in a separate commit.

3 years agoMFC r368047
Peter Grehan [Sun, 29 Nov 2020 00:54:13 +0000 (00:54 +0000)]
MFC r368047
 Remove manual instruction encodings for VMLOAD, VMRUN, and VMSAVE.

3 years agoMFC r367094:
Cy Schubert [Sat, 28 Nov 2020 18:09:16 +0000 (18:09 +0000)]
MFC r367094:

MFV r367082:

Update unbound 1.11.0 --> 1.12.0.

3 years agoMFC r367923:
Konstantin Belousov [Sat, 28 Nov 2020 10:38:00 +0000 (10:38 +0000)]
MFC r367923:
Stop using eventhandlers for itimers subsystem exec and exit hooks.

3 years agoMFC r367918, r367919:
Konstantin Belousov [Sat, 28 Nov 2020 10:36:19 +0000 (10:36 +0000)]
MFC r367918, r367919:
Stop using eventhandler to invoke umtx_exec hook.

3 years agoMFC r366700:
Michal Meloun [Sat, 28 Nov 2020 09:06:51 +0000 (09:06 +0000)]
MFC r366700:

  Add 'netserver' command to EFI loader.

3 years agoMFC r367862: Microoptimize cam_num_doneqs math in xpt_done().
Alexander Motin [Fri, 27 Nov 2020 13:25:12 +0000 (13:25 +0000)]
MFC r367862: Microoptimize cam_num_doneqs math in xpt_done().

3 years agoMFC r367892:
Konstantin Belousov [Fri, 27 Nov 2020 11:51:07 +0000 (11:51 +0000)]
MFC r367892:
Unlock channels when any of them are locked, when returning for non-busy state.

3 years agoMFC r367890:
Konstantin Belousov [Fri, 27 Nov 2020 11:48:33 +0000 (11:48 +0000)]
MFC r367890:
msdosfs: Add trivial support for suspension.

3 years agoMFC r367869:
Kristof Provost [Fri, 27 Nov 2020 11:12:59 +0000 (11:12 +0000)]
MFC r367869:

pf tests: Basic source tracking test

3 years agoMFC r367867:
Kristof Provost [Fri, 27 Nov 2020 11:12:10 +0000 (11:12 +0000)]
MFC r367867:

pf: Fix incorrect assertion

We never set PFRULE_RULESRCTRACK when calling pf_insert_src_node(). We do set
PFRULE_SRCTRACK, so update the assertion to match.

3 years agoMFC r367866: bzgrep: make flag --no-filename work
Eugene Grosbein [Fri, 27 Nov 2020 08:45:43 +0000 (08:45 +0000)]
MFC r367866: bzgrep: make flag --no-filename work

PR: 248813

3 years agoMFC r366132:
Alan Somers [Fri, 27 Nov 2020 04:45:10 +0000 (04:45 +0000)]
MFC r366132:

lib/libc/tests/iconv: raise WARNS to 6

3 years agoMFC r367980:
Cy Schubert [Fri, 27 Nov 2020 03:17:21 +0000 (03:17 +0000)]
MFC r367980:

Fix a typo in a comment.

3 years agoMFC r366131:
Alan Somers [Thu, 26 Nov 2020 23:54:13 +0000 (23:54 +0000)]
MFC r366131:

lib/libc/tests/sys: raise WARNS to 6

3 years agoMFC r366118:
Alan Somers [Thu, 26 Nov 2020 23:44:57 +0000 (23:44 +0000)]
MFC r366118:

Fix some signed/unsigned comparison warnings in NFS

Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D26533

3 years agoMFC r365956:
Alan Somers [Thu, 26 Nov 2020 23:35:13 +0000 (23:35 +0000)]
MFC r365956:

fsx: fix build with WARNS=6

* signed/unsigned comparisons
* use standard warn(3)
* Suppress warnings about local vars and funcs not declared static
* const-correctness
* declaration shadows a variable in the global scope

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

3 years agoMFC r365910:
Alan Somers [Thu, 26 Nov 2020 23:34:02 +0000 (23:34 +0000)]
MFC r365910:

fix integer underflow in getgrnam_r and getpwnam_r

Sometimes nscd(8) will return a 1-byte buffer for a nonexistent entry. This
triggered an integer underflow in grp_unmarshal_func, causing getgrnam_r to
return ERANGE instead of 0.

Fix the user's buffer size check, and add a correct check for a too-small
nscd buffer.

PR: 248932
Event: September 2020 Bugathon
Reviewed by: markj
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D26204

3 years agoMFC r367849:
Mark Johnston [Thu, 26 Nov 2020 14:57:30 +0000 (14:57 +0000)]
MFC r367849:
callout(9): Fix a race between CPU migration and callout_drain()

3 years agoAdd missing NET_EPOCH_EXIT() to if_bridge
Kristof Provost [Thu, 26 Nov 2020 10:17:56 +0000 (10:17 +0000)]
Add missing NET_EPOCH_EXIT() to if_bridge

In r367706 one return in bridge_input() did not NET_EPOCH_EXIT(), which caused
seemingly random panics on the next use of NET_EPOCH.

Direct commit to stable/12, because this code is different in CURRENT.

3 years agoMFC r367613:
Konstantin Belousov [Thu, 26 Nov 2020 07:31:30 +0000 (07:31 +0000)]
MFC r367613:
bhyve: remove a hack to map all 8G BARs 1:1

3 years agoMFC r367607:
Konstantin Belousov [Thu, 26 Nov 2020 07:30:29 +0000 (07:30 +0000)]
MFC r367607:
bhyve: increase allowed size for 64bit BAR allocation below 4G from 32 to 128 MB.

3 years agoMFC r367606:
Konstantin Belousov [Thu, 26 Nov 2020 07:29:28 +0000 (07:29 +0000)]
MFC r367606:
bhyve: avoid allocating BARs above the end of supported physical addresses.

3 years agoMFC r367936
Vincenzo Maffione [Wed, 25 Nov 2020 21:25:17 +0000 (21:25 +0000)]
MFC r367936

netmap: bridge: improve readability

Multiple cosmetic changes, plus a fix to a verbose print
(indicating wrong net->host/host->net direction).

3 years agoMFC r367935
Vincenzo Maffione [Wed, 25 Nov 2020 21:24:39 +0000 (21:24 +0000)]
MFC r367935

netmap: valectl: switch to libnetmap

Use the newer libnetmap (included in base) rather than the older
nm_open()/nm_close() defined in netmap_user.h

3 years agoMFC r367934
Vincenzo Maffione [Wed, 25 Nov 2020 21:23:58 +0000 (21:23 +0000)]
MFC r367934

netmap: nmreplay: switch to libnetmap

Use the newer libnetmap (included in base) rather than the older
nm_open()/nm_close() defined in netmap_user.h

3 years agoMFC r367933
Vincenzo Maffione [Wed, 25 Nov 2020 21:23:13 +0000 (21:23 +0000)]
MFC r367933

netmap: lb: switch to libnetmap

Use the newer libnetmap (included in base) rather than the older
nm_open()/nm_close() defined in netmap_user.h

3 years agoMFC r367932
Vincenzo Maffione [Wed, 25 Nov 2020 21:22:16 +0000 (21:22 +0000)]
MFC r367932

netmap: pkt-gen: switch to libnetmap

Use the newer libnetmap (included in base) rather than the older
nm_open()/nm_close() defined in netmap_user.h

3 years agoMFC r367931
Vincenzo Maffione [Wed, 25 Nov 2020 21:20:55 +0000 (21:20 +0000)]
MFC r367931

netmap: bridge: switch to libnetmap

Use the newer libnetmap (included in base) rather than the older
nm_open()/nm_close() defined in netmap_user.h

3 years agoMFC r351700: libc: Use musl's optimized memchr
Ed Maste [Wed, 25 Nov 2020 18:36:38 +0000 (18:36 +0000)]
MFC r351700: libc: Use musl's optimized memchr

Parentheses added to HASZERO macro to avoid a GCC warning.

Sponsored by: The FreeBSD Foundation

3 years agoMFC: Merge ENA v2.3.0 driver
Marcin Wojtas [Wed, 25 Nov 2020 03:24:43 +0000 (03:24 +0000)]
MFC: Merge ENA v2.3.0 driver

r367805 Update ENA driver version to v2.3.0
r367803 Rename descriptions of the supported ENA devices
r367802 Add ENI metrics for the ENA driver
r367801 Add SPDX license tag to the ENA driver files
r367800 Add Rx offsets support for the ENA driver
r367799 Adjust ENA driver files to latest ena-com changes
r367795 Fix completion descriptors alignment for the ENA

Obtained from:  Semihalf
Sponsored by:   Amazon, Inc

3 years agoMFC r367920, r367921
Vincenzo Maffione [Tue, 24 Nov 2020 19:55:01 +0000 (19:55 +0000)]
MFC r367920, r367921

netmap: bridge: update man page with more information

Update the man page to describe how it is necessary to
enable promiscuous mode and/or disable offloads.

3 years agoMFCr367741:
Konstantin Belousov [Tue, 24 Nov 2020 13:19:31 +0000 (13:19 +0000)]
MFCr367741:
vmem: trivial warning and style fixes.

3 years agoMFC r367044: Introduce support of SCSI Command Priority.
Alexander Motin [Tue, 24 Nov 2020 13:17:12 +0000 (13:17 +0000)]
MFC r367044: Introduce support of SCSI Command Priority.

SAM-3 specification introduced concept of Task Priority, that was renamed
to Command Priority in SAM-4, and supported by all modern SCSI transports.
It provides 15 levels of relative priorities: 1 - highest, 15 - lowest and
0 - default.  SAT specification for SATA devices translates priorities 1-3
into NCQ high priority.

This change adds new "priority" field into empty spots of struct ccb_scsiio
and struct ccb_accept_tio of CAM and struct ctl_scsiio of CTL.  Respective
support is added into iscsi(4), isp(4), mpr(4), mps(4) and ocs_fc(4) drivers
for both initiator and where applicable target roles.  Minimal support was
added to CTL to receive the priority value from different frontends, pass it
between HA controllers and report in few places.

This patch does not add consumers of this functionality, so nothing should
really change yet, since the field is still set to 0 (default) on initiator
and not actively used on target.  Those are to be implemented separately.

I've confirmed priority working on WD Red SATA disks connected via mpr(4)
and properly transferred to CTL target via iscsi(4), isp(4) and ocs_fc(4).

While there, added missing tag_action support to ocs_fc(4) initiator role.

3 years agoMFC r366922, r367915, r367916:
Alexander Motin [Tue, 24 Nov 2020 00:30:47 +0000 (00:30 +0000)]
MFC r366922, r367915, r367916:
Pass lower 3 bits of sector_count for FPDMA commands.

When this code was written those bits were N/A, but now the lowest bit
is Rebuild Assist Recovery Control (RARC).

3 years agoMFC r367502:
Navdeep Parhar [Tue, 24 Nov 2020 00:27:21 +0000 (00:27 +0000)]
MFC r367502:

cxgbe(4): Allow the PF driver to set a VF's MAC address.

The MAC address can be set with the optional mac-addr property in the VF
section of the iovctl.conf(5) used to instantiate the VFs.

Sponsored by: Chelsio Communications

3 years agoMFC r367497:
Navdeep Parhar [Tue, 24 Nov 2020 00:25:03 +0000 (00:25 +0000)]
MFC r367497:

cxgbev(4): Use the MAC address set by the the PF if there is one.

Query the firmware for the MAC address set by the PF for the VF and use
it instead of the firmware generated MAC if it's available.

Sponsored by: Chelsio Communications

3 years agoMFC r367428 and r367495.
Navdeep Parhar [Tue, 24 Nov 2020 00:22:33 +0000 (00:22 +0000)]
MFC r367428 and r367495.

r367428:
cxgbe(4):  Update firmwares to 1.25.0.40.

This fixes a potential crash in firmware 1.25.0.0 on the passive open
side during TOE operation.

r367495:
cxgbe(4): Add the firmware binaries missing in r367428.

Obtained from: Chelsio Communications
Sponsored by: Chelsio Communications

3 years agoMFC r366929 and r367608.
Navdeep Parhar [Tue, 24 Nov 2020 00:17:05 +0000 (00:17 +0000)]
MFC r366929 and r367608.

r366929:
cxgbe(4): fix the size of the iq/eq maps.

The firmware can allocate ingress and egress context ids anywhere from
its configured range.  Size the iq/eq maps to match the entire range
instead of assuming that the firmware always allocates the first
available context id.

Reported by: Baptiste Wicht @ Verisign

r367608:
cxgbev(4): Make sure that the iq/eq map sizes are correct for VFs.

This should have been part of r366929.

Sponsored by: Chelsio Communications

3 years agoMFC r366916:
Navdeep Parhar [Tue, 24 Nov 2020 00:12:42 +0000 (00:12 +0000)]
MFC r366916:

cxgbe(4): display correct tid range for T6 based -SO cards.

Reported by: Chelsio QA
Sponsored by: Chelsio Communications

3 years agoMFC r366853:
Navdeep Parhar [Tue, 24 Nov 2020 00:07:22 +0000 (00:07 +0000)]
MFC r366853:

cxgbe(4): Fix page fault in t4_get_lb_stats with 2 port T5 cards.

PR: 250449
Reported by: freqlabs@
Sponsored by: Chelsio Communications

3 years agoMFC r366696:
Navdeep Parhar [Tue, 24 Nov 2020 00:02:14 +0000 (00:02 +0000)]
MFC r366696:

cxgbe(4): Do not request FEC when requesting speeds that don't have FEC.

Sponsored by: Chelsio Communications

3 years agoMFC r366694:
Navdeep Parhar [Mon, 23 Nov 2020 23:58:14 +0000 (23:58 +0000)]
MFC r366694:

cxgbe(4): unimplemented cudbg routines should return the correct
internal error code and not an errno.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

3 years agoMFC r366532 and r366862.
Navdeep Parhar [Mon, 23 Nov 2020 23:53:21 +0000 (23:53 +0000)]
MFC r366532 and r366862.

r366532:
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.

r366862:
cxgbe(4): Updates to the drop features from r366532.

Sponsored by: Chelsio Communications

3 years agoMFC r365732 and r366589.
Navdeep Parhar [Mon, 23 Nov 2020 23:46:07 +0000 (23:46 +0000)]
MFC r365732 and r366589.

r365732:
cxgbe(4): Get the count of FCS errors from the MAC and not MPS for T6 ports.

The MPS register on the T6 counts something other than FCS errors despite its
name.

r366589:
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.

Sponsored by: Chelsio Communications

3 years agoMFC r367807
Justin Hibbits [Mon, 23 Nov 2020 16:26:49 +0000 (16:26 +0000)]
MFC r367807

Fix octeon_pmc post-r334827

Sponsored by: Juniper Networks, Inc