]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agotests/libalias: Measure cleanup time separatly
Lutz Donnerhacke [Fri, 28 May 2021 15:29:10 +0000 (17:29 +0200)]
tests/libalias: Measure cleanup time separatly

After long test runs, a lot of ressouces can be allocated.  Freeing
them takes a considerable amount of time.

3 years agolinux: make linux64.ko loadable again on aarch64
Edward Tomasz Napierala [Fri, 28 May 2021 13:53:31 +0000 (13:53 +0000)]
linux: make linux64.ko loadable again on aarch64

This should probably get deduplicated; this is a quick fix
just to unbreak things.

Fixes: 6d926e850d2
Sponsored By: EPSRC

3 years agoFix scripted installation from media without local distfiles.
Nathan Whitehorn [Fri, 28 May 2021 13:53:42 +0000 (09:53 -0400)]
Fix scripted installation from media without local distfiles.

The bsdinstall script target did not have the infrastructure to fetch
distfiles from a remote server the way the interactive installer does
on e.g. bootonly media. Solve this by factoring out the parts of the
installer that deal with fetching missing distributions into a new
install stage called 'fetchmissingdists', which is called by both the
interactive and scripted installer frontends.

In the course of these changes, cleaned up a few other issues with
the fetching of missing distribution files and added a warning if
fetching the MANIFEST file, which is used to verify the integrity of
the distribution files. We should at some point add cryptographic
signatures to MANIFEST so that it can be fetched safely if not present
on the install media (which it is for bootonly media).

Initial patch by: Vinícius Zavam
PR: 255659, 250928
Reviewed by: dteske
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D27121

3 years agoarm64: correct END() copy-pasteo for generic_bs_fault
Ed Maste [Fri, 28 May 2021 00:10:26 +0000 (20:10 -0400)]
arm64: correct END() copy-pasteo for generic_bs_fault

PR: 256197
Reported by: Nick Reilly
MFC after: 1 week
Fixes: 95a85c125d0e67 ("Add NetBSD compatible bus_space_peek_N()...")
Sponsored by: The FreeBSD Foundation

3 years agoRegen after 6d926e850d2.
Edward Tomasz Napierala [Fri, 28 May 2021 08:04:17 +0000 (09:04 +0100)]
Regen after 6d926e850d2.

Sponsored By: EPSRC

3 years agolinux: add new syscall numbers
Edward Tomasz Napierala [Fri, 28 May 2021 08:02:10 +0000 (09:02 +0100)]
linux: add new syscall numbers

Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D30193

3 years agoocs_fc: Fix use after free bug in ocs_hw_async_call()
Ram Kishore Vegesna [Fri, 28 May 2021 05:51:10 +0000 (11:21 +0530)]
ocs_fc: Fix use after free bug in ocs_hw_async_call()

Freed ctx is used in the later callee ocs_hw_command(),
which is a use after free bug.

Return error if sli_cmd_common_nop() failed.

PR: 255865
Reported by: lylgood@foxmail.com
Approved by:: markj

3 years agoocs_fc: Fix a use after free in ocs_sport_free
Ram Kishore Vegesna [Fri, 28 May 2021 05:26:13 +0000 (10:56 +0530)]
ocs_fc: Fix a use after free in ocs_sport_free

Domain which could be freed is used while freeing the sport.
Use ocs from sport.

PR: 255866
Reported by: lylgood@foxmail.com
Approved by:: markj

3 years agonfscl: Use hash lists to improve expected search performance for opens
Rick Macklem [Fri, 28 May 2021 02:08:36 +0000 (19:08 -0700)]
nfscl: Use hash lists to improve expected search performance for opens

A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.  When searching for an open,
usually for a match by file handle, a linear search of all opens
is done.

Commit 3f7e14ad9345 added a hash table of lists hashed on file handle
for the opens.  This patch uses the hash lists for searching for
a matching open based of file handle instead of an exhaustive
linear search of all opens.
This change appears to be performance neutral for a small number
of opens, but should improve expected performance for a large
number of opens.

This commit should not affect the high level semantics of open
handling.

MFC after: 2 weeks

3 years agohdspe: Support for mono sound.
Ruslan Bukin [Thu, 27 May 2021 20:40:21 +0000 (21:40 +0100)]
hdspe: Support for mono sound.

This is useful when you have a single monitor speaker.

3 years agoktrace: Fix a race with fork()
Mark Johnston [Thu, 27 May 2021 19:49:59 +0000 (15:49 -0400)]
ktrace: Fix a race with fork()

ktrace(2) may toggle trace points in any of
1. a single process
2. all members of a process group
3. all descendents of the processes in 1 or 2

In the first two cases, we do not permit the operation if the process is
being forked or not visible. However, in case 3 we did not enforce this
restriction for descendents. As a result, the assertions about the child
in ktrprocfork() may be violated.

Move these checks into ktrops() so that they are applied consistently.

Allow KTROP_CLEAR for nascent processes. Otherwise, there is a window
where we cannot clear trace points for a nascent child if they are
inherited from the parent.

Reported by: syzbot+d96676592978f137e05c@syzkaller.appspotmail.com
Reported by: syzbot+7c98fcf84a4439f2817f@syzkaller.appspotmail.com
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30481

