Commit 500f3720 authored by Jakub Kicinski's avatar Jakub Kicinski

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/20211214231604.211016-1-mathew.j.martineau@linux.intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 3dd7d40b 6813b192
...@@ -136,19 +136,21 @@ struct mptcp_info { ...@@ -136,19 +136,21 @@ struct mptcp_info {
* MPTCP_EVENT_REMOVED: token, rem_id * MPTCP_EVENT_REMOVED: token, rem_id
* An address has been lost by the peer. * An address has been lost by the peer.
* *
* MPTCP_EVENT_SUB_ESTABLISHED: token, family, saddr4 | saddr6, * MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id,
* daddr4 | daddr6, sport, dport, backup, * saddr4 | saddr6, daddr4 | daddr6, sport,
* if_idx [, error] * dport, backup, if_idx [, error]
* A new subflow has been established. 'error' should not be set. * A new subflow has been established. 'error' should not be set.
* *
* MPTCP_EVENT_SUB_CLOSED: token, family, saddr4 | saddr6, daddr4 | daddr6, * MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6,
* sport, dport, backup, if_idx [, error] * daddr4 | daddr6, sport, dport, backup, if_idx
* [, error]
* A subflow has been closed. An error (copy of sk_err) could be set if an * A subflow has been closed. An error (copy of sk_err) could be set if an
* error has been detected for this subflow. * error has been detected for this subflow.
* *
* MPTCP_EVENT_SUB_PRIORITY: token, family, saddr4 | saddr6, daddr4 | daddr6, * MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6,
* sport, dport, backup, if_idx [, error] * daddr4 | daddr6, sport, dport, backup, if_idx
* The priority of a subflow has changed. 'error' should not be set. * [, error]
* The priority of a subflow has changed. 'error' should not be set.
*/ */
enum mptcp_event_type { enum mptcp_event_type {
MPTCP_EVENT_UNSPEC = 0, MPTCP_EVENT_UNSPEC = 0,
......
...@@ -1524,7 +1524,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags) ...@@ -1524,7 +1524,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
int ret = 0; int ret = 0;
prev_ssk = ssk; prev_ssk = ssk;
mptcp_flush_join_list(msk); __mptcp_flush_join_list(msk);
ssk = mptcp_subflow_get_send(msk); ssk = mptcp_subflow_get_send(msk);
/* First check. If the ssk has changed since /* First check. If the ssk has changed since
...@@ -2879,7 +2879,7 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err, ...@@ -2879,7 +2879,7 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
*/ */
if (WARN_ON_ONCE(!new_mptcp_sock)) { if (WARN_ON_ONCE(!new_mptcp_sock)) {
tcp_sk(newsk)->is_mptcp = 0; tcp_sk(newsk)->is_mptcp = 0;
return newsk; goto out;
} }
/* acquire the 2nd reference for the owning socket */ /* acquire the 2nd reference for the owning socket */
...@@ -2891,6 +2891,8 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err, ...@@ -2891,6 +2891,8 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK); MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK);
} }
out:
newsk->sk_kern_sock = kern;
return newsk; return newsk;
} }
......
...@@ -525,7 +525,6 @@ static bool mptcp_supported_sockopt(int level, int optname) ...@@ -525,7 +525,6 @@ static bool mptcp_supported_sockopt(int level, int optname)
case TCP_NODELAY: case TCP_NODELAY:
case TCP_THIN_LINEAR_TIMEOUTS: case TCP_THIN_LINEAR_TIMEOUTS:
case TCP_CONGESTION: case TCP_CONGESTION:
case TCP_ULP:
case TCP_CORK: case TCP_CORK:
case TCP_KEEPIDLE: case TCP_KEEPIDLE:
case TCP_KEEPINTVL: case TCP_KEEPINTVL:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment