]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

(cherry picked from commit 5184e2da41921dfec5a3668756890b5c073fbad9)

3 years agonetgraph/ng_base: Renaming a node to the same name is a noop
Lutz Donnerhacke [Tue, 4 May 2021 19:20:39 +0000 (21:20 +0200)]
netgraph/ng_base: Renaming a node to the same name is a noop

Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2
brought the problem down to a double call of ng_node_name() before and
after a vnet move.  Because the name of the node is already known
(occupied by itself), the second call fails.

PR: 241954
Reported by: Paul Armstrong
Differential Revision: https://reviews.freebsd.org/D30110

(cherry picked from commit 0345fd891fe13a191fc0fae9463ea9458bfaff5a)

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

(cherry picked from commit 434c46c00602e16115cfb19344e4c45135b68b09)

3 years agoDisable x2APIC for SandyBridge laptops with Samsung BIOS
Konstantin Belousov [Wed, 2 Jun 2021 22:29:07 +0000 (01:29 +0300)]
Disable x2APIC for SandyBridge laptops with Samsung BIOS

PR: 256389

(cherry picked from commit 37f780d3e0a2e8e4c64c526b6e7dc77ff6b91057)

3 years agomadt_setup_local: extract special case checks into a helper
Konstantin Belousov [Wed, 2 Jun 2021 22:27:32 +0000 (01:27 +0300)]
madt_setup_local: extract special case checks into a helper

(cherry picked from commit e9e00cc0c98738f0ce7bface221c920c36a1356e)

3 years agomadt_setup_local: convert series of strcmp to iteration over the array
Konstantin Belousov [Wed, 2 Jun 2021 22:19:09 +0000 (01:19 +0300)]
madt_setup_local: convert series of strcmp to iteration over the array

(cherry picked from commit 92adf00d0512b674ce18eb1a542ae42e85dd5bca)

3 years agomadt_setup_local: skip further checks if ACPI DMAR table already disabled x2APIC
Konstantin Belousov [Wed, 2 Jun 2021 22:01:28 +0000 (01:01 +0300)]
madt_setup_local: skip further checks if ACPI DMAR table already disabled x2APIC

(cherry picked from commit a603d41aca48ff21df59967c55ddef181e16ec14)

3 years agosrc.conf.5: Regen.
John Baldwin [Wed, 9 Jun 2021 22:24:42 +0000 (15:24 -0700)]
src.conf.5: Regen.

3 years agoAdd a description for WITH_SVNLITE.
John Baldwin [Wed, 5 May 2021 21:05:38 +0000 (14:05 -0700)]
Add a description for WITH_SVNLITE.

Reviewed by: emaste
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D30106

(cherry picked from commit 0ac711e07ece9ac260023a62250d50fb2f37e975)

3 years agoDisable building svnlite(1) by default.
John Baldwin [Wed, 5 May 2021 21:05:10 +0000 (14:05 -0700)]
Disable building svnlite(1) by default.

Now that all repositories have switched to git, initiate the de-orbit
burn for svnlite(1).

Reviewed by: emaste
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D30105

(cherry picked from commit a2bc17474b962ba9e29c4526356203fe48a549eb)

3 years agolibcrypto: Add symbol versions for symbols added since 1.1.1d.
John Baldwin [Fri, 28 May 2021 22:18:15 +0000 (15:18 -0700)]
libcrypto: Add symbol versions for symbols added since 1.1.1d.

While here, trim a spurious local: I missed when added SSL_sendfile.

PR: 255277
Reported by: yuri
Reviewed by: jkim
Differential Revision: https://reviews.freebsd.org/D30483

(cherry picked from commit 7ad70d22c667173586c04fc13dd315995d78fbbf)

3 years agoetcupdate: Add -D destdir to usage for 'extract'.
John Baldwin [Mon, 26 Apr 2021 16:49:34 +0000 (09:49 -0700)]
etcupdate: Add -D destdir to usage for 'extract'.

Reported by: Mark Millard <marklmi@yahoo.com>

(cherry picked from commit 5eb9c93a20d7320b24635ed09eba4908951bdeb2)

3 years agoetcupdate: Add a revert mode to restore one or more stock files.
John Baldwin [Tue, 20 Apr 2021 20:22:35 +0000 (13:22 -0700)]
etcupdate: Add a revert mode to restore one or more stock files.

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

(cherry picked from commit ba30215ae0efeb49e5e9ca2469d95edaea78680d)

3 years agoetcupdate: Trim trailing whitespace.
John Baldwin [Tue, 20 Apr 2021 20:22:24 +0000 (13:22 -0700)]
etcupdate: Trim trailing whitespace.

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

(cherry picked from commit ada7fd17d57fac3dbafff5a1b3268afb872c8b0b)

3 years agoetcupdate: Gracefully handle SIGINT when building trees.
John Baldwin [Tue, 20 Apr 2021 20:22:11 +0000 (13:22 -0700)]
etcupdate: Gracefully handle SIGINT when building trees.

Run the 'build_tree' function inside of a subshell and trap SIGINT to
return an error to the caller.  This allows callers to gracefully
cleanup a partially created tree.

While here, redirect stdout/stderr of the subshell to the log file
instead of applying redirections individually to each command executed
while building the tree.

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

(cherry picked from commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e)

3 years agoetcupdate: Always extract to a temporary tree.
John Baldwin [Tue, 20 Apr 2021 20:21:42 +0000 (13:21 -0700)]
etcupdate: Always extract to a temporary tree.

etcupdate has had a somewhat nasty race condition since its creation
in that its state machine can get very confused if it is interrupted
while building the tree to compare against.  This is exacerbated by
the fact that etcupdate doesn't emit any output while building the
tree which can take several seconds (especially in recent years with
the addition of the tree-wide buildconfig/installconfig passes).