3 years agokevent: Prohibit negative change and event list lengths
Mark Johnston [Thu, 27 May 2021 19:49:32 +0000 (15:49 -0400)]
kevent: Prohibit negative change and event list lengths

Previously, a negative change list length would be treated the same as
an empty change list.  A negative event list length would result in
bogus copyouts.  Make kevent(2) return EINVAL for both cases so that
application bugs are more easily found, and to be more robust against
future changes to kevent internals.

Reviewed by: imp, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30480

3 years agoktrace: Handle negative array sizes in ktrstructarray
Mark Johnston [Thu, 27 May 2021 19:49:12 +0000 (15:49 -0400)]
ktrace: Handle negative array sizes in ktrstructarray

ktrstructarray() may be used to create copies of kevent(2) change and
event arrays.  It is called before parameter validation is done and so
should check for bogus array lengths before allocating a copy.

Reported by: syzkaller
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30479

3 years agortwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3.
Dmitry Chagin [Thu, 27 May 2021 18:52:10 +0000 (21:52 +0300)]
rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3.

PR: 256203
Submitted by: Steve Kargl sgk at troutmask.apl.washington.edu
MFC after: 2 weeks

3 years agolibprocstat kstack: fix race with thread creation
Eric van Gyzen [Thu, 27 May 2021 16:33:22 +0000 (11:33 -0500)]
libprocstat kstack: fix race with thread creation

When collecting kernel stacks for a target process, if the process
adds a thread between the two calls to sysctl, ignore the additional
threads.  Previously, procstat would print only a useless error
message.  Now, it prints a consistent snapshot of the stacks.
We know that snapshot is already stale, but it could still be stale
even with a more complex fix to reallocate and retry, so such a fix
is hardly worth the effort.

Reported by: Daniel.Mitchell@emc.com
MFC after: 1 week
Sponsored by: Dell EMC Isilon

3 years agotcp: When we have an out-of-order FIN we do want to strip off the FIN bit.
Randall Stewart [Thu, 27 May 2021 14:50:32 +0000 (10:50 -0400)]
tcp: When we have an out-of-order FIN we do want to strip off the FIN bit.

The last set of commits fixed both a panic (in rack) and an ACK-war (in freebsd and bbr).
However there was a missing case, i.e. where we get an out-of-order FIN by itself.
In such a case we don't want to leave the FIN bit set, otherwise we will do the
wrong thing and ack the FIN incorrectly. Instead we need to go through the
tcp_reasm() code and that way the FIN will be stripped and all will be well.

Reviewed by: mtuexen,rscheff
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30497

3 years agoLinuxKPI: add HWEIGHT32()
Bjoern A. Zeeb [Thu, 27 May 2021 13:09:40 +0000 (13:09 +0000)]
LinuxKPI: add HWEIGHT32()

Add HWEIGHT32() macro needed by iwlwifi and while here add the 8/16/64
variants likewise.

Sponsored by: The FreeBSD Foundation
MFC after: 12 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30501

3 years agoLinuxKPI: netdevice.h remove more ifnet operating macros
Bjoern A. Zeeb [Wed, 26 May 2021 17:55:21 +0000 (17:55 +0000)]
LinuxKPI: netdevice.h remove more ifnet operating macros

Now that mlx4 and ofed either are operating on ifnet functions
directly or have a private copy of these macros, we can remove them
from linux/netdevice.h.
With this only the #define for net_device to ifnet is left.

Sponsored by: The FreeBSD Foundation
MFC after: 12 days
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D30478

3 years agoOFED: migrate LinuxKPI net_device/ifnet macros into ofed
Bjoern A. Zeeb [Wed, 26 May 2021 17:51:24 +0000 (17:51 +0000)]
OFED: migrate LinuxKPI net_device/ifnet macros into ofed

The LinuxKPI net_device actually is an ifnet; in order to further
clean that up so we can extend "net_device" migrate the few macros
left into ofed and make sure the header is included in all files
which need access to the macros.

Sponsored by: The FreeBSD Foundation
MFC after: 12 days
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D30477

3 years agomlx4: replace LinuxKPI macros with ifnet functions
Bjoern A. Zeeb [Wed, 26 May 2021 17:47:02 +0000 (17:47 +0000)]
mlx4: replace LinuxKPI macros with ifnet functions

The LinuxKPI net_device actually is an ifnet;  in order to further
clean that up so we can extend "net_device" replace the few macros
inline in mlx4.

Sponsored by: The FreeBSD Foundation
MFC after: 12 days
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D30476

3 years agoibstat: Include prototype for sysctlbyname().
Hans Petter Selasky [Thu, 27 May 2021 07:39:49 +0000 (09:39 +0200)]
ibstat: Include prototype for sysctlbyname().

Fixes the following compile warning:
      implicit declaration of function 'sysctlbyname' is invalid in C99
      [-Wimplicit-function-declaration]

Found by: J87
Differential Revision: https://reviews.freebsd.org/D30484
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agostress2: Removed three mksnap_ffs(8) tests from the exclude list
Peter Holm [Thu, 27 May 2021 06:52:12 +0000 (08:52 +0200)]
stress2: Removed three mksnap_ffs(8) tests from the exclude list

