| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At least one out-of-tree port (net-mgmt/ng_ipacct) depends on being able
to call in_pcblookup_local() with cred == NULL, so the MFC of commit
ac1750dd143e ("inpcb: Remove NULL checks of credential references")
broke compatibility.
Restore a subset of the NULL checks to avoid breaking the module in the
13.3 release. This is a direct commit to stable/13.
PR: 276868
Approved by: re (cperciva)
(cherry picked from commit fe8df7ed1aae444a09361c080d52bfcb6aaae64f)
|
| |
|
|
|
|
| |
- s/posession/possession/
(cherry picked from commit 9b035689f15fc4aec96f9c18c6c86bd615faed2f)
|
| |
|
|
|
|
| |
- s/tcp_ouput/tcp_output/
(cherry picked from commit ef0ac0a1ad6750291b881203030384b7f7241efb)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently SO_REUSEPORT_LB silently does nothing when set by a jailed
process. It is trivial to support this option in VNET jails, but it's
also useful in traditional jails.
This patch enables LB groups in jails with the following semantics:
- all PCBs in a group must belong to the same jail,
- PCB lookup prefers jailed groups to non-jailed groups
This is a straightforward extension of the semantics used for individual
listening sockets. One pre-existing quirk of the lbgroup implementation
is that non-jailed lbgroups are searched before jailed listening
sockets; that is preserved with this change.
Discussed with: glebius
MFC after: 1 month
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37029
(cherry picked from commit d93ec8cb1324d04d7cae19fb7fa98ade2ff33c80)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a memory allocation failure causes bind to fail, we should take the
inpcb back out of its LB group since it's not prepared to handle
connections.
Reviewed by: glebius
MFC after: 2 weeks
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37027
(cherry picked from commit a152dd863418638c3eb08b5c101b10b82f8072f5)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some auditing of the code shows that "cred" is never non-NULL in these
functions, either because all callers pass a non-NULL reference or
because they unconditionally dereference "cred". So, let's simplify the
code a bit and remove NULL checks. No functional change intended.
Reviewed by: glebius
MFC after: 1 week
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37025
(cherry picked from commit ac1750dd143e53225c518bc1ca0462c3fffe10f6)
|
| |
|
|
|
|
|
|
| |
Reviewed by: bz, emaste
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43338
(cherry picked from commit 8cb9b68f5821e45c63ee08d8ee3029ca523ac174)
|
| |
|
|
|
|
|
|
|
|
|
| |
Add a space around the | operator in places testing for either M_EXT
or M_EXTPG.
Reviewed by: imp, glebius
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43216
(cherry picked from commit f7d5900aa063c6e9d19e6372ba981fc76aa326a2)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only try sending more data on pure ACKs when there is
more data available in the send buffer.
In the case of a retransmitted SYN not being sent due to
an internal error, the snd_una/snd_nxt accounting could
be off, leading to a panic. Pulling snd_nxt up to snd_una
prevents this from happening.
Reported by: fengdreamer@126.com
Reviewed by: cc, tuexen, #transport
MFC after: 1 week
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43343
(cherry picked from commit f4574e2dc5a4719379496338257526aba484751b)
|
| |
|
|
|
|
| |
No functional change intended.
(cherry picked from commit 3bbbfc8dcd3622b49907e359c8e9682def0bae25)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch allows the IPPROTO_UDPLITE-level socket options
UDPLITE_SEND_CSCOV and UDPLITE_RECV_CSCOV to be used on
AF_INET6 sockets in addition to AF_INET sockets.
Reviewed by: ae, rscheff
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42430
(cherry picked from commit 03c3a70abe5e9fa259b954de78ae69229fa9c99f)
|
| |
|
|
|
|
|
|
|
|
| |
Don't fill the fields of the UDP/IP header not used for the
checksum computation before performing the checksum computation.
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D42275
(cherry picked from commit aa64a8f5c35c13b1c325f1a4597c987a37bec5da)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Define a mask for the code point used for ECN in the Traffic Class field
(2 bits) of an IPv6 header.
BE: 0 0 3 0 0 0 0 0
Bit: 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
For BE (Big Endian), or network-byte order, this corresponds to 0x00300000.
For Little Endian, it corresponds to 0x00003000.
Reviewed by: imp, markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/879
(cherry picked from commit b0e13f785b336670bdf39b83a78435b00d00f43c)
|
| |
|
|
|
|
|
|
| |
Deal with the case that the association is already gone.
Reported by: syzbot+e256d42e9b390564530a@syzkaller.appspotmail.com
(cherry picked from commit bb56b36d7188e004840294d0bd5dfdf7f3392a05)
|
| |
|
|
|
|
|
|
|
|
| |
When shutdown(..., SHUT_RD) or shutdown(..., SHUT_RDWR) is called,
really clean up the read queue and issue an ungraceful shutdown if
user messages are affected.
Reported by: syzbot+d4e1d30d578891245f59@syzkaller.appspotmail.com
(cherry picked from commit 81c5f0fac91dfae64205a6c4f9b2a469d1187372)
|
| |
|
|
|
|
| |
This does not work with the new locking scheme.
(cherry picked from commit 1e81a4e7e89bb1870bec84e42284ad10505e957c)
|
| |
|
|
|
|
|
|
|
|
| |
All notifications are now queued via sctp_ulp_notify(). Do
the locking of the inp read lock there and validate this in all
functions being used.
This is one step in avoiding race conditions when closing the
read end of an SCTP socket.
(cherry picked from commit f9425b3a85e9e211b61e11ce8115bf73674bdf49)
|
| |
|
|
|
|
|
| |
While there, improve consistency of the notification related code.
No functional change intended.
(cherry picked from commit 3ac7664774ad038b208cbb31eb52d1608efbd451)
|
| |
|
|
|
|
|
|
|
| |
This makes consistent use of the parameters and ensures that
all SCTP AUTH related notifications are using sctp_ulp_notify().
No functional change intended.
(cherry picked from commit cd3770c5feb038f3904fdb4aa04e09da122f74e3)
|
| |
|
|
|
|
|
| |
In particular, don't use a socket level flag, use the inp level one.
After adding appropriate locking, this will close a race condition.
(cherry picked from commit e40d16ad6ee952f315356ef091fa282f28fac0d5)
|
| |
|
|
|
|
|
| |
No functional change intended. Just asserting the conditions when
being called.
(cherry picked from commit f0c8e8118dbcc9251b11154ee7e4680f79901af1)
|
| |
|
|
|
|
|
|
|
|
|
| |
If a socket is marked as cannot read anymore, drop chunks which
should be added to a control element in the receive queue.
This is consistent with dropping control elements instead of
adding them in the same situation.
Reported by: syzbot+291f6581cecb77097b16@syzkaller.appspotmail.com
(cherry picked from commit 847fa61fad5ef118dc0591d876bf9449200aa818)
|
| |
|
|
|
|
|
|
|
| |
When handling a SHUTDOWN or SHUTDOWN ACK chunk detect if the peer
is violating the protocol by not having made sure all user messages
are reveived by the peer. If this situation is detected, abort the
association.
(cherry picked from commit d18c845f99cbd2d3c0e70b3b9b09d80c655b6fb6)
|
| |
|
|
|
|
|
|
| |
Fix an unused-but-set-variable warning for builds without INVARIANTS.
Reported by: O. Hartmann
(cherry picked from commit 1095da75032b439d893c0947eda2f3738ecfe494)
|
| |
|
|
|
|
|
|
|
|
|
| |
Don't handle a graceful shutdown of the peer as an implicit signal
that all partial messages are complete. First, this is not implemented
correctly and second this should not be done by the peer. It is more
appropriate to handle this as a protocol violation.
Remove the incorrect code and leave detecting the protocol violation
and its handling in a followup commit.
(cherry picked from commit 4f14d4b6b7f0ca49b14379e48117121af3ed2669)
|
| |
|
|
| |
(cherry picked from commit c3179e6660e1365111b89cb6c05c3a4c47375e73)
|
| |
|
|
|
|
|
| |
Do not put a variable in the stcb for passing it to a function.
Just use a parameter of the function. No functional change intended.
(cherry picked from commit 749a7fb588c4a872a4f1ce3ee92be86bab1b1f17)
|
| |
|
|
|
|
| |
This enforces a condition mentioned in a comment.
(cherry picked from commit e8eb0b713426fe9edbf56719351850fa9469286a)
|
| |
|
|
|
|
|
| |
While there, add also a macro for an assert. Will be used shortly.
No functional change intended.
(cherry picked from commit 6cb8b3b5cde18ac5465f1cf1df3fbac359cb09e9)
|
| |
|
|
|
|
| |
No functional change intended.
(cherry picked from commit 85e5480df95e6bca38910f44f6e9b4d7773904ed)
|
| |
|
|
|
|
| |
No functional change intended.
(cherry picked from commit 9ade2745db8be213e9da2225795cafb8e7575e29)
|
| |
|
|
| |
(cherry picked from commit 10b2b30670d7c389b26533aa43e8d0c3aef55ff3)
|
| |
|
|
|
|
| |
This is already checked by the caller.
(cherry picked from commit e3771cc03419b69c8ee851c1ffa85230d0fde1d5)
|
| |
|
|
|
|
|
|
|
|
|
| |
Don't clear the counters for the socket snd buffer when
shutdown(..., SHUT_WR) or shutdown(..., SHUT_RDWR) is called.
This was causing the system to panic() when SCTP pf tests were
running.
Reported by: dchagin, kp
(cherry picked from commit efb04fb404b240a99c618e49174cd6260217edaa)
|
| |
|
|
|
|
| |
PR: 260116
(cherry picked from commit c620788150d274c09a070ab486602c98407d73b0)
|
| |
|
|
|
|
|
|
| |
This is simplifying a patch to address PR 260116.
PR: 260116
(cherry picked from commit b279e84a47ddb59e55b5a3cec31c51cd41bf0dc3)
|
| |
|
|
|
|
|
|
|
|
|
| |
This fixes a bug which was introduced in the commit
https://svnweb.freebsd.org/changeset/base/282276
Reviewed by: cc, rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D40806
(cherry picked from commit dc2d26df43cb69c9c4d8802220af2da929bc1dce)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
PRR state was not properly reset on subsequent ECN CE
events. Clean up after local transmission failures too.
Reviewed by: tuexen, cc, #transport
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43170
(cherry picked from commit 429f14f83ae1f6357a9455d4f075522420b01b03)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
If an error occurs while processing a TCP segment with some data and the FIN
flag, the back out of the sequence number advance does not take into account the
increase by 1 due to the FIN flag.
Reviewed By: jch, gnn, #transport, tuexen
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D2970
(cherry picked from commit 66605ff791b12a2c3bb4570379db0e14d29fca4c)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In in_pcb_lport_dest(), if an IPv6 socket does not match any other IPv6
socket using in6_pcblookup_local(), and if the socket can also connect
to IPv4 (the INP_IPV4 vflag is set), check for IPv4 matches as well.
Otherwise, we can allocate a port that is used by an IPv4 socket
(possibly one created from IPv6 via the same procedure), and then
connect() can fail with EADDRINUSE, when it could have succeeded if
the bound port was not in use.
PR: 265064
Submitted by: firk at cantconnect.ru (with modifications)
Reviewed by: bz, melifaro
Differential Revision: https://reviews.freebsd.org/D36012
(cherry picked from commit 637f317c6d9c0c689677f499fc78ac545b192071)
|
| |
|
|
|
|
| |
- s/recieved/received/
(cherry picked from commit 7b0b448ba9fd53fb4db81a2309dedfdc47533cfb)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds struct tcp_info fields corresponding to the following
struct tcpcb ones:
- snd_una
- snd_max
- rcv_numsacks
- rcv_adv
- dupacks
Note that while both tcp_fill_info() and fill_tcp_info_from_tcb() are
extended accordingly, no counterpart of rcv_numsacks is available in
the cxgbe(4) TOE PCB, though.
Sponsored by: NetApp, Inc. (originally)
(cherry picked from commit dc485b968ddeb070d23354f55164a8c336acf081)
Conflicts (due tue missing 945f9a7c):
sys/netinet/tcp.h
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Marking all new fields unused (__xxx).
No functional change.
Reviewed By: tuexen, rrs, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D37016
(cherry picked from commit 3708c3d370f26af0841cd3e97bf569d39c42953b)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function actually only ever reads from the TCP PCB. Consequently,
also make the pointer to its TCP PCB parameter const.
Sponsored by: NetApp, Inc. (originally)
(cherry picked from commit 8c6104c48ea3f0ffaabeb9784b0f2327db04e7af)
Conflicts (due tue missing 9eb0e832):
sys/dev/cxgbe/tom/t4_tom.c
sys/netinet/tcp_offload.c
sys/netinet/tcp_usrreq.c
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tcp_tun_port field that is used to pass port value between UDP
and TCP in case of tunneling is a generic field that used to pass
data between network layers. It can be contaminated on entry, e.g.
by a VLAN tag set by a NIC driver. Explicily set it, so that it
is zeroed out in a normal not-tunneled TCP. If it contains garbage,
tcp_twcheck() later can enter wrong block of code and treat the packet
as incorrectly tunneled one. On main and stable/14 that will end up
with sending incorrect responses, but on stable/13 with ipfw(8) and
pcb-matching rules it may end up in a panic.
This is a minimal conservative patch to be merged to stable branches.
Later we may redesign this.
PR: 275169
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D43065
(cherry picked from commit 513f2e2e7180202167ca2963d815d2a4c3ac0af9)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As implemented, this security policy would only prevent seeing processes
in sub-jails, but would not prevent sending signals to, changing
priority of or debugging processes in these, enabling attacks where
unprivileged users could tamper with random processes in sub-jails in
particular circumstances (conflated UIDs) despite the policy being
enforced.
PR: 272092
Reviewed by: mhorne
Sponsored by: Kumacom SAS
Differential Revision: https://reviews.freebsd.org/D40628
(cherry picked from commit 5817169bc4a06a35aa5ef7f5ed18f6cb35037e18)
Approved by: markj (mentor)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.
1. net.inet.sctp.tcbhashsize
2. net.inet.sctp.pcbhashsize
3. net.inet.sctp.chunkscale
The loader tunable 'net.inet.sctp.tcbhashsize' and 'net.inet.sctp.chunkscale'
are only used during vnet initializing, thus it make no senses to make them
writable tunable.
Validate the values of loader tunables on vnet initialize, reset them to
theirs defaults if invalid to prevent potential kernel panics.
Reviewed by: tuexen, #transport, #network
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42007
(cherry picked from commit dac91eb7660324677d8a2f71bd6f192422355ba1)
(cherry picked from commit fd9de12a71109d1e3bb4b20e7d040fc9a1784dc2)
|
| |
|
|
|
|
|
|
|
|
|
| |
No functional change intended.
Reviewed by: cc, rscheff, #transport
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41998
(cherry picked from commit 38ecc80b2a4e5e11ece83ca4df63632f0b6fa394)
(cherry picked from commit 3a97686fc11ae51ceb4004c07702a8a20f71410d)
|
| |
|
|
|
|
|
|
|
|
|
| |
We may fail to match if the specific interface doesn't exist or was
renamed.
PR: 273715
Reported by: grembo
MFC after: 1 week
(cherry picked from commit d94d07d58141dcff48f01c6b3e5a31de9d7a7938)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The loader tunable `net.inet.ip.mfchashsize` does not have corresponding
sysctl MIB entry. Just add it.
While here, the sysctl variable `net.inet.pim.squelch_wholepkt` is actually
a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T`
will report it correctly.
Reviewed by: kp
Fixes: 443fc3176dee Introduce a number of changes to the MROUTING code
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41997
(cherry picked from commit f549e22901b3a391c76659bee55802b1214112fd)
(cherry picked from commit b0f026435a150933ecb6f2d1359fd1b4898657f1)
|