To mitigate this, always install a new tree into a temporary directory
created via mktemp as was previously done only for dry-runs via -n.
The existing trees are only rotated and the new tree installed as
/var/db/etcupdate/current after the update command has completed.

Reported by: dim, np (and many others)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D29843

(cherry picked from commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472)
(cherry picked from commit b0df36580d5b0df67a0f58ded8f6356b268f7f71)

3 years agopciconf: Fix up pciconf -lc output
David Bright [Mon, 24 May 2021 19:02:43 +0000 (14:02 -0500)]
pciconf: Fix up pciconf -lc output

The pciconf command fails to emit newlines when particular ecap field
values are seen. Fix them up. This has been seen on several systems at
$JOB. The documentation for PCI capabilities says that capability
type 0 should not be used once the spec for PCI capabilities was
published, but that seems more wishful-thinking than reality. pciconf
also chooses not to print fields related to field values that are
zero, but it seems several of these fields are zero on actual
hardware.

Sponsored by: Dell EMC Isilon
Submitted by: Robert Herndon (Robert.Herndon@dell.com)

(cherry picked from commit 2f176a2b20107f7a9132242223e9eef657400514)

3 years agolibsa: Fix infinite loop in bzipfs & gzipfs
David Bright [Mon, 24 May 2021 17:12:15 +0000 (12:12 -0500)]
libsa: Fix infinite loop in bzipfs & gzipfs

A bug in the loader's bzipfs & gzipfs filesystems caused compressed
kernel and modules not to work on EFI systems with a veriexec-enabled
loader. Since the size of files in these filesystems are not known
_a priori_ `stat` would initialize the size to -1 and the loader would
then hang in an infinite loop while trying to seek (read) to the end
of file since the loop termination condition compares the current
offset to that negative target position.

Sponsored by: Dell EMC Isilon

(cherry picked from commit 3df4c387d2e3ca4c2391fb837540b048f60a11c2)

3 years agotcp: fix a RACK socket buffer lock issue
Michael Tuexen [Mon, 24 May 2021 18:31:23 +0000 (20:31 +0200)]
tcp: fix a RACK socket buffer lock issue

Fix a missing socket buffer unlocking of the socket receive buffer.

Reviewed by: gallatin, rrs
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D30402

(cherry picked from commit 9bbd1a8fcb13928cd4b6cfddf0a8359d5dc97451)

3 years agorack: honor prior socket buffer lock when doing the upcall
Richard Scheffenegger [Fri, 21 May 2021 22:08:56 +0000 (00:08 +0200)]
rack: honor prior socket buffer lock when doing the upcall

While partially reverting D24237 with D29690, due to introducing some
unintended effects for in-kernel TCP consumers, the preexisting lock
on the socket send buffer was not considered properly.

Found by: markj
MFC after: 2 weeks
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D30390

(cherry picked from commit 39756885633fd9d9649b4cb0f0abf594bfeb8dbb)

3 years ago[tcp] Keep socket buffer locked until upcall
Richard Scheffenegger [Fri, 21 May 2021 09:00:53 +0000 (11:00 +0200)]
[tcp] Keep socket buffer locked until upcall

r367492 would unlock the socket buffer before eventually calling the upcall.
This leads to problematic interaction with NFS kernel server/client components
(MP threads) accessing the socket buffer with potentially not correctly updated
state.

Reported by: rmacklem
Reviewed By: tuexen, #transport
Tested by: rmacklem, otis
MFC after: 2 weeks
Sponsored By: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29690

(cherry picked from commit 032bf749fd44ac5ff20aab2c3d8e3c05491778ea)

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).

(cherry picked from commit 17dafdc0de7e8ab0c750d1339e4debc78262e19b)

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

(cherry picked from commit 962b3a092616c95c68c0b0a844f4660675aa40f6)

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.

(cherry picked from commit 399bad7b9a105930b8203ad0a1fd154681bc16b8)

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

(cherry picked from commit 14803ec8d193d8d46f4137a7dba61b277c6a2fed)

3 years agotcp: A better fix for the previously attempted fix of the ack-war issue with tcp.
Randall Stewart [Fri, 4 Jun 2021 09:26:43 +0000 (05:26 -0400)]
tcp: A better fix for the previously attempted fix of the ack-war issue with tcp.

So it turns out that my fix before was not correct. It ended with us failing
some of the "improved" SYN tests, since we are not in the correct states.
With more digging I have figured out the root of the problem is that when
we receive a SYN|FIN the reassembly code made it so we create a segq entry
to hold the FIN. In the established state where we were not in order this
would be correct i.e. a 0 len with a FIN would need to be accepted. But
if you are in a front state we need to strip the FIN so we correctly handle
the ACK but ignore the FIN. This gets us into the proper states
and avoids the previous ack war.

I back out some of the previous changes but then add a new change
here in tcp_reass() that fixes the root cause of the issue. We still
leave the rack panic fixes in place however.

Reviewed by: mtuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30627

(cherry picked from commit 4747500deaaa7765ba1c0413197c23ddba4faf49)

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

(cherry picked from commit 8c69d988a8d32e53310c7b73ec8721b04b7249e6)

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

(cherry picked from commit 4f3addd94be5e02e6e425f6119f5409972ab5d14)

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

(cherry picked from commit 13c0e198ca275447f9a60a03f730c38c98f19009)

3 years agotcp: Fix an issue with the PUSH bit as well as fill in the missing mtu change for...
Randall Stewart [Mon, 24 May 2021 18:42:15 +0000 (14:42 -0400)]
tcp: Fix an issue with the PUSH bit as well as fill in the missing mtu change for fsb's

The push bit itself was also not actually being properly moved to
the right edge. The FIN bit was incorrectly on the left edge. We
fix these two issues as well as plumb in the mtu_change for
alternate stacks.

Reviewed by: mtuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30413