3 years agocxgbe(4): Fix an incorrect assert.
Navdeep Parhar [Thu, 27 May 2021 02:18:42 +0000 (19:18 -0700)]
cxgbe(4): Fix an incorrect assert.

CTRL and OFLD tx queues do not have automatic tx credit flush enabled so
it is okay for the cidx not to be the same as the pidx when the queue is
destroyed.

Reported by: Jithesh Arakkan @ Chelsio
MFC after: 1 week
Sponsored by: Chelsio Communications

3 years agocxgbe(4): Use correct argument in call to hashdestroy.
Navdeep Parhar [Thu, 27 May 2021 04:32:13 +0000 (21:32 -0700)]
cxgbe(4): Use correct argument in call to hashdestroy.

This fixes a panic on driver module unload.

Fixes: 24b98f288d11 cxgbe(4): Overhaul CLIP (Compressed Local IPv6) table management.
MFC after: 2 weeks
Sponsored by: Chelsio Communications

3 years agolibradius: Fix input validation bugs
Mark Johnston [Tue, 25 May 2021 17:59:09 +0000 (13:59 -0400)]
libradius: Fix input validation bugs

Approved by: so
Security: FreeBSD-SA-21:12.libradius
Security: CVE-2021-29629
MFC after: now
Sponsored by: The FreeBSD Foundation

3 years agotests/libalias: Fix build error due to wrong prototype
Lutz Donnerhacke [Wed, 26 May 2021 19:59:12 +0000 (21:59 +0200)]
tests/libalias: Fix build error due to wrong prototype

3 years agohwpmc: Move 4 bits of mode to extend class size to 8
Aleksandr Rybalko [Wed, 26 May 2021 18:39:00 +0000 (18:39 +0000)]
hwpmc: Move 4 bits of mode to extend class size to 8

Since r289025 we have had at least 5 bits class size.
Before that it was even 16 bits, but macro handling conversion between
pmcid and set of CPU, MODE, CLASS, ROWINDEX still use 4 bits class size
and 8 bits mode size.

This breaks some libpmc API methods, like pmc_capabilities.

Since we only have 4 modes and MODE field is a number (not a bitfield)
this patch moves 4 bits of mode to extend the CLASS field.

Reviewed by: mhorne, emaste
Sponsored by: Ampere Computing LLC
Submitted by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D30047

3 years agotcp: Use local CC data only in the correct context
Richard Scheffenegger [Wed, 26 May 2021 17:45:06 +0000 (19:45 +0200)]
tcp: Use local CC data only in the correct context

Most CC algos do use local data, and when calling
newreno_cong_signal from there, the latter misinterprets
the data as its own struct, leading to incorrect behavior.

Reported by:  chengc_netapp.com
Reviewed By:  chengc_netapp.com, tuexen, #transport
MFC after:    3 days
Sponsored By: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D30470

3 years agotests/libalias: Add missing prototype to fix build error
Lutz Donnerhacke [Wed, 26 May 2021 17:39:06 +0000 (19:39 +0200)]
tests/libalias: Add missing prototype to fix build error

3 years agoacpi: Add missing error handling to acpi_pci_link_route_irqs()
Mark Johnston [Wed, 26 May 2021 14:34:39 +0000 (10:34 -0400)]
acpi: Add missing error handling to acpi_pci_link_route_irqs()

Otherwise the resouce buffer may have been freed when
AcpiSetCurrentResources() is called, leading to a use-after-free.

PR: 255862
Submitted by: Lv Yunlong <lylgood@foxmail.com> (original version)
MFC after: 1 week

3 years agoktls.4: Mention mb_use_ext_pgs in the "sysctl nodes" section
Mark Johnston [Wed, 26 May 2021 14:20:37 +0000 (10:20 -0400)]
ktls.4: Mention mb_use_ext_pgs in the "sysctl nodes" section

Reviewed by: rmacklem, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30403

3 years agorpcsec_gss: Use a designated initializer for rpc_gss_ops
Mark Johnston [Wed, 26 May 2021 14:14:35 +0000 (10:14 -0400)]
rpcsec_gss: Use a designated initializer for rpc_gss_ops

No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agocxgb: Avoid a read-after-free in get_packet() when cxgb_debug is on
Mark Johnston [Wed, 26 May 2021 14:02:19 +0000 (10:02 -0400)]
cxgb: Avoid a read-after-free in get_packet() when cxgb_debug is on

PR: 224927
MFC after: 1 week

3 years agonetsmb: Avoid a read-after-free in smb_t2_request_int()
Mark Johnston [Wed, 26 May 2021 13:57:38 +0000 (09:57 -0400)]
netsmb: Avoid a read-after-free in smb_t2_request_int()

Defer freeing the request structure until we've decided whether the
request should be retried.

PR: 255881
MFC after: 1 week

3 years agooce: Fix handling of m_pullup() errors in oce_tso_setup()
Mark Johnston [Wed, 26 May 2021 13:49:49 +0000 (09:49 -0400)]
oce: Fix handling of m_pullup() errors in oce_tso_setup()

m_pullup() frees the input mbuf chain upon a failure.  Set *mpp to NULL
in this case to ensure that the caller does not free the chain again.

