Commit graph

7072 commits

Author SHA1 Message Date
Gordon Bergling
b7c2ea78e8 tcp_htps: Fix a typo in a source code comment
- s/postion/position/

(cherry picked from commit 1f2aaef29a)
2022-04-14 08:11:37 +02:00
Gordon Bergling
318558f579 tcp_bbr(4): Fix a typo in a source code comment
- s/possiblity/possibility/

(cherry picked from commit 2dd0c2bc7f)
2022-04-14 08:06:07 +02:00
Gordon Bergling
8e8deee0ec tcp_bbr(4): Fix two typos in source code comments
- s/postive/positive/
- s/postion/position/

(cherry picked from commit 665709016d)
2022-04-14 08:04:45 +02:00
Gordon Bergling
d2c483caa3 libalias(3): Fix two typos in source code comments
- s/modfied/modified/

(cherry picked from commit 1cfd924f4e)
2022-04-14 08:04:17 +02:00
Gordon Bergling
2e1670c799 tcp_rack: Fix a typo in a source code comment
- s/possiblity/possibility/

(cherry picked from commit addb2c6585)
2022-04-14 08:01:49 +02:00
Gordon Bergling
abf7997b8b tcp_bbr(4): Fix a typo in a sysctl description and a comment
- s/postive/positive/

(cherry picked from commit 4d6883cbe2)
2022-04-14 07:58:08 +02:00
Gordon Bergling
abe171cc5c tcp_rack: Fix a few typos in sysctl descriptions and comments
- s/postion/position/
- s/postions/positions/
- s/repostion/reposition/

(cherry picked from commit 36814092d4)
2022-04-14 07:57:39 +02:00
Mark Johnston
251aee96ae net: Fix LLE lock leaks
Historically, lltable_try_set_entry_addr() would release the LLE lock
upon failure.  After some refactoring, it no longer does so, but
consumers were not adjusted accordingly.

Also fix a leak that can occur if lltable_calc_llheader() fails in the
ARP code, but I suspect that such a failure can only occur due to a code
bug.

Reviewed by:	bz, melifaro
Reported by:	pho
Fixes:		0b79b007eb ("[lltable] Restructure nd6 code.")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit dd91d84486)
2022-04-11 09:43:27 -04:00
Gordon Bergling
39ff0036f1 cc_vegas(4): Fix a typo in a source code comment
- s/measurment/measurement/

(cherry picked from commit 17628f1b79)
2022-04-09 08:16:35 +02:00
Gordon Bergling
c33470cbe2 khelp(9): Fix a typo in a source code comment
- s/measurment/measurement/

(cherry picked from commit 8d30ef92d5)
2022-04-09 08:13:16 +02:00
Gordon Bergling
a643b8e17a netinet: Fix a typo in a source code comment
- s/exisitng/existing/

(cherry picked from commit 942e8cab8c)
2022-04-09 08:10:08 +02:00
George V. Neville-Neil
528d5d75e9 Address issue pointed out in CVE-2020-25705
Add jitter to the ICMP bandwidth limit to deny a side-channel port scan.

Reviewed by:	kp, philip, cy, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27354

(cherry picked from commit ca4cd20c4a)
2022-04-07 09:35:36 +02:00
Navdeep Parhar
73fc39b1bf Fix typo (interrups -> interrupts) in a sysctl description in tcp_lro.c.
(cherry picked from commit 08c7f1b6d4)
2022-04-06 18:49:50 -07:00
Gordon Bergling
99d226c07f extra_tcp_stacks: Fix two typos in source code comments
- s/recusive/recursive/

(cherry picked from commit 75fdc440c8)
2022-04-02 15:30:44 +02:00
Alexander V. Chernikov
ffcca53561 [lltable] Add per-family lltable getters.
Introduce a new function, lltable_get(), to retrieve lltable pointer
 for the specified interface and family.
Use it to avoid all-iftable list traversal when adding or deleting
 ARP/ND records.

Differential Revision: https://reviews.freebsd.org/D33660
MFC after:	2 weeks

(cherry picked from commit ff3a85d324)
2022-03-28 08:47:38 +00:00
Alexander V. Chernikov
057793e637 tcp: virtualise net.inet.tcp.msl sysctl.
VNET teardown waits 2*MSL (60 seconds by default) before expiring
 tcp PCBs. These PCBs holds references to nexthops, which, in turn,
 reference ifnets. This chain results in VNET interfaces being destroyed
 and moved to default VNET only after 60 seconds.
Allow tcp_msl to be set in jail by virtualising net.inet.tcp.msl sysctl,
 permitting more predictable VNET tests outcomes.

MFC after:	1 week
Reviewed by:	glebius
Differential Revision: https://reviews.freebsd.org/D33270

(cherry picked from commit c2c8e360d8)
2022-03-28 08:46:13 +00:00
Franco Fichtner
d3e338662f netinet: simplify RSS ifdef statements
Approved by:	transport (rrs)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D31583