(cherry picked from commit 631449d5d03506295eaa6947c1b0e8a168a2f6b7)

3 years agotcp: Handle stack switch while processing socket options
Michael Tuexen [Sat, 22 May 2021 12:35:09 +0000 (14:35 +0200)]
tcp: Handle stack switch while processing socket options

Handle the case where during socket option processing, the user
switches a stack such that processing the stack specific socket
option does not make sense anymore. Return an error in this case.

Reviewed by: markj
Reported by: syzbot+a6e1d91f240ad5d72cd1@syzkaller.appspotmail.com
Sponsored by: Netflix, Inc.
Differential revision: https://reviews.freebsd.org/D30395

(cherry picked from commit 8923ce630492d21ec57c2637757bcc44da9970f8)

3 years agotcp: Fix sending of TCP segments with IP level options
Michael Tuexen [Fri, 21 May 2021 07:45:00 +0000 (09:45 +0200)]
tcp: Fix sending of TCP segments with IP level options

When bringing in TCP over UDP support in
https://cgit.FreeBSD.org/src/commit/?id=9e644c23000c2f5028b235f6263d17ffb24d3605,
the length of IP level options was considered when locating the
transport header. This was incorrect and is fixed by this patch.

X-MFC with: https://cgit.FreeBSD.org/src/commit/?id=9e644c23000c2f5028b235f6263d17ffb24d3605
Reviewed by: markj, rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D30358

(cherry picked from commit 500eb6dd80404ea512e31a8f795c73cb802c9c64)

3 years agotcp: Incorrect KASSERT causes a panic in rack
Randall Stewart [Thu, 13 May 2021 11:36:04 +0000 (07:36 -0400)]
tcp: Incorrect KASSERT causes a panic in rack

Skyzall found an interesting panic in rack. When a SYN and FIN are
both sent together a KASSERT gets tripped where it is validating that
a mbuf pointer is in the sendmap. But a SYN and FIN often will not
have a mbuf pointer. So the fix is two fold a) make sure that the
SYN and FIN split the right way when cloning an RSM SYN on left
edge and FIN on right. And also make sure the KASSERT properly
accounts for the case that we have a SYN or FIN so we don't
panic.

Reviewed by: mtuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D30241

(cherry picked from commit 02cffbc2507e83944b0c29d69d6ddf26c9386d54)

3 years agomod_cc: cross reference CC modules consistently
Michael Tuexen [Thu, 13 May 2021 08:47:45 +0000 (10:47 +0200)]
mod_cc: cross reference CC modules consistently

Reviewed by: bcr, gbe
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D30240

(cherry picked from commit 8ea5eeb913b94aa45aa7773d14b31222d509ec34)

3 years agotcp rack: improve initialisation of retransmit timeout
Michael Tuexen [Wed, 12 May 2021 15:58:56 +0000 (17:58 +0200)]
tcp rack: improve initialisation of retransmit timeout

When the TCP is in the front states, don't take the slop variable
into account. This improves consistency with the base stack.

Reviewed by: rrs@
Differential Revision: https://reviews.freebsd.org/D30230
Sponsored by: Netflix, Inc.

(cherry picked from commit 251842c63927fc4af63bdc61989bbfbf3823c679)

3 years agotcp: In rack, we must only convert restored rtt when the hostcache does restore them.
Randall Stewart [Tue, 11 May 2021 12:15:05 +0000 (08:15 -0400)]
tcp: In rack, we must only convert restored rtt when the hostcache does restore them.

Rack now after the previous commit is very careful to translate any
value in the hostcache for srtt/rttvar into its proper format. However
there is a snafu here in that if tp->srtt is 0 is the only time that
the HC will actually restore the srtt. We need to then only convert
the srtt restored when it is actually restored. We do this by making
sure it was zero before the call to cc_conn_init and it is non-zero
afterwards.

Reviewed by: Michael Tuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30213

(cherry picked from commit 4b86a24a76a4d58c1d870fcb2252b321f61cb3cc)

3 years agotcp:Host cache and rack ending up with incorrect values.
Randall Stewart [Mon, 10 May 2021 15:25:51 +0000 (11:25 -0400)]
tcp:Host cache and rack ending up with incorrect values.

The hostcache up to now as been updated in the discard callback
but without checking if we are all done (the race where there are
more than one calls and the counter has not yet reached zero). This
means that when the race occurs, we end up calling the hc_upate
more than once. Also alternate stacks can keep there srtt/rttvar
in different formats (example rack keeps its values in microseconds).
Since we call the hc_update *before* the stack fini() then the
values will be in the wrong format.

Rack on the other hand, needs to convert items pulled from the
hostcache into its internal format else it may end up with
very much incorrect values from the hostcache. In the process
lets commonize the update mechanism for srtt/rttvar since we
now have more than one place that needs to call it.

Reviewed by: Michael Tuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30172

(cherry picked from commit 9867224bab3f247ac875d89c2472aa4bc855fe3b)

3 years agoThis takes Warners suggested approach to making it so that
Randall Stewart [Fri, 7 May 2021 21:32:32 +0000 (17:32 -0400)]
This takes Warners suggested approach to making it so that
platforms that for whatever reason cannot include the RATELIMIT option
can still work with rack. It adds two dummy functions that rack will
call and find out that the highest hw supported b/w is 0 (which
kinda makes sense and rack is already prepared to handle).

Reviewed by: Michael Tuexen, Warner Losh
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30163

(cherry picked from commit 5a4333a5378f7afe4f8cab293a987865ae0c32c4)

3 years agoFix a UDP tunneling issue with rack. Basically there are two
Randall Stewart [Fri, 7 May 2021 18:06:43 +0000 (14:06 -0400)]
Fix a UDP tunneling issue with rack. Basically there are two
issues.
A) Not enough hdrlen was being calculated when a UDP tunnel is
   in place.