PR: 224928
Submitted by: Lv Yunlong <lylgood@foxmail.com> (original version)
MFC after: 1 week

3 years agotests/libalias: Add port forwardings
Lutz Donnerhacke [Mon, 24 May 2021 21:31:09 +0000 (23:31 +0200)]
tests/libalias: Add port forwardings

Add port forwardings to the performance tests.  This will cause random
incoming packets to match the random port forwardings opends beforehand.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30443

3 years agotests/libalias: Improve testing
Lutz Donnerhacke [Sun, 23 May 2021 17:48:13 +0000 (19:48 +0200)]
tests/libalias: Improve testing

gettimeofday(3) is almost as expensive as the calls to libalias.
So the call frequency for this call is reduced by a factor of 1000 in
order to neglect it's influence.

Using NAT entries became more realistic: A communication of a random
length of up to 150 packets (10% outgoing, 90% incoming) is applied
for each entry.

Precision of the execution time is raised to see the trends better.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30405

3 years agotests/libalias: Test LibAliasIn on redirection
Lutz Donnerhacke [Sun, 23 May 2021 20:39:30 +0000 (22:39 +0200)]
tests/libalias: Test LibAliasIn on redirection

Extend the test suite for libalias(3) to incoming connections.
Test the various types of redirections.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30408

3 years agotests/libalias: Factor out common primitives
Lutz Donnerhacke [Mon, 24 May 2021 12:43:01 +0000 (14:43 +0200)]
tests/libalias: Factor out common primitives

Rework the tests to check the correct layer in a single test.
Factor out tests for reuse in other modules.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30412

3 years agoelfctl: avoid touching file if no change made
Ed Maste [Tue, 25 May 2021 18:25:18 +0000 (14:25 -0400)]
elfctl: avoid touching file if no change made

Suggested by: brooks
Reviewed by: brooks, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30452

3 years agocxgbe: fix enabling lro & rxtimestamps
Andrew Gallatin [Wed, 26 May 2021 13:54:26 +0000 (09:54 -0400)]
cxgbe: fix enabling lro & rxtimestamps

A recent change caused iq flags, like LRO, to be set before
init_iq(). However, init_iq() clears those flags, so they
became effectively impossible to set.   This change moves
the initializion of these flags to after the call to init_iq().
This fixes LRO.

Differential Revision: https://reviews.freebsd.org/D30460
Reviewed by: np, rrs
Sponsored by: Netflix
Fixes: 43bbae19483fbde0a91e61acad8a6e71e334c8b8 <https://reviews.freebsd.org/R10:43bbae19483fbde0a91e61acad8a6e71e334c8b8>"
3 years agovmm: Let guests enable SMEP/SMAP if the host supports it
Mark Johnston [Wed, 26 May 2021 13:34:52 +0000 (09:34 -0400)]
vmm: Let guests enable SMEP/SMAP if the host supports it

Reviewed by: kib, grehan, jhb
Tested by: grehan (AMD)
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30462

3 years agopf tests: Only log critical errors from scapy
Kristof Provost [Wed, 26 May 2021 11:07:50 +0000 (13:07 +0200)]
pf tests: Only log critical errors from scapy

See a26e895f3d803cc1f4ee1c2b33c61330998808b9. Silence these new tests as
well.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agopf: Move nvlist conversion functions to pf_nv
Kristof Provost [Tue, 18 May 2021 07:24:50 +0000 (09:24 +0200)]
pf: Move nvlist conversion functions to pf_nv

Separate the conversion functions (between kernel structs and nvlists)
to pf_nv. This reduces the size of pf_ioctl.c, which is already quite
large and complex, a good bit. It also keeps all the fairly
straightforward conversion code together.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30359

3 years agoLinuxKPI/OFED/mlx4: cleanup netdevice.h some more
Bjoern A. Zeeb [Wed, 26 May 2021 12:27:26 +0000 (12:27 +0000)]
LinuxKPI/OFED/mlx4: cleanup netdevice.h some more

This removes all unused bits from linux/netdevice.h and migrates two
inline functions into the mlx4 and ofed code respectively.

This gets the mlx4/ofed (struct ifnet) specific bits down to 7 lines
in netdevice.h.

Sponsored by: The FreeBSD Foundation
MFC after: 13 days
Reviewed by: hselasky, kib
Differential Revision: https://reviews.freebsd.org/D30461

3 years agorc.d/random: add support for zero harvest_mask
Eugene Grosbein [Wed, 26 May 2021 11:30:24 +0000 (18:30 +0700)]
rc.d/random: add support for zero harvest_mask

Replace the check for zero harvest_mask with new check for empty string.
This allows one to specify harvest_mask="0" that disables harversting
entropy from all but "pure" sources. Exact bit values for "pure" sources
differ for stable/12 and later branches, so it is handy to use zero.
The check for zero pre-dates introduction of "pure" non-maskable sources
Use empty string to disable altering sysctl kern.random.harvest.mask.

Note that notion of "pure" random sources is not documented in user level
manual pages yet. Still, it helps to extend battery life for hardware
with embedded "Intel Secure Key RNG" by disabling all other sources.

Note that no defaults changed and default behaviour is not affected.

Reported by: Dmitry Luhtionov