(cherry picked from commit 47ded797ce)
2022-03-03 08:56:22 -07:00
Kristof Provost
4bca16a4fb netinet: allow UDP tunnels to be removed
udp_set_kernel_tunneling() rejects new callbacks if one is already set.
Allow callbacks to be cleared. The use case for this is OpenVPN DCO,
where the socket is opened by userspace and then adopted by the kernel
to run the tunnel. If the DCO interface is removed but userspace does
not close the socket (something the kernel cannot prevent) the installed
callbacks could be called with an invalidated context.

Allow new functions to be set, but only if they're NULL (i.e. allow the
callback functions to be cleared).

Reviewed by:	tuexen
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34288

(cherry picked from commit 995cba5a0c)
2022-02-28 16:38:05 +01:00
Robert Wing
95eea15111 tcp_twrespond: send signed segment when connection is TCP-MD5
When a connection is established to use TCP-MD5, tcp_twrespond() doesn't
respond with a signed segment. This results in the host performing the
active close to remain in a TIME_WAIT state and the other host in the
LAST_ACK state. Fix this by sending a signed segment when the connection
is established to use TCP-MD5.

Reviewed by:	glebius
Differential Revision:	https://reviews.freebsd.org/D33490

(cherry picked from commit 2a28b045ca)
2022-02-23 09:19:59 -09:00
Robert Wing
bcc9518b98 Fix dtrace SDT probe tcp:::debug-input
The tcp:::debug-input probe is passed an mbuf pointer, use the correct
translator for ipinfo_t when defining tcp:::debug-input.

Fixes:  82988b50a1 ("Add an mbuf to ipinfo_t translator to finish ...")
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D33066

(cherry picked from commit 08d157a832)
2022-02-23 08:47:40 -09:00
Michael Tuexen
985883fd13 sctp: remove KASSERT() which not always holds
Reported by:	syzbot+c907045aed2043011f3c@syzkaller.appspotmail.com

(cherry picked from commit bdb99f6f5e)
2022-02-23 01:19:41 +01:00
Michael Tuexen
af04a618ed sctp: make sure new locking requirements are satisfied.
Reported by:	syzbot+cd3c1dd64861b8c200bd@syzkaller.appspotmail.com

(cherry picked from commit e255f0c9fb)
2022-02-23 01:19:01 +01:00
Michael Tuexen
73fd476901 sctp: don't hold the assoc create lock longer than needed
Reported by:	syzbot+c738e3df67cf425c49a2@syzkaller.appspotmail.com

(cherry picked from commit 2f0656fb9b)
2022-02-23 01:18:05 +01:00
Michael Tuexen
f37224f026 sctp: cleanup sctp_lower_sosend
This is a preparation for retiring the tcp send lock in the
next step.

(cherry picked from commit a4a31271cc)
2022-02-23 01:17:25 +01:00
Michael Tuexen
153446e530 sctp: improve robustness
(cherry picked from commit fd0d53f85c)
2022-02-23 01:16:36 +01:00
Michael Tuexen
03e166d6ea sctp: cleanup, no functional change intended.
(cherry picked from commit 274a0e4a8d)
2022-02-23 01:15:43 +01:00
Michael Tuexen
5871b7c81a sctp: remove unused parameter
(cherry picked from commit 3ca204c97a)
2022-02-23 01:14:53 +01:00
Michael Tuexen
948608b013 sctp: fix a signed/unsigned mismatch.
(cherry picked from commit 11c4d4b966)
2022-02-23 01:14:07 +01:00
Michael Tuexen
b6e6748b2b sctp: avoid undefined behaviour and cleanup the code.
(cherry picked from commit 76e03cc940)
2022-02-23 01:13:10 +01:00
Michael Tuexen
b20c5963de sctp: improve counting of incoming chunks
(cherry picked from commit 502d5e8500)
2022-02-23 01:07:31 +01:00
Michael Tuexen
30cba4faf1 udp: use appropriate pcbinfo when signalling EHOSTDOWN
Sponsored by:	Netflix, Inc.

(cherry picked from commit 4760956e9a)
2022-02-23 01:00:38 +01:00
Michael Tuexen
f921b952dc sctp: retire sctp_mtu_size_reset()
Thanks to Timo Voelker for making me aware that sctp_mtu_size_reset()
is very similar to sctp_pathmtu_adjustment().

(cherry picked from commit 1adb91e521)
2022-02-23 00:58:56 +01:00
Michael Tuexen
81a1bfac59 sctp: improve sctp_pathmtu_adjustment()
Allow the resending of DATA chunks to be controlled by the caller,
which allows retiring sctp_mtu_size_reset() in a separate commit.
Also improve the computaion of the overhead and use 32-bit integers
consistently.
Thanks to Timo Voelker for pointing me to the code.

(cherry picked from commit 2de2ae331b)
2022-02-23 00:58:06 +01:00
Michael Tuexen
fe06ce5232 sctp: minor improvements in sctp_get_frag_point
(cherry picked from commit a7ba00a438)
2022-02-23 00:57:06 +01:00
Michael Tuexen
0f63c2d187 sctp: check that the computed frag point is a multiple of 4
Reported by:	syzbot+5da189fc1fe80b31f5bd@syzkaller.appspotmail.com