and
B) Not enough memory is allocated in racks fsb. We need to
   overbook the fsb to include a udphdr just in case.

Submitted by: Peter Lei
Reviewed by: Michael Tuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30157

(cherry picked from commit a16cee0218652230d94a73690201e76baab0bba1)

3 years agoThis brings into sync FreeBSD with the netflix versions of rack and bbr.
Randall Stewart [Thu, 6 May 2021 15:22:26 +0000 (11:22 -0400)]
This brings into sync FreeBSD with the netflix versions of rack and bbr.
This fixes several breakages (panics) since the tcp_lro code was
committed that have been reported. Quite a few new features are
now in rack (prefecting of DGP -- Dynamic Goodput Pacing among the
largest). There is also support for ack-war prevention. Documents
comming soon on rack..

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

(cherry picked from commit 5d8fd932e418f03e98b3469c4088a36f0ef34ffe)

3 years agoFix LINT kernel builds after 1a714ff20419 .
Hans Petter Selasky [Mon, 1 Feb 2021 12:23:21 +0000 (13:23 +0100)]
Fix LINT kernel builds after 1a714ff20419 .

Discussed with: rrs@
Differential Revision:  https://reviews.freebsd.org/D28357
Sponsored by: Mellanox Technologies // NVIDIA Networking

(cherry picked from commit db46c0d0cb3da2813727e56df1f2db292065867a)

3 years agozfs: merge openzfs/zfs@7d9f3ef0e (zfs-2.1-release) into stable/13
Martin Matuska [Tue, 8 Jun 2021 15:01:18 +0000 (17:01 +0200)]
zfs: merge openzfs/zfs@7d9f3ef0e (zfs-2.1-release) into stable/13

Notable upstream pull request merges:
  #11710 Allow zfs to send replication streams with missing snapshots
  #11786 Ratelimit deadman zevents as with delay zevents
  #11813 Allow pool names that look like Solaris disk names
  #11822 Atomically check and set dropped zevent count
  #11822 Don't scale zfs_zevent_len_max by CPU count
  #11837 zfs get -p only outputs 3 columns if "clones" property is empty
  #11849 Use dsl_scan_setup_check() to setup a scrub
  #11861 Improvements to the 'compatibility' property
  #11862 cmd/zfs receive: allow dry-run (-n) to check property args
  #11864 receive: don't fail inheriting (-x) properties on wrong dataset type
  #11877 Combine zio caches if possible
  #11881 FreeBSD: use vnlru_free_vfsops if available
  #11883 FreeBSD: add support for lockless symlink lookup
  #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr
  #11896 Fix crash in zio_done error reporting
  #11905 zfs-send(8): Restore sorting of flags
  #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir
  #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines
  #11966 Scale worker threads and taskqs with number of CPUs
  #11997 FreeBSD: Don't force xattr mount option
  #11997 FreeBSD: Use SET_ERROR to trace xattr name errors
  #11998 Simplify/fix dnode_move() for dn_zfetch
  #12003 FreeBSD: Initialize/destroy zp->z_lock
  #12010 Fix dRAID self-healing short columns
  #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots"
  #12040 Reinstate the old zpool read label logic as a fallback
  #12049 FreeBSD: avoid memory allocation in arc_prune_async
  #12061 Fix dRAID sequential resilver silent damage handling
  #12077 FreeBSD: Retry OCF ENOMEM errors.
  #12088 Propagate vdev state due to invalid label corruption
  #12097 FreeBSD: Update dataset_kstats for zvols in dev mode

Obtained from: OpenZFS
OpenZFS commit: 7d9f3ef0ef5c26424d6f1eab2c7d4dfa3e7f9950
OpenZFS tag: 2.1.0-rc6

3 years agozfs: merge openzfs/zfs@3522f57b6 (zfs-2.1-release) to stable/13
Martin Matuska [Tue, 8 Jun 2021 14:36:23 +0000 (16:36 +0200)]
zfs: merge openzfs/zfs@3522f57b6 (zfs-2.1-release) to stable/13

This changes branch tracking of sys/contrib/openzfs to a new
direct-import branch vendor/openzfs/zfs-2.1-release.

No functional changes.

OpenZFS tag: 2.1.0-rc1

3 years agoamd64: Clear the local TSS when creating a new thread
Mark Johnston [Tue, 1 Jun 2021 23:38:22 +0000 (19:38 -0400)]
amd64: Clear the local TSS when creating a new thread

Otherwise it is copied from the creating thread.  Then, if either thread
exits, the other is left with a dangling pointer, typically resulting in
a page fault upon the next context switch.

Reported by: syzkaller
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 8cd05b883330049d536a40e2f4c9ff92d0e6944e)

3 years agoi386: Make setidt_disp a size_t instead of uintptr_t
Mark Johnston [Tue, 1 Jun 2021 14:28:57 +0000 (10:28 -0400)]
i386: Make setidt_disp a size_t instead of uintptr_t

setidt_disp is the offset of the ISR trampoline relative to the address
of the routines in exception.s, so uintptr_t is not quite right.

Also remove a bogus declaration I added in commit 18f55c67f7, it is not
required after all.

Reported by: jrtc27
Reviewed by: jrtc27, kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit cbe59a6475b6c36fac4073bcfc328099fc873420)

3 years agopf: Avoid leaking pad bytes in struct pfr_astats when copying out
Mark Johnston [Tue, 1 Jun 2021 14:56:23 +0000 (10:56 -0400)]
pf: Avoid leaking pad bytes in struct pfr_astats when copying out

There is padding between pfr_astats.pfras_a and pfras_packets that was
not getting initialized.

Reported by: KMSAN
Reviewed by: kp, imp
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 60a38abb8982e11ee71559057dd7128bd097043e)