3 years agoUnstaticize parts of coredumping code
Edward Tomasz Napierala [Wed, 26 May 2021 09:23:37 +0000 (10:23 +0100)]
Unstaticize parts of coredumping code

This makes it possible to call __elfN(size_segments) and __elfN(puthdr)
from Linux coredump code.

Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D30455

3 years agotcp: Add a socket option to rack so we can test various changes to the slop value...
Randall Stewart [Wed, 26 May 2021 10:43:30 +0000 (06:43 -0400)]
tcp: Add a socket option to rack so we can test various changes to the slop value in timers.

Timer_slop, in TCP, has been 200ms for a long time. This value dates back
a long time when delayed ack timers were longer and links were slower. A
200ms timer slop allows 1 MSS to be sent over a 60kbps link. Its possible that
lowering this value to something more in line with todays delayed ack values (40ms)
might improve TCP. This bit of code makes it so rack can, via a socket option,
adjust the timer slop.

Reviewed by: mtuexen
Sponsered by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30249

3 years agoo Fix i2c read operation for large transfers (more than 32 bytes).
Ruslan Bukin [Wed, 26 May 2021 09:55:23 +0000 (10:55 +0100)]
o Fix i2c read operation for large transfers (more than 32 bytes).
o Fix slave address setting.

This allows to read the EDID from an HDMI monitor.

Reviewed by: manu
Sponsored by: UKRI
Differential Revision: https://reviews.freebsd.org/D27139

3 years agoFix a use-after-free in an error case.
Takanori Watanabe [Wed, 26 May 2021 09:23:33 +0000 (18:23 +0900)]
Fix a use-after-free in an error case.

PR: 255872
Submitted by:  lylgood
Differential Revision:  https://reviews.freebsd.org/D30454

3 years agortwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list.
Dmitry Chagin [Wed, 26 May 2021 07:13:08 +0000 (10:13 +0300)]
rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list.

MFC after: 2 weeks

3 years agortwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano).
Dmitry Chagin [Wed, 26 May 2021 06:47:30 +0000 (09:47 +0300)]
rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano).

MFC after: 2 weeks

3 years agostress2: Added a new ptrace() test scenario
Peter Holm [Wed, 26 May 2021 06:08:56 +0000 (08:08 +0200)]
stress2: Added a new ptrace() test scenario

3 years agostress2: Update the exclude list
Peter Holm [Wed, 26 May 2021 06:06:38 +0000 (08:06 +0200)]
stress2: Update the exclude list

3 years agostress2: Fix cleanup on exit
Peter Holm [Wed, 26 May 2021 06:05:55 +0000 (08:05 +0200)]
stress2: Fix cleanup on exit

3 years agolinux_common: retire extra module version.
Dmitry Chagin [Wed, 26 May 2021 05:34:32 +0000 (08:34 +0300)]
linux_common: retire extra module version.

The second 'linuxcommon' line was added by c66f5b079d2a259c3a65b1efe0f2143cd030dc52
but Linuxulator's modules dependend on 'linux_common'.
To avoid such mistakes in the future rename moduledata name and module
name to  'linux_common' and retire 'linuxcommon' line.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D30409
MFC after: 2 weeks

3 years agortwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list
Dmitry Chagin [Wed, 26 May 2021 05:01:04 +0000 (08:01 +0300)]
rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list

MFC after: 2 weeks

3 years agoossl: Use crypto_cursor_segment().
John Baldwin [Tue, 25 May 2021 23:59:19 +0000 (16:59 -0700)]
ossl: Use crypto_cursor_segment().

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

3 years agocryptosoft: Use crypto_cursor_segment().
John Baldwin [Tue, 25 May 2021 23:59:19 +0000 (16:59 -0700)]
cryptosoft: Use crypto_cursor_segment().

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

3 years agocrypto: Add crypto_cursor_segment() to fetch both base and length.
John Baldwin [Tue, 25 May 2021 23:59:19 +0000 (16:59 -0700)]
crypto: Add crypto_cursor_segment() to fetch both base and length.

This function combines crypto_cursor_segbase() and
crypto_cursor_seglen() into a single function.  This is mostly
beneficial in the unmapped mbuf case where back to back calls of these
two functions have to iterate over the sub-components of unmapped
mbufs twice.

Bump __FreeBSD_version for crypto drivers in ports.

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

3 years agoInclude the trailer in the original dst_iov.
John Baldwin [Tue, 25 May 2021 23:59:19 +0000 (16:59 -0700)]
Include the trailer in the original dst_iov.

This avoids creating a duplicate copy on the stack just to
append the trailer.

Reviewed by: gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30139

3 years agoAssume OCF is the only KTLS software backend.
John Baldwin [Tue, 25 May 2021 23:59:19 +0000 (16:59 -0700)]
Assume OCF is the only KTLS software backend.

This removes support for loadable software backends.  The KTLS OCF
support is now always included in kernels with KERN_TLS and the
ktls_ocf.ko module has been removed.  The software encryption routines
now take an mbuf directly and use the TLS mbuf as the crypto buffer
when possible.

Bump __FreeBSD_version for software backends in ports.

Reviewed by: gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30138

3 years agoktls_ocf: Fix a few places to not hardcode the GMAC hash length.
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
ktls_ocf: Fix a few places to not hardcode the GMAC hash length.

