Skip to content

Commit 500f372

Browse files
committed
Merge branch 'mptcp-fixes-for-ulp-a-deadlock-and-netlink-docs'
Mat Martineau says: ==================== mptcp: Fixes for ULP, a deadlock, and netlink docs Two of the MPTCP fixes in this set are related to the TCP_ULP socket option with MPTCP sockets operating in "fallback" mode (the connection has reverted to regular TCP). The other issues are an observed deadlock and missing parameter documentation in the MPTCP netlink API. Patch 1 marks TCP_ULP as unsupported earlier in MPTCP setsockopt code, so the fallback code path in the MPTCP layer does not pass the TCP_ULP option down to the subflow TCP socket. Patch 2 makes sure a TCP fallback socket returned to userspace by accept()ing on a MPTCP listening socket does not allow use of the "mptcp" TCP_ULP type. That ULP is intended only for use by in-kernel MPTCP subflows. Patch 3 fixes the possible deadlock when sending data and there are socket option changes to sync to the subflows. Patch 4 makes sure all MPTCP netlink event parameters are documented in the MPTCP uapi header. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 3dd7d40 + 6813b19 commit 500f372

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

include/uapi/linux/mptcp.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,21 @@ struct mptcp_info {
136136
* MPTCP_EVENT_REMOVED: token, rem_id
137137
* An address has been lost by the peer.
138138
*
139-
* MPTCP_EVENT_SUB_ESTABLISHED: token, family, saddr4 | saddr6,
140-
* daddr4 | daddr6, sport, dport, backup,
141-
* if_idx [, error]
139+
* MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id,
140+
* saddr4 | saddr6, daddr4 | daddr6, sport,
141+
* dport, backup, if_idx [, error]
142142
* A new subflow has been established. 'error' should not be set.
143143
*
144-
* MPTCP_EVENT_SUB_CLOSED: token, family, saddr4 | saddr6, daddr4 | daddr6,
145-
* sport, dport, backup, if_idx [, error]
144+
* MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6,
145+
* daddr4 | daddr6, sport, dport, backup, if_idx
146+
* [, error]
146147
* A subflow has been closed. An error (copy of sk_err) could be set if an
147148
* error has been detected for this subflow.
148149
*
149-
* MPTCP_EVENT_SUB_PRIORITY: token, family, saddr4 | saddr6, daddr4 | daddr6,
150-
* sport, dport, backup, if_idx [, error]
151-
* The priority of a subflow has changed. 'error' should not be set.
150+
* MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6,
151+
* daddr4 | daddr6, sport, dport, backup, if_idx
152+
* [, error]
153+
* The priority of a subflow has changed. 'error' should not be set.
152154
*/
153155
enum mptcp_event_type {
154156
MPTCP_EVENT_UNSPEC = 0,

net/mptcp/protocol.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
15241524
int ret = 0;
15251525

15261526
prev_ssk = ssk;
1527-
mptcp_flush_join_list(msk);
1527+
__mptcp_flush_join_list(msk);
15281528
ssk = mptcp_subflow_get_send(msk);
15291529

15301530
/* First check. If the ssk has changed since
@@ -2879,7 +2879,7 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
28792879
*/
28802880
if (WARN_ON_ONCE(!new_mptcp_sock)) {
28812881
tcp_sk(newsk)->is_mptcp = 0;
2882-
return newsk;
2882+
goto out;
28832883
}
28842884

28852885
/* acquire the 2nd reference for the owning socket */
@@ -2891,6 +2891,8 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
28912891
MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK);
28922892
}
28932893

2894+
out:
2895+
newsk->sk_kern_sock = kern;
28942896
return newsk;
28952897
}
28962898

net/mptcp/sockopt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ static bool mptcp_supported_sockopt(int level, int optname)
525525
case TCP_NODELAY:
526526
case TCP_THIN_LINEAR_TIMEOUTS:
527527
case TCP_CONGESTION:
528-
case TCP_ULP:
529528
case TCP_CORK:
530529
case TCP_KEEPIDLE:
531530
case TCP_KEEPINTVL:

0 commit comments

Comments
 (0)