3 years agong_parse: IP address parsing in netgraph eating too many characters
Markus Stoff [Tue, 18 May 2021 20:35:33 +0000 (22:35 +0200)]
ng_parse: IP address parsing in netgraph eating too many characters

Once the final component of the IP address has been parsed, the offset
on the input must not be advanced, as this would remove an unparsed
character from the input.

Submitted by: Markus Stoff
Reviewed by: donner
Differential Revision: https://reviews.freebsd.org/D26489

(cherry picked from commit 63b6a08ce2467b8e230e7a4ecb3e1ddf1b48851c)

3 years agoThis pulls over all the changes that are in the netflix
Randall Stewart [Tue, 26 Jan 2021 16:54:42 +0000 (11:54 -0500)]
This pulls over all the changes that are in the netflix
tree that fix the ratelimit code. There were several bugs
in tcp_ratelimit itself and we needed further work to support
the multiple tag format coming for the joint TLS and Ratelimit dances.

    Sponsored by: Netflix Inc.
    Differential Revision:  https://reviews.freebsd.org/D28357

(cherry picked from commit 1a714ff204193b9eb810426048e03f5d76e9730e)

3 years agoAdd thread_reap_barrier()
Konstantin Belousov [Tue, 25 May 2021 18:51:00 +0000 (21:51 +0300)]
Add thread_reap_barrier()

(cherry picked from commit f62c7e54e9cc692603081328597ba0ba0d1f21cf)
(cherry picked from commit d3f7975fcb346ea28dde079a9c04cff5ef20a8d7)

3 years agoquisce_cpus(): add special handling for PDROP
Konstantin Belousov [Fri, 28 May 2021 17:10:47 +0000 (20:10 +0300)]
quisce_cpus(): add special handling for PDROP

(cherry picked from commit 3a68546d2377d6e9776060043372d66f07022543)

3 years agokern_thread.c: wrap too long lines
Konstantin Belousov [Tue, 25 May 2021 18:09:33 +0000 (21:09 +0300)]
kern_thread.c: wrap too long lines

(cherry picked from commit 845d77974b3b6ab78297836ead2d2acbcdebeba7)

3 years agokern linker: do not allow more than one kldload and kldunload syscalls simultaneously
Konstantin Belousov [Thu, 20 May 2021 14:50:43 +0000 (17:50 +0300)]
kern linker: do not allow more than one kldload and kldunload syscalls simultaneously

(cherry picked from commit e266a0f7f001c7886eab56d8c058d92d87010400)

3 years agopf tests: Make killstate:match more robust
Kristof Provost [Thu, 3 Jun 2021 13:22:19 +0000 (15:22 +0200)]
pf tests: Make killstate:match more robust

The killstate:match test starts nc as a background process. There was no
guarantee that the nc process would have connected by the time we check
for states, so this test occasionally failed without good reason.

Teach the test to wait for at least some states to turn up before
executing the critical checks.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 70dd30d49c29a27e1ef159660a7e3dbb84082674)

3 years agotcp: fix man page
Michael Tuexen [Sat, 24 Apr 2021 20:31:36 +0000 (22:31 +0200)]
tcp: fix man page

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

(cherry picked from commit 6096814d3134234d48936f557d431a793e35d8b3)

3 years agomend
Michael Tuexen [Sun, 18 Apr 2021 14:08:08 +0000 (16:08 +0200)]
mend

3 years agosctp: fix another locking bug in COOKIE handling
Michael Tuexen [Wed, 12 May 2021 21:02:31 +0000 (23:02 +0200)]
sctp: fix another locking bug in COOKIE handling

Thanks to Tolya Korniltsev for reporting the issue for
the userland stack and testing the fix.

(cherry picked from commit eec6aed5b8c848841ae8d25940e0a333e5039ce9)

3 years agolibalias: Remove unused function LibAliasCheckNewLink
Lutz Donnerhacke [Sat, 15 May 2021 13:24:12 +0000 (15:24 +0200)]
libalias: Remove unused function LibAliasCheckNewLink

The functionality to detect a newly created link after processing a
single packet is decoupled from the packet processing.  Every new
packet is processed asynchronously and will reset the indicator, hence
the function is unusable.  I made a Google search for third party code,
which uses the function, and failed to find one.

That's why the function should be removed: It unusable and unused.
A much simplified API/ABI will remain in anything below 14.

Discussed with: kp
Reviewed by: manpages (bcr)
Differential Revision: https://reviews.freebsd.org/D30275

(cherry picked from commit bfd41ba1fe1d0e40b6a813aeb0354cac8d884f5b)

3 years agoffs: Correct the input size check in sysctl_ffs_fsck()
Mark Johnston [Mon, 31 May 2021 22:56:34 +0000 (18:56 -0400)]
ffs: Correct the input size check in sysctl_ffs_fsck()

Make sure we return an error if no input was specified, since
SYSCTL_IN() will report success in that case.

Reported by: KMSAN
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b2f9575646f89cdddcad76acae3e9305535506a2)

3 years agoamd64: Relax the assertion added in commit 4a59cbc12
Mark Johnston [Tue, 1 Jun 2021 23:38:09 +0000 (19:38 -0400)]
amd64: Relax the assertion added in commit 4a59cbc12

We only need to ensure that interrupts are disabled when handling a
fault from iret.  Otherwise it's possible to trigger the assertion
legitimately, e.g., by copying in from an invalid address.

Fixes: 4a59cbc12
Reported by: pho
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6cda62755612d706f30a99f70ff13ffa0f3f2422)

3 years agoamd64: Avoid enabling interrupts when handling kernel mode prot faults
Mark Johnston [Mon, 31 May 2021 22:49:33 +0000 (18:49 -0400)]
amd64: Avoid enabling interrupts when handling kernel mode prot faults