This is not a functional change as the Poly1305 hash is the same
length as the GMAC hash length.

Reviewed by: gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30137

3 years agocrypto: Add a new type of crypto buffer for a single mbuf.
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
crypto: Add a new type of crypto buffer for a single mbuf.

This is intended for use in KTLS transmit where each TLS record is
described by a single mbuf that is itself queued in the socket buffer.
Using the existing CRYPTO_BUF_MBUF would result in
bus_dmamap_load_crp() walking additional mbufs in the socket buffer
that are not relevant, but generating a S/G list that potentially
exceeds the limit of the tag (while also wasting CPU cycles).

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

3 years agosglist: Add sglist_append_single_mbuf().
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
sglist: Add sglist_append_single_mbuf().

This function appends the contents of a single mbuf to an sglist
rather than an entire mbuf chain.

Reviewed by: gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30135

3 years agoSupport unmapped mbufs in crypto buffers.
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
Support unmapped mbufs in crypto buffers.

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

3 years agoRename m_unmappedtouio() to m_unmapped_uiomove().
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
Rename m_unmappedtouio() to m_unmapped_uiomove().

This function doesn't only copy data into a uio but instead is a
variant of uiomove() similar to uiomove_fromphys().

Reviewed by: gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30444

3 years agoExtend m_copyback() to support unmapped mbufs.
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
Extend m_copyback() to support unmapped mbufs.

Reviewed by: gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30133

3 years agoExtend m_apply() to support unmapped mbufs.
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
Extend m_apply() to support unmapped mbufs.

m_apply() invokes the callback function separately on each segment of
an unmapped mbuf: the TLS header, individual pages, and the TLS
trailer.

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

3 years agoamd64/linux*: add required header to get the constant value
Konstantin Belousov [Tue, 25 May 2021 22:19:44 +0000 (01:19 +0300)]
amd64/linux*: add required header to get the constant value

Otherwise asm silently interpret it as the external global symbol.

Reported by: bz
Sponsored by: The FreeBSD Foundation
Fixes: 91aae953cb80

3 years agonfscl: Use hash lists to improve expected search performance for opens
Rick Macklem [Tue, 25 May 2021 21:19:29 +0000 (14:19 -0700)]
nfscl: Use hash lists to improve expected search performance for opens

A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.  When searching for an open,
usually for a match by file handle, a linear search of all opens
is done.

Commit 3f7e14ad9345 added a hash table of lists hashed on file handle
for the opens.  This patch uses the hash lists for searching for
a matching open based of file handle instead of an exhaustive
linear search of all opens.
This change appears to be performance neutral for a small number
of opens, but should improve expected performance for a large
number of opens.  This patch also moves any found match to the front
of the hash list, to try and maintain the hash lists in recently
used ordering (least recently used at the end of the list).

This commit should not affect the high level semantics of open
handling.

MFC after: 2 weeks

3 years agoipfilter: Fix ip_nat memory leak and use-after-free
Cy Schubert [Tue, 25 May 2021 18:54:49 +0000 (11:54 -0700)]
ipfilter: Fix ip_nat memory leak and use-after-free

Unfortunately the wrong elemet is freed, also resulting in use-after-free.

PR: 255859
Submitted by: lylgood@foxmail.com
Reported by: lylgood@foxmail.com
MFC after: 3 days

3 years agoBump __FreeBSD_version to 1400015 for LinuxKPI changes.
Bjoern A. Zeeb [Tue, 25 May 2021 17:37:15 +0000 (17:37 +0000)]
Bump __FreeBSD_version to 1400015 for LinuxKPI changes.

Commits 17accc08ae15 and de102f870501 add new files to LinuxKPI
which break drm-kmod.  In addition various other additions where
comitted. Bump __FreeBSD_version to 1400015 to be able to detect this.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

3 years agoLinuxKPI: add addrconf_addr_solict_mult()
Bjoern A. Zeeb [Mon, 24 May 2021 17:49:12 +0000 (17:49 +0000)]
LinuxKPI: add addrconf_addr_solict_mult()

Introduce net/addrconf.h with an implementation to
addrconf_addr_solict_mult() used by WiFi drivers.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30416

3 years agoLinuxKPI: add Exponentially Weighted Moving Average implementation
Bjoern A. Zeeb [Mon, 24 May 2021 17:42:25 +0000 (17:42 +0000)]
LinuxKPI: add Exponentially Weighted Moving Average implementation

Add DECLARE_EWMA() which expands to a per-name EWMA implementation
as used by multiple wireless drivers.

Sposnored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky, cperciva, dwmalone
Differential Revision: https://reviews.freebsd.org/D30415

3 years agoLinuxKPI: add linux/bsearch.h for sort(9)
Bjoern A. Zeeb [Mon, 24 May 2021 17:52:02 +0000 (17:52 +0000)]
LinuxKPI: add linux/bsearch.h for sort(9)

Add linux/bsearch.h which only includes libkern.h as the sort(9)
functions seem to be compatible.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30417

3 years agoLinuxKPI: byteorder.h
Bjoern A. Zeeb [Mon, 24 May 2021 17:54:16 +0000 (17:54 +0000)]
LinuxKPI: byteorder.h