(cherry picked from commit ca0dd19f09)
2022-02-23 00:56:17 +01:00
Michael Tuexen
ff4150b9a5 sctp: cleanup the SCTP_MAXSEG socket option.
This patch makes the handling of the SCTP_MAXSEG socket option
compliant with RFC 6458 (SCTP socket API) and fixes an issue
found by syzkaller.

Reported by:	syzbot+a2791b89ab99121e3333@syzkaller.appspotmail.com

(cherry picked from commit 989453da05)
2022-02-23 00:55:23 +01:00
Michael Tuexen
a27063a574 sctp: cleanup, on functional change intended.
(cherry picked from commit 34ae6a1a44)
2022-02-23 00:54:24 +01:00
Michael Tuexen
4abd7785da sctp: apply limit for socket buffers as indicated in comment
(cherry picked from commit a859e9f9aa)
2022-02-23 00:53:31 +01:00
Michael Tuexen
f801f2c762 sctp: improve consistency, no functional change intended
(cherry picked from commit 3c1ba6f394)
2022-02-23 00:27:28 +01:00
Michael Tuexen
7c17c354ff sctp: add some asserts, no functional changes intended
This might help in narrowing down
https://syzkaller.appspot.com/bug?id=fbd79abaec55f5aede63937182f4247006ea883b

(cherry picked from commit 0906362646)
2022-02-23 00:26:35 +01:00
Michael Tuexen
0f448d4338 sctp: improve KASSERT messages
(cherry picked from commit bd19202c92)
2022-02-22 23:59:52 +01:00
Michael Tuexen
615ff3cb60 sctp: don't keep being locked on a stream which is removed
Reported by:	syzbot+f5f551e8a3a0302a4914@syzkaller.appspotmail.com

(cherry picked from commit 3ff3733991)
2022-02-22 23:59:05 +01:00
Michael Tuexen
932fc05901 sctp: provide a specific stream scheduler function for FCFS
A KASSERT in the genric routine does not apply and triggers
incorrectly.

Reported by:	syzbot+8435af157238c6a11430@syzkaller.appspotmail.com

(cherry picked from commit 28ea947078)
2022-02-22 23:58:10 +01:00
Michael Tuexen
ba0ac9095a sctp: cleanup and adding KASSERT()s, no functional change
(cherry picked from commit fa947a3687)
2022-02-22 23:57:22 +01:00
Michael Tuexen
d67ef74735 sctp: fix usage of stream scheduler functions
sctp_ss_scheduled() should only be called for streams that are
scheduled. So call sctp_ss_remove_from_stream() before it.
This bug was uncovered by the earlier cleanup.

Reported by:	syzbot+bbf739922346659df4b2@syzkaller.appspotmail.com
Reported by:	syzbot+0a0857458f4a7b0507c8@syzkaller.appspotmail.com
Reported by:	syzbot+a0b62c6107b34a04e54d@syzkaller.appspotmail.com
Reported by:	syzbot+0aa0d676429ebcd53299@syzkaller.appspotmail.com
Reported by:	syzbot+104cc0c1d3ccf2921c1d@syzkaller.appspotmail.com

(cherry picked from commit 5b53e749a9)
2022-02-22 23:56:26 +01:00
Michael Tuexen
d7351c4104 sctp: avoid locking an already locked mutex
Reported by:	syzbot+f048680690f2e8d7ddad@syzkaller.appspotmail.com
Reported by:	syzbot+0725c712ba89d123c2e9@syzkaller.appspotmail.com

(cherry picked from commit 171633765c)
2022-02-22 23:55:45 +01:00
Michael Tuexen
b529329487 sctp: Cleanup stream schedulers.
No functional change intended.

(cherry picked from commit 414499b3f9)
2022-02-22 23:54:42 +01:00
Michael Tuexen
c0f034484a sctp: Simplify stream scheduler usage
Callers are getting the stcb send lock, so just KASSERT that.
No need to signal this when calling stream scheduler functions.
No functional change intended.

(cherry picked from commit 762ae0ec8d)
2022-02-22 23:53:52 +01:00
Michael Tuexen
1df7036fdd sctp: improve consistency when calling stream scheduler
Hold always the stcb send lock when calling sctp_ss_init() and
sctp_ss_remove_from_stream().

(cherry picked from commit 0b79a76f84)
2022-02-22 23:53:07 +01:00
Michael Tuexen
eb426ae323 sctp: use a valid outstream when adding it to the scheduler
Without holding the stcb send lock, the outstreams might get
reallocated if the number of streams are increased.

Reported by:	syzbot+4a5431d7caa666f2c19c@syzkaller.appspotmail.com
Reported by:	syzbot+aa2e3b013a48870e193d@syzkaller.appspotmail.com
Reported by:	syzbot+e4368c3bde07cd2fb29f@syzkaller.appspotmail.com
Reported by:	syzbot+fe2f110e34811ea91690@syzkaller.appspotmail.com
Reported by:	syzbot+ed6e8de942351d0309f4@syzkaller.appspotmail.com

(cherry picked from commit 34b1efcea1)
2022-02-22 23:52:20 +01:00