When PTI is enabled, we may have been on the trampoline stack when iret
faults.  So, we have to switch back to the regular stack before
re-entering trap().

trap() has the somewhat strange behaviour of re-enabling interrupts when
handling certain kernel-mode execeptions.  In particular, it was doing
this for exceptions raised during execution of iret.  When switching
away from the trampoline stack, however, the thread must not be migrated
to a different CPU.  Fix the problem by simply leaving interrupts
disabled during the window.

Reported by: syzbot+6cfa544fd86ad4647ffc@syzkaller.appspotmail.com
Reported by: syzbot+cfdfc9e5a8f28f11a7f5@syzkaller.appspotmail.com
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 4a59cbc1253266ea70d6fa43b1a7c77cc33ec6cd)

3 years agox86: Fix lapic_ipi_alloc() on i386
Mark Johnston [Mon, 31 May 2021 22:51:14 +0000 (18:51 -0400)]
x86: Fix lapic_ipi_alloc() on i386

The loop which checks to see if "dynamic" IDT entries are allocated
needs to compare with the trampoline address of the reserved ISR.
Otherwise it will never succeed.

Reported by: Harry Schmalzbauer <freebsd@omnilan.de>
Tested by: Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 18f55c67f746f0ad12fe972328234d340a621df9)

3 years agokqueue: replace kq_ncallouts loop with atomic_fetchadd
Mateusz Guzik [Wed, 2 Jun 2021 15:14:58 +0000 (15:14 +0000)]
kqueue: replace kq_ncallouts loop with atomic_fetchadd

(cherry picked from commit c9f8dcda856c50325190326a618dc251311bc43a)

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...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit d097687b315671191b16494c938d3ceecd3eca4f)

3 years agotmpfs: save on relocking the allnode lock in tmpfs_free_node_locked
Mateusz Guzik [Thu, 27 May 2021 08:57:59 +0000 (10:57 +0200)]
tmpfs: save on relocking the allnode lock in tmpfs_free_node_locked

(cherry picked from commit f4aa64528e4557cd18cdb376b0f88f4a34d69912)

3 years agotmpfs: save on common case relocking in tmpfs_reclaim
Mateusz Guzik [Sat, 29 May 2021 01:36:50 +0000 (03:36 +0200)]
tmpfs: save on common case relocking in tmpfs_reclaim

(cherry picked from commit 331a7601c9c21c1e55c57c5338e7affced9c7b7c)

3 years agotmpfs: drop a redundant NULL check in tmpfs_alloc_vp
Mateusz Guzik [Sat, 29 May 2021 01:10:53 +0000 (03:10 +0200)]
tmpfs: drop a redundant NULL check in tmpfs_alloc_vp

(cherry picked from commit 439d942b9e7ab4df2bb7a628602069d31788df17)

3 years agotmpfs: drop useless parent locking from tmpfs_dir_getdotdotdent
Mateusz Guzik [Sat, 29 May 2021 15:38:21 +0000 (17:38 +0200)]
tmpfs: drop useless parent locking from tmpfs_dir_getdotdotdent

The id field is immutable until the node gets freed.

(cherry picked from commit 7fbeaf33b8e1a5e69af42a77c78a6fcb3029f1ca)

3 years agovfs: use the sentinel trick in locked lookup path parsing
Mateusz Guzik [Tue, 25 May 2021 17:34:26 +0000 (19:34 +0200)]
vfs: use the sentinel trick in locked lookup path parsing

(cherry picked from commit d81aefa8b7dd8cbeffeda541fca9962802404983)

3 years agoFix up macro use in lim_cur
Mateusz Guzik [Sat, 29 May 2021 17:46:37 +0000 (19:46 +0200)]
Fix up macro use in lim_cur

(cherry picked from commit dde5c031ed0d93d080442b26133e9ea800bbcd22)

3 years agofd: use PROC_WAIT_UNLOCKED when clearing p_fd/p_pd
Mateusz Guzik [Thu, 27 May 2021 14:29:26 +0000 (14:29 +0000)]
fd: use PROC_WAIT_UNLOCKED when clearing p_fd/p_pd

(cherry picked from commit 9bfddb3ac4ce8a2fbd5bb212a263747343a931e7)

3 years agovfs: retire unused vn_seqc_write_begin_unheld*
Mateusz Guzik [Sat, 29 May 2021 02:26:19 +0000 (04:26 +0200)]
vfs: retire unused vn_seqc_write_begin_unheld*

(cherry picked from commit 3cf75ca220fb6a9006fa0481b97e154602f6f554)

3 years agoproc: add PROC_WAIT_UNLOCKED
Mateusz Guzik [Thu, 27 May 2021 14:29:14 +0000 (14:29 +0000)]
proc: add PROC_WAIT_UNLOCKED

(cherry picked from commit 528f8f38953d92aa917cbe70d3c72d89440624ca)

3 years agovfs: elide vnode locking when it is only needed for audit if possible
Mateusz Guzik [Sun, 23 May 2021 19:28:26 +0000 (21:28 +0200)]
vfs: elide vnode locking when it is only needed for audit if possible

(cherry picked from commit a269183875f6d5141c81277d41b552871e2171e5)

3 years agoumtx: convert umtxq_lock to a macro
Mateusz Guzik [Sat, 22 May 2021 20:51:37 +0000 (20:51 +0000)]
umtx: convert umtxq_lock to a macro

Then LOCK_PROFILING starts reporting callers instead of the inline.

(cherry picked from commit 138f78e94bf83a8a92987d8be81f1e2c6c277cf8)

3 years agoext2: add missing uio_td initialization to ext2_htree_append_block
Mateusz Guzik [Sun, 30 May 2021 17:14:02 +0000 (19:14 +0200)]
ext2: add missing uio_td initialization to ext2_htree_append_block

Reported by: pho

(cherry picked from commit 284cf3f18b5395e29e128702d50342d706813773)