Add a few more le<n>_{tp,add}_cpu*() #defines/functions found in
wireless drivers.  While here fill most of the combinatorics gaps
and also add the remaining combinations [1].

Suggested by: emaste [1] (for one part)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30418

3 years agoLinuxKPI: cache.h add SMP_CACHE_BYTES
Bjoern A. Zeeb [Mon, 24 May 2021 17:56:53 +0000 (17:56 +0000)]
LinuxKPI: cache.h add SMP_CACHE_BYTES

Add a definition for SMP_CACHE_BYTES and while here include sys/param.h
for CACHE_LINE_SIZE as otherwise code might not compile standalone.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30419

3 years agoLinuxKPI: compiler.h add three more defines
Bjoern A. Zeeb [Mon, 24 May 2021 17:59:13 +0000 (17:59 +0000)]
LinuxKPI: compiler.h add three more defines

Add fallthrough, ____cacheline_aligned_in_smp, and smp_mb() to
linux/compiler.h.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30420

3 years agoLinuxKPI: add cpu.h for cpumask_*()
Bjoern A. Zeeb [Mon, 24 May 2021 18:01:59 +0000 (18:01 +0000)]
LinuxKPI: add cpu.h for cpumask_*()

Add linux/cpu.h for cpumask_*() functions found in wireless drivers
and make sure cpu_online_mask is always initialised.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30421

3 years agoLinuxKPI: add devcoredump.h
Bjoern A. Zeeb [Mon, 24 May 2021 18:04:31 +0000 (18:04 +0000)]
LinuxKPI: add devcoredump.h

Add linux/devcoredump.h with stub implementation of dev_coredumpv()
and dev_coredumpsg() which only free the passed in SG table as needed
for iwlwifi.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30423

3 years agoLinuxKPI: add dev_crit() to linux/device.h
Bjoern A. Zeeb [Mon, 24 May 2021 18:07:31 +0000 (18:07 +0000)]
LinuxKPI: add dev_crit() to linux/device.h

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: emaste, hselasky
Differential Revision: https://reviews.freebsd.org/D30424

3 years agoLinuxKPI: add ether_addr_equal_unaligned()
Bjoern A. Zeeb [Mon, 24 May 2021 18:09:37 +0000 (18:09 +0000)]
LinuxKPI: add ether_addr_equal_unaligned()

Replace the implementation for ether_addr_equal() with
ether_addr_equal_unaligned() and add a define for ether_addr_equal()
pointing to the now ether_addr_equal_unaligned() implementation.
This way ether_addr_equal_unaligned() cannot be broken by accident [1].

Suggested by: emaste [1]
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30425

3 years agoLinuxKPI: net/if_inet6.h add struct inet6_dev { }
Bjoern A. Zeeb [Mon, 24 May 2021 18:11:56 +0000 (18:11 +0000)]
LinuxKPI: net/if_inet6.h add struct inet6_dev { }

Add a dummy struct inet6_dev {}; to net/if_inet6.h.  This is currently
not used for anything but in a declaration.  Just needs to be there.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30426

3 years agoLinuxKPI: add irq_set_affinity_hint()
Bjoern A. Zeeb [Mon, 24 May 2021 18:14:37 +0000 (18:14 +0000)]
LinuxKPI: add irq_set_affinity_hint()

Add an implementation for irq_set_affinity_hint() to linux/interrupt.h
and include linux/hardirq.h for synchronize_irq() as needed by
wireless drivers.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30427

3 years agoLinuxKPI: add linux/{ip,tcp,udp}.h
Bjoern A. Zeeb [Mon, 24 May 2021 18:17:30 +0000 (18:17 +0000)]
LinuxKPI: add linux/{ip,tcp,udp}.h

Add header files for struct and accessors for IPv4, UDP, and TCP.
Only parts of the fields of the structs have been seen while working
on wireless drivers.  The remaining field names are filled up with
the FreeBSD field names for now.  If you have insights into their
correct naming in Linux, feel free to adjust.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30428

3 years agoLinuxKPI: ipv6.h add missing #include
Bjoern A. Zeeb [Mon, 24 May 2021 18:21:55 +0000 (18:21 +0000)]
LinuxKPI: ipv6.h add missing #include

Include linux/bitops.h for a definition of BITS_PER_LONG so that this
file can be used independently.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30429

3 years agoLinuxKPI: add time_is_after_jiffies() definition
Bjoern A. Zeeb [Mon, 24 May 2021 18:24:13 +0000 (18:24 +0000)]
LinuxKPI: add time_is_after_jiffies() definition

This is used by wireless drivers.  Use the time_after() macro as
done for the "after_eq" version.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30430

3 years agoLinuxKPI: change BUILD_BUG_ON()
Bjoern A. Zeeb [Mon, 24 May 2021 18:26:41 +0000 (18:26 +0000)]
LinuxKPI: change BUILD_BUG_ON()

BUILD_BUG_ON() can be used inside functions where the definition to
CTASSERT() (_Static_assert()) seems to not work.
Go back to an old-style CTASSERT() implementation but also add a
variable dclaration to avoid "unsued typedef" errors and dummy-use
the variable to avoid "unusued variable" errors.  Given it is all
self-contained in a block and not used outside this should be
optimised away.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30431

