From: Peter Krystad <peter.krystad at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] [PATCH v3 02/10] Fix locking in mptcp_finish_join.
Date: Wed, 07 Aug 2019 15:44:26 -0700 [thread overview]
Message-ID: <20190807224434.2829-3-peter.krystad@linux.intel.com> (raw)
In-Reply-To: 20190807224434.2829-1-peter.krystad@linux.intel.com
[-- Attachment #1: Type: text/plain, Size: 2219 bytes --]
Lock was being taken on the subflow sock, not mptcp_sock.
squashto: Add handling of incoming MP_JOIN requests
Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
---
net/mptcp/protocol.c | 9 +++++----
net/mptcp/protocol.h | 2 +-
net/mptcp/subflow.c | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 5501c405c6e0..8a841d489b52 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -816,18 +816,19 @@ void mptcp_finish_connect(struct sock *sk, int mp_capable)
inet_sk_state_store(sk, TCP_ESTABLISHED);
}
-void mptcp_finish_join(struct sock *conn, struct sock *sk)
+void mptcp_finish_join(struct sock *sk)
{
struct subflow_context *subflow = subflow_ctx(sk);
- struct mptcp_sock *msk = mptcp_sk(conn);
+ struct mptcp_sock *msk = mptcp_sk(subflow->conn);
pr_debug("msk=%p, subflow=%p", msk, subflow);
local_bh_disable();
- bh_lock_sock_nested(sk);
+ bh_lock_sock_nested(subflow->conn);
list_add_tail(&subflow->node, &msk->conn_list);
- bh_unlock_sock(sk);
+ bh_unlock_sock(subflow->conn);
local_bh_enable();
+ inet_sk_state_store(sk, TCP_ESTABLISHED);
}
bool mptcp_sk_is_subflow(const struct sock *sk)
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 71c86e31e19c..dedd3524e4a2 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -210,7 +210,7 @@ void mptcp_get_options(const struct sk_buff *skb,
struct tcp_options_received *opt_rx);
void mptcp_finish_connect(struct sock *sk, int mp_capable);
-void mptcp_finish_join(struct sock *conn, struct sock *sk);
+void mptcp_finish_join(struct sock *sk);
void token_init(void);
void token_new_request(struct request_sock *req, const struct sk_buff *skb);
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index d91d817b8779..9d91014c0d1b 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -165,7 +165,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
if (token_new_join(child))
goto close_child;
else
- mptcp_finish_join(ctx->conn, child);
+ mptcp_finish_join(child);
}
}
--
2.17.2
next reply other threads:[~2019-08-07 22:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 22:44 Peter Krystad [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-08-12 19:35 [MPTCP] [PATCH v3 02/10] Fix locking in mptcp_finish_join Matthieu Baerts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190807224434.2829-3-peter.krystad@linux.intel.com \
--to=unknown@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.