| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve compliance with RFC 4895 and RFC 6458.
Silently dicard SCTP chunks which have been requested to be
authenticated but are received unauthenticated no matter if support
for SCTP authentication has been negotiated. This improves compliance
with RFC 4895.
When the application uses the SCTP_AUTH_CHUNK socket option to
request a chunk to be received in an authenticated way, enable
the SCTP authentication extension for the end-point. This improves
compliance with RFC 6458.
Discussed with: Peter Lei
Approved by: re (marius@)
Notes:
svn path=/releng/11.2/; revision=334802
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't overflow a buffer if we receive an INIT or INIT-ACK chunk
without a RANDOM parameter but with a CHUNKS or HMAC-ALGO parameter.
Please note that sending this combination violates the specification.
Thanks to Ronald E. Crane for reporting the issue for the userland
stack.
Approved by: re (gjb@)
Notes:
svn path=/releng/11.2/; revision=334743
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Limit the retransmission timer for SYN-ACKs by TCPTV_REXMTMAX.
Use the same logic to handle the SYN-ACK retransmission when sent from
the syn cache code as when sent from the main code.
Approved by: re (gjb@)
Sponsored by: Netflix, Inc.
Notes:
svn path=/releng/11.2/; revision=334740
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure net.inet.tcp.syncache.rexmtlimit is limited by TCP_MAXRXTSHIFT.
If the sysctl variable is set to a value larger than TCP_MAXRXTSHIFT+1,
the array tcp_syn_backoff[] is accessed out of bounds.
Discussed with: jtl@
Approved by: re (gjb)
Sponsored by: Netflix, Inc.
Notes:
svn path=/releng/11.2/; revision=334737
|
| |
|
|
|
|
|
|
|
|
| |
Ensure we are not dereferencing a NULL pointer.
CID: 1385266
Approved by: re (marius@)
Notes:
svn path=/releng/11.2/; revision=334734
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When reporting ERROR or ABORT chunks, don't use more data
that is guaranteed to be contigous.
Thanks to Felix Weinrank for finding and reporting this bug
by fuzzing the usrsctp stack.
MFC r333386:
Fix two typos reported by N. J. Mann, which were introduced in
https://svnweb.freebsd.org/changeset/base/333382 by me.
Approved by: re@ (marius)
Notes:
svn path=/stable/11/; revision=334441
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Immediately propagate EACCES error code to application from tcp_output.
In r309610 and r315514 the behavior of handling EACCES was changed, and
tcp_output() now returns zero when EACCES happens. The reason of this
change was a hesitation that applications that use TCP-MD5 will be
affected by changes in project/ipsec.
TCP-MD5 code returns EACCES when security assocition for given connection
is not configured. But the same error code can return pfil(9), and this
change has affected connections blocked by pfil(9). E.g. application
doesn't return immediately when SYN segment is blocked, instead it waits
when several tries will be failed.
Actually, for TCP-MD5 application it doesn't matter will it get EACCES
after first SYN, or after several tries. Security associtions must be
configured before initiating TCP connection.
I left the EACCES in the switch() to show that it has special handling.
Reported by: Andreas Longwitz <longwitz at incore dot de>
Approved by: re (marius)
Notes:
svn path=/stable/11/; revision=333627
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Fix RSS build (broken in r331309).
Sponsored by: Chelsio Communications
PR: 227691
Pointy-hat to: jtl
Notes:
svn path=/stable/11/; revision=332889
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enforce the limit on ICMP messages before doing work to formulate the
response.
Delete an unneeded rate limit for UDP under IPv6. Because ICMP6
messages have their own rate limit, it is unnecessary to apply a
second rate limit to UDP messages.
Sponsored by: Netflix, Inc.
Notes:
svn path=/stable/11/; revision=332840
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, when tcp_input() receives a packet on a session that matches a
TCPCB, it checks (so->so_options & SO_ACCEPTCONN) to determine whether or
not the socket is a listening socket. However, this causes the code to
access a different cacheline. If we first check if the socket is in the
LISTEN state, we can avoid accessing so->so_options when processing packets
received for ESTABLISHED sessions.
If INVARIANTS is defined, the code still needs to access both variables to
check that so->so_options is consistent with the state.
Sponsored by: Netflix, Inc.
Notes:
svn path=/stable/11/; revision=332829
|
| |
|
|
|
|
|
|
| |
If the new window size is less than the old window size, skip the
calculations to check if we should advertise a larger window.
Notes:
svn path=/stable/11/; revision=332828
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the INP lock is uncontested, avoid taking a reference and jumping
through the lock-switching hoops.
A few of the INP lookup operations that lock INPs after the lookup do
so using this mechanism (to maintain lock ordering):
1. Lock lookup structure.
2. Find INP.
3. Acquire reference on INP.
4. Drop lock on lookup structure.
5. Acquire INP lock.
6. Drop reference on INP.
This change provides a slightly shorter path for cases where the INP
lock is uncontested:
1. Lock lookup structure.
2. Find INP.
3. Try to acquire the INP lock.
4. If successful, drop lock on lookup structure.
Of course, if the INP lock is contested, the functions will need to
revert to the previous way of switching locks safely.
This saves a few atomic operations when the INP lock is uncontested.
Sponsored by: Netflix, Inc.
Notes:
svn path=/stable/11/; revision=332821
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
r330675 introduced an extra window check in the LRO code to ensure it
captured and reported the highest window advertisement with the same
SEQ/ACK. However, the window comparison uses modulo 2**16 math, rather
than directly comparing the absolute values. Because windows use
absolute values and not modulo 2**16 math (i.e. they don't wrap), we
need to compare the absolute values.
Sponsored by: Netflix, Inc.
Notes:
svn path=/stable/11/; revision=332818
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a user closes the socket before we call tcp_usr_abort(), then
tcp_drop() may unlock the INP. Currently, tcp_usr_abort() does not
check for this case, which results in a panic while trying to unlock
the already-unlocked INP (not to mention, a use-after-free violation).
Make tcp_usr_abort() check the return value of tcp_drop(). In the case
where tcp_drop() returns NULL, tcp_usr_abort() can skip further steps
to abort the connection and simply unlock the INP_INFO lock prior to
returning.
Sponsored by: Netflix, Inc.
Notes:
svn path=/stable/11/; revision=332817
|
| |
|
|
|
|
|
|
| |
Fix a logical inversion bug.
Thanks to Irene Ruengeler for finding and reporting this bug.
Notes:
svn path=/stable/11/; revision=332636
|
| |
|
|
|
|
|
| |
Small cleanup, no functional change.
Notes:
svn path=/stable/11/; revision=332635
|
| |
|
|
|
|
|
|
|
| |
Fix a signed/unsigned warning showing up for the userland stack
on some platforms.
Thanks to Felix Weinrank for reporting the issue.
Notes:
svn path=/stable/11/; revision=332634
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
netpfil: Introduce PFIL_FWD flag
Forwarded packets passed through PFIL_OUT, which made it difficult for
firewalls to figure out if they were forwarding or producing packets. This in
turn is an issue for pf for IPv6 fragment handling: it needs to call
ip6_output() or ip6_forward() to handle the fragments. Figuring out which was
difficult (and until now, incorrect).
Having pfil distinguish the two removes an ugly piece of code from pf.
Introduce a new variant of the netpfil callbacks with a flags variable, which
has PFIL_FWD set for forwarded packets. This allows pf to reliably work out if
a packet is forwarded.
Notes:
svn path=/stable/11/; revision=332513
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rework ipfw dynamic states implementation to be lockless on fast path.
o added struct ipfw_dyn_info that keeps all needed for ipfw_chk and
for dynamic states implementation information;
o added DYN_LOOKUP_NEEDED() macro that can be used to determine the
need of new lookup of dynamic states;
o ipfw_dyn_rule now becomes obsolete. Currently it used to pass
information from kernel to userland only.
o IPv4 and IPv6 states now described by different structures
dyn_ipv4_state and dyn_ipv6_state;
o IPv6 scope zones support is added;
o ipfw(4) now depends from Concurrency Kit;
o states are linked with "entry" field using CK_SLIST. This allows
lockless lookup and protected by mutex modifications.
o the "expired" SLIST field is used for states expiring.
o struct dyn_data is used to keep generic information for both IPv4
and IPv6;
o struct dyn_parent is used to keep O_LIMIT_PARENT information;
o IPv4 and IPv6 states are stored in different hash tables;
o O_LIMIT_PARENT states now are kept separately from O_LIMIT and
O_KEEP_STATE states;
o per-cpu dyn_hp pointers are used to implement hazard pointers and they
prevent freeing states that are locklessly used by lookup threads;
o mutexes to protect modification of lists in hash tables now kept in
separate arrays. 65535 limit to maximum number of hash buckets now
removed.
o Separate lookup and install functions added for IPv4 and IPv6 states
and for parent states.
o By default now is used Jenkinks hash function.
Obtained from: Yandex LLC
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D12685
Notes:
svn path=/stable/11/; revision=332401
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use an accessor function to access ifr_data.
This fixes 32-bit compat (no ioctl command defintions are required
as struct ifreq is the same size).
Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14900
Notes:
svn path=/stable/11/; revision=332288
|
| |
|
|
|
|
|
|
|
|
|
| |
Allow the first (and second) argument of sn_calloc() be a sum.
This fixes a bug reported in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224103
PR: 224103
Notes:
svn path=/stable/11/; revision=332276
|
| |
|
|
|
|
|
| |
Whitespace changes.
Notes:
svn path=/stable/11/; revision=332257
|
| |
|
|
|
|
|
| |
Clarify that there is no break missing. While there, cleanup whitespaces.
Notes:
svn path=/stable/11/; revision=332256
|
| |
|
|
|
|
|
| |
CID: 1008198
Notes:
svn path=/stable/11/; revision=332255
|
| |
|
|
|
|
|
|
|
| |
Fix an assignment. While there, do some whitespace cleanups.
CID: 1008936
Notes:
svn path=/stable/11/; revision=332254
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Set the inp_vflag consistently for accepted TCP/IPv6 connections when
net.inet6.ip6.v6only=0.
Without this patch, the inp_vflag would have INP_IPV4 and the
INP_IPV6 flags for accepted TCP/IPv6 connections if the sysctl
variable net.inet6.ip6.v6only is 0. This resulted in netstat
to report the source and destination addresses as IPv4 addresses,
even they are IPv6 addresses.
PR: 226421
Reviewed by: bz, hiren, kib
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D13514
Notes:
svn path=/stable/11/; revision=332238
|
| |
|
|
|
|
|
|
| |
Add constant for the PAD chunk as defined in RFC 4820.
This will be used by traceroute and traceroute6 soon.
Notes:
svn path=/stable/11/; revision=332236
|
| |
|
|
|
|
|
|
| |
Update references in comments, since the IDs have become an RFC long
time ago. Also cleanup whitespaces. No functional change.
Notes:
svn path=/stable/11/; revision=332235
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a bug related to fast retransmissions.
When processing a SACK advancing the cumtsn-ack in fast recovery,
increment the miss-indications for all TSN's reported as missing.
Thanks to Fabian Ising for finding the bug and to Timo Voelker
for provinding a fix.
This fix moves also CMT related initialisation of some variables
to a more appropriate place.
Notes:
svn path=/stable/11/; revision=332234
|
| |
|
|
|
|
|
|
| |
Don't provide a (meaningless) cmsg when proving a notification
in a recvmsg() call.
Notes:
svn path=/stable/11/; revision=332232
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add to ipfw support for sending an SCTP packet containing an ABORT chunk.
This is similar to the TCP case. where a TCP RST segment can be sent.
There is one limitation: When sending an ABORT in response to an incoming
packet, it should be tested if there is no ABORT chunk in the received
packet. Currently, it is only checked if the first chunk is an ABORT
chunk to avoid parsing the whole packet, which could result in a DOS attack.
Thanks to Timo Voelker for helping me to test this patch.
MFC r327200:
When adding support for sending SCTP packets containing an ABORT chunk
to ipfw in https://svnweb.freebsd.org/changeset/base/326233,
a dependency on the SCTP stack was added to ipfw by accident.
This was noted by Kevel Bowling in https://reviews.freebsd.org/D13594
where also a solution was suggested. This patch is based on Kevin's
suggestion, but implements the required SCTP checksum computation
without any dependency on other SCTP sources.
While there, do some cleanups and improve comments.
Thanks to Kevin Kevin Bowling for reporting the issue and suggesting
a fix.
Notes:
svn path=/stable/11/; revision=332229
|
| |
|
|
|
|
|
| |
Cleaup, no functional change.
Notes:
svn path=/stable/11/; revision=332228
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Retire SCTP_WITH_NO_CSUM option.
This option was used in the early days to allow performance measurements
extrapolating the use of SCTP checksum offloading. Since this feature
is now available, get rid of this option.
This also un-breaks the LINT kernel. Thanks to markj@ for making me
aware of the problem.
Notes:
svn path=/stable/11/; revision=332227
|
| |
|
|
|
|
|
|
|
|
| |
Fix the handling of ERROR chunks which a lot of error causes.
While there, clean up the code.
Thanks to Felix Weinrank who found the bug by using fuzz-testing
the SCTP userland stack.
Notes:
svn path=/stable/11/; revision=332226
|
| |
|
|
|
|
|
| |
Simply the code and use the full buffer for contigous chunk representation.
Notes:
svn path=/stable/11/; revision=332225
|
| |
|
|
|
|
|
|
|
| |
Cleanup the handling of control chunks. While there fix some minor
bug related to clearing the assoc retransmit counter and the dup TSN
handling of NR-SACK chunks.
Notes:
svn path=/stable/11/; revision=332224
|
| |
|
|
|
|
|
|
|
|
| |
Fix an accounting bug where data was counted twice if on the read
queue and on the ordered or unordered queue.
While there, improve the checking in INVARIANTs when computing the
a_rwnd.
Notes:
svn path=/stable/11/; revision=332223
|
| |
|
|
|
|
|
|
| |
Allow the setting of the MTU for future paths using an SCTP socket option.
This functionality was missing.
Notes:
svn path=/stable/11/; revision=332222
|
| |
|
|
|
|
|
| |
Fix the reporting of the MTU for SCTP sockets when using IPv6.
Notes:
svn path=/stable/11/; revision=332221
|
| |
|
|
|
|
|
|
|
|
|
| |
Fix parsing error when processing cmsg in SCTP send calls. The bug is
related to a signed/unsigned mismatch.
This should most likely fix the issue in sctp_sosend reported by
Dmitry Vyukov on the freebsd-hackers mailing list and found by
running syzkaller.
Notes:
svn path=/stable/11/; revision=332220
|
| |
|
|
|
|
|
|
| |
Fix a bug reported by Felix Weinrank using the libfuzzer on the
userland stack.
Notes:
svn path=/stable/11/; revision=332218
|
| |
|
|
|
|
|
|
|
| |
Fix a bug in handling special ABORT chunks.
Thanks to Felix Weinrank for finding this issue using libfuzzer with
the userland stack.
Notes:
svn path=/stable/11/; revision=332217
|
| |
|
|
|
|
|
|
| |
Fix a locking issue found by running AFL on the userland stack.
Thanks to Felix Weinrank for reporting the issue.
Notes:
svn path=/stable/11/; revision=332216
|
| |
|
|
|
|
|
| |
Fix a signed/unsigned warning.
Notes:
svn path=/stable/11/; revision=332215
|
| |
|
|
|
|
|
|
|
|
| |
Abort an SCTP association, when a DATA chunk is followed by an unknown
chunk with a length smaller than the minimum length.
Thanks to Felix Weinrank for making me aware of the problem.
Notes:
svn path=/stable/11/; revision=332214
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the handling of parital and too short chunks.
Ensure that the current behaviour is consistent: stop processing
of the chunk, but finish the processing of the previous chunks.
This behaviour might be changed in a later commit to ABORT the
assoication due to a protocol violation, but changing this
is a separate issue.
MFC r324725
Fix a bug introduced in r324638.
Thanks to Felix Weinrank for making me aware of this.
MFC r324726:
Revert change which got in accidently.
Notes:
svn path=/stable/11/; revision=332213
|
| |
|
|
|
|
|
|
|
|
| |
Code cleanup, not functional change.
This avoids taking a pointer of a packed structure which allows simpler
compilation of the userland stack.
Notes:
svn path=/stable/11/; revision=332212
|
| |
|
|
|
|
|
|
| |
Ensure that the accept ABORT chunks with the T-bit set only the
a non-zero matching peer tag is provided.
Notes:
svn path=/stable/11/; revision=332211
|
| |
|
|
|
|
|
| |
Remove unused function.
Notes:
svn path=/stable/11/; revision=332204
|
| |
|
|
|
|
|
|
| |
Add missing locking. Found by Coverity while scanning the usrsctp
library.
Notes:
svn path=/stable/11/; revision=332203
|