3 years agoLinuxKPI: add ktime_get_boottime_ns() implementation to ktime.h
Bjoern A. Zeeb [Mon, 24 May 2021 18:30:33 +0000 (18:30 +0000)]
LinuxKPI: add ktime_get_boottime_ns() implementation to ktime.h

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30432

3 years agoLinuxKPI: add LINUXKPI_PARAM_charp()
Bjoern A. Zeeb [Mon, 24 May 2021 18:32:11 +0000 (18:32 +0000)]
LinuxKPI: add LINUXKPI_PARAM_charp()

Add yet another version of the various module_param_named() use cases.
This one deals with "charp".

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30433

3 years agoLinuxKPI: add more #defines to pci.h
Bjoern A. Zeeb [Mon, 24 May 2021 18:36:18 +0000 (18:36 +0000)]
LinuxKPI: add more #defines to pci.h

Add more definitions for various PCI uses to linux/pci.h.  Almost all
are defined to their FreeBSD counterparts which are described there.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30434

3 years agoLinuxKPI: add prandom_u32() as used by wireless drivers.
Bjoern A. Zeeb [Mon, 24 May 2021 18:38:58 +0000 (18:38 +0000)]
LinuxKPI: add prandom_u32() as used by wireless drivers.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30435

3 years agoLinuxKPI: add rcu_dereference_check()
Bjoern A. Zeeb [Mon, 24 May 2021 18:40:42 +0000 (18:40 +0000)]
LinuxKPI: add rcu_dereference_check()

Add a define for rcu_dereference_check() to rcu_dereference_protected()
which ignores the check argument.  Our lockdep compat implementation
for use cases found in iwlwifi would return 1 anyway.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30436

3 years agoLinuxKPI: add kfree_sensitive() using zfree().
Bjoern A. Zeeb [Mon, 24 May 2021 18:43:33 +0000 (18:43 +0000)]
LinuxKPI: add kfree_sensitive() using zfree().

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30437

3 years agoLinuxKPI: extract stringify() in their own header file
Bjoern A. Zeeb [Mon, 24 May 2021 18:53:28 +0000 (18:53 +0000)]
LinuxKPI: extract stringify() in their own header file

Add linux/stringify.h as directly included by drivers.  Remove the
definitions from compiler.h and include the new header in places
where the stringify macros are already used without linuxkpi.

I have adjusted the Copyright of the new file according to the commit
originaly adding the macros (99e690772adbcb78c9e8441bedcf1913d72ea72f).

Sposnored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30440

3 years agoLinuxKPI: add kernel_ulong_t typedef in linux/kernel.h.
Bjoern A. Zeeb [Mon, 24 May 2021 18:47:49 +0000 (18:47 +0000)]
LinuxKPI: add kernel_ulong_t typedef in linux/kernel.h.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30438

3 years agoLinuxKPI: add guid_t for ACPI consumers.
Bjoern A. Zeeb [Mon, 24 May 2021 18:50:10 +0000 (18:50 +0000)]
LinuxKPI: add guid_t for ACPI consumers.

Add a placeholder struct for guid_t which is needed by ACPI consumers
in at least one wireless driver.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30439

3 years agotcp: enter network epoch when calling tfb_tcp_fb_fini
Andrew Gallatin [Tue, 25 May 2021 17:45:37 +0000 (13:45 -0400)]
tcp: enter network epoch when calling tfb_tcp_fb_fini

We need to enter the network epoch when calling into
tfb_tcp_fb_fini.  I noticed this when I hit an assert
running the latest rack

Differential Revision: https://reviews.freebsd.org/D30407
Reviewed by: rrs, tuexen
Sponsored by: Netflix

3 years agotcp: Fix bugs related to the PUSH bit and rack and an ack war
Randall Stewart [Tue, 25 May 2021 17:23:31 +0000 (13:23 -0400)]
tcp: Fix bugs related to the PUSH bit and rack and an ack war

Michaels testing with UDP tunneling found an issue with the push bit, which was only partly fixed
in the last commit. The problem is the left edge gets transmitted before the adjustments are done
to the send_map, this means that right edge bits must be considered to be added only if
the entire RSM is being retransmitted.

Now syzkaller also continued to find a crash, which Michael sent me the reproducer for. Turns
out that the reproducer on default (freebsd) stack made the stack get into an ack-war with itself.
After fixing the reference issues in rack the same ack-war was found in rack (and bbr). Basically
what happens is we go into the reassembly code and lose the FIN bit. The trick here is we
should not be going into the reassembly code if tlen == 0 i.e. the peer never sent you anything.
That then gets the proper action on the FIN bit but then you end up in LAST_ACK with no
timers running. This is because the usrclosed function gets called and the FIN's and such have
already been exchanged. So when we should be entering FIN_WAIT2 (or even FIN_WAIT1) we get
stuck in LAST_ACK. Fixing this means tweaking the usrclosed function so that we properly
recognize the condition and drop into FIN_WAIT2 where a timer will allow at least TP_MAXIDLE
before closing (to allow time for the peer to retransmit its FIN if the ack is lost). Setting the fast_finwait2
timer can speed this up in testing.

Reviewed by: mtuexen,rscheff
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30451