3 years agonfs: even up value returned by nfsrv_parsename with copyinstr
Mateusz Guzik [Mon, 31 May 2021 16:32:04 +0000 (16:32 +0000)]
nfs: even up value returned by nfsrv_parsename with copyinstr

Reported by: dim
Reviewed by: rmacklem

(cherry picked from commit 68c254426467e3f900f9a19de4dd9a234ea75388)

3 years agovfs: fix MNT_SYNCHRONOUS check in vn_write
Rich Ercolani [Wed, 2 Jun 2021 13:00:29 +0000 (13:00 +0000)]
vfs: fix MNT_SYNCHRONOUS check in vn_write

ca1ce50b2b5ef11d ("vfs: add more safety against concurrent forced
unmount to vn_write") has a side effect of only checking MNT_SYNCHRONOUS
if O_FSYNC is set.

Reviewed By: mjg
Differential Revision: https://reviews.freebsd.org/D30610

(cherry picked from commit a19ae1b099ad4d43588f15ef19b8506f606b27cb)

3 years agosctp: fix locking in case of error handling during a restart
Michael Tuexen [Wed, 12 May 2021 13:29:06 +0000 (15:29 +0200)]
sctp: fix locking in case of error handling during a restart

Thanks to Taylor Brandstetter for finding the issue and providing
a patch for the userland stack.

(cherry picked from commit 12dda000ed32efa16f59909a6294e4d4b5a771ba)

3 years agosctp: improve consistency when handling chunks of wrong size
Michael Tuexen [Wed, 5 May 2021 23:02:41 +0000 (01:02 +0200)]
sctp: improve consistency when handling chunks of wrong size

(cherry picked from commit d1cb8d11b0c09c35b87c144bab7b02b75c5725b6)

3 years agosctp: drop packet with SHUTDOWN-ACK chunks with wrong vtags
Michael Tuexen [Tue, 4 May 2021 16:42:31 +0000 (18:42 +0200)]
sctp: drop packet with SHUTDOWN-ACK chunks with wrong vtags

(cherry picked from commit b621fbb1bf1b2a1e6ea22e0ad2d7667b1aec9fae)

3 years agosctp: improve address list scanning
Michael Tuexen [Mon, 3 May 2021 00:50:05 +0000 (02:50 +0200)]
sctp: improve address list scanning

If the alternate address has to be removed, force the stack to
find a new one, if it is still needed.

(cherry picked from commit 8b3d0f6439fa27f0d37a9a7b9d27bbfdfdf487c4)

3 years agosctp: improve restart handling
Michael Tuexen [Mon, 3 May 2021 00:20:24 +0000 (02:20 +0200)]
sctp: improve restart handling

This fixes in particular a possible use after free bug reported
Anatoly Korniltsev and Taylor Brandstetter for the userland stack.

(cherry picked from commit a89481d328fd96ccbfa642e1db6d03825fa1dc6d)

3 years agoFix build after 5f2e1835054ee84f2e68ebc890d92716a91775b7.
Alexander Motin [Mon, 3 May 2021 00:07:38 +0000 (20:07 -0400)]
Fix build after 5f2e1835054ee84f2e68ebc890d92716a91775b7.

(cherry picked from commit 655c200cc89185c940bc7d5724be09a0f2e1a8a6)

3 years agosctp: improve error handling in INIT/INIT-ACK processing
Michael Tuexen [Sun, 2 May 2021 20:38:27 +0000 (22:38 +0200)]
sctp: improve error handling in INIT/INIT-ACK processing

When processing INIT and INIT-ACK information, also during
COOKIE processing, delete the current association, when it
would end up in an inconsistent state.

(cherry picked from commit 5f2e1835054ee84f2e68ebc890d92716a91775b7)

3 years agosctp: update the vtag for INIT and INIT-ACK chunks
Michael Tuexen [Fri, 30 Apr 2021 11:31:38 +0000 (13:31 +0200)]
sctp: update the vtag for INIT and INIT-ACK chunks

This is needed in case of responding with an ABORT to an INIT-ACK.

(cherry picked from commit e010d20032c8c2a04da103b3402a8d24bd682dd5)

3 years agosctp: fix SCTP_PEER_ADDR_PARAMS socket option
Michael Tuexen [Fri, 30 Apr 2021 10:27:47 +0000 (12:27 +0200)]
sctp: fix SCTP_PEER_ADDR_PARAMS socket option

Ignore spp_pathmtu if it is 0, when setting the IPPROTO_SCTP level
socket option SCTP_PEER_ADDR_PARAMS as required by RFC 6458.

(cherry picked from commit eb79855920ffa33d6c096221eac9cc9a6d7a484b)

3 years agosctp: use RTO.Initial of 1 second as specified in RFC 4960bis
Michael Tuexen [Thu, 29 Apr 2021 22:45:56 +0000 (00:45 +0200)]
sctp: use RTO.Initial of 1 second as specified in RFC 4960bis

(cherry picked from commit eecdf5220b1a559e4b58c3c21daf502e3fbfd1cd)

3 years agosctp: improve consistency in handling chunks with wrong size
Michael Tuexen [Wed, 28 Apr 2021 16:09:11 +0000 (18:09 +0200)]
sctp: improve consistency in handling chunks with wrong size

Just skip the chunk, if no other handling is required by the
specification.

(cherry picked from commit 9de7354bb8e0c7821aa90db3486605f933c6796d)

3 years agosctp: cleanup verification of INIT and INIT-ACK chunks
Michael Tuexen [Tue, 27 Apr 2021 10:45:14 +0000 (12:45 +0200)]
sctp: cleanup verification of INIT and INIT-ACK chunks

(cherry picked from commit 059ec2225c00cc18ed9745d733cc9aa0dbd9eaa2)

3 years agosctp: improve handling of illegal packets containing INIT chunks
Michael Tuexen [Mon, 26 Apr 2021 08:38:05 +0000 (10:38 +0200)]
sctp: improve handling of illegal packets containing INIT chunks

Stop further processing of a packet when detecting that it
contains an INIT chunk, which is too small or is not the only
chunk in the packet. Still allow to finish the processing
of chunks before the INIT chunk.

Thanks to Antoly Korniltsev and Taylor Brandstetter for reporting
an issue with the userland stack, which made me aware of this
issue.

(cherry picked from commit c70d1ef15db0d994eff4a2c4d9feabdc46bff1c6)

3 years agosctp: small cleanup, no functional change
Michael Tuexen [Mon, 26 Apr 2021 00:56:48 +0000 (02:56 +0200)]
sctp: small cleanup, no functional change

(cherry picked from commit 163153c2a0809d2710e607463dcb24c7f795e156)

3 years agosctp: fix handling of RTO.initial of 1 ms
Michael Tuexen [Mon, 22 Mar 2021 15:40:41 +0000 (16:40 +0100)]
sctp: fix handling of RTO.initial of 1 ms

Reported by: syzbot+5eb0e009147050056ce9@syzkaller.appspotmail.com

(cherry picked from commit d995cc7e5431873b839269fe22577acfa3b157bd)

3 years agotcp: improve handling of SYN segments in SYN-SENT state
Michael Tuexen [Mon, 22 Mar 2021 14:58:49 +0000 (15:58 +0100)]
tcp: improve handling of SYN segments in SYN-SENT state

Ensure that the stack does not generate a DSACK block for user
data received on a SYN segment in SYN-SENT state.

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

(cherry picked from commit 40f41ece765dc0b0907ca90796a1af4f4f89b2a0)

3 years agosqlite3: import sqlite3 3.35.5
Cy Schubert [Fri, 7 May 2021 01:01:44 +0000 (18:01 -0700)]
sqlite3: import sqlite3 3.35.5

Merge commit '0511e356f5e2106928ee352ee974d1470c860a9a' into new_merge

Changes at https://www.sqlite.org/releaselog/3_35_5.html.

(cherry picked from commit ce9de47260d4edc963a94140789e4a52642c28e6)

3 years agoImport sqlite 3.34.1 (3340100).
Cy Schubert [Mon, 25 Jan 2021 17:45:04 +0000 (09:45 -0800)]
Import sqlite 3.34.1 (3340100).

(cherry picked from commit 25cdacf79b06356c929e59d5074d26c9dac41bdf)

3 years agovinvalbuf: do not panic if we were unable to flush dirty buffers
Konstantin Belousov [Sun, 30 May 2021 16:52:42 +0000 (19:52 +0300)]
vinvalbuf: do not panic if we were unable to flush dirty buffers

PR: 238565

(cherry picked from commit 27006229f7a40a18a61a0e8fd270bc583326b690)

3 years agoCirrus-CI: Add descriptive task name
Ed Maste [Wed, 2 Jun 2021 15:31:48 +0000 (11:31 -0400)]
Cirrus-CI: Add descriptive task name

Previously it appeared only as "main" in places like GitHub's list
of checks run as part of a pull request.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 903526542ac2309c08c769e517ea173a9f67cdb2)

3 years agoRestore Cirrus-CI boot smoke test
Ed Maste [Sun, 2 May 2021 19:28:36 +0000 (15:28 -0400)]
Restore Cirrus-CI boot smoke test

This reverts commit a7d593dd1da27833b5384349700bc3c7bcae6aad.
We now use compute_engine_instance which allows us to specify a custom
disk size.  Also go back to using the default qemu version (rather than
qemu42 or qemu-devel) as any issues were fixed some time ago.

Reviewed by: lwhsu, markj
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30082

(cherry picked from commit cec2682cd2910080951782391d7d7cd30c95c4ea)

3 years agoAdd C++ headers <barrier> <concepts> <execution> <latch> <numbers> <semaphore>
Dimitry Andric [Thu, 3 Jun 2021 18:53:18 +0000 (20:53 +0200)]
Add C++ headers <barrier> <concepts> <execution> <latch> <numbers> <semaphore>

I missed adding these to the libc++ Makefile, when importing
llvm-project 11.0.0-rc1, even though they were supplied by upstream.

While here, update OptionalObsoleteFiles.inc to add these new headers,
and cleanup old cruft.

Reported by: yuri
Submitted by: jkim (Makefile diff)
PR: 255374
MFC after: 3 days

(cherry picked from commit 95aa617e4bf09fcc813b1bab3d0dbf4b606807b1)

3 years agoMerge llvm commits for kernel address and memory sanitizer support
Dimitry Andric [Sun, 6 Jun 2021 11:38:33 +0000 (13:38 +0200)]
Merge llvm commits for kernel address and memory sanitizer support

Merge commit 99eca1bd9c7a from llvm git (by Mark Johnston):

  [Driver] Enable kernel address and memory sanitizers on FreeBSD

  Test Plan: using kernel ASAN and MSAN implementations in FreeBSD

  Reviewed By: emaste, dim, arichardson

  Differential Revision: https://reviews.llvm.org/D98286

Merge commit f511dc75e4c1 from llvm git (by Mark Johnston):

  [asan] Add an offset for the kernel address sanitizer on FreeBSD

  This is based on a port of the sanitizer runtime to the FreeBSD kernel
  that has been commited as https://cgit.freebsd.org/src/commit/?id=38da497a4dfcf1979c8c2b0e9f3fa0564035c147
  and the following commits.

  Reviewed By: emaste, dim
  Differential Revision: https://reviews.llvm.org/D98285

Requested by: markj
MFC after: 3 days

(cherry picked from commit 1b00608b264f1fac846e571e23d8ef7134834638)