From: Paolo Abeni <pabeni at redhat.com> To: mptcp at lists.01.org Subject: [MPTCP] [PATCH net-next 6/8] subflow: explicitly check for plain tcp rsk Date: Thu, 23 Jul 2020 13:02:34 +0200 [thread overview] Message-ID: <3d0b2caefba40597d5678a4a94ac961a2db6db31.1595431326.git.pabeni@redhat.com> (raw) In-Reply-To: cover.1595431326.git.pabeni@redhat.com [-- Attachment #1: Type: text/plain, Size: 1039 bytes --] When syncookie are in use, the TCP stack may feed into subflow_syn_recv_sock() plain TCP request sockets. We can't access mptcp_subflow_request_sock-specific fields on such sockets. Explicitly check the rsk ops to do safe accesses. Reviewed-by: Mat Martineau <mathew.j.martineau(a)linux.intel.com> Tested-by: Christoph Paasch <cpaasch(a)apple.com> Signed-off-by: Paolo Abeni <pabeni(a)redhat.com> --- net/mptcp/subflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 7f3ef1840df5..3ef445f59556 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -415,7 +415,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, /* hopefully temporary handling for MP_JOIN+syncookie */ subflow_req = mptcp_subflow_rsk(req); - fallback_is_fatal = subflow_req->mp_join; + fallback_is_fatal = tcp_rsk(req)->is_mptcp && subflow_req->mp_join; fallback = !tcp_rsk(req)->is_mptcp; if (fallback) goto create_child; -- 2.26.2
WARNING: multiple messages have this Message-ID (diff)
From: Paolo Abeni <pabeni@redhat.com> To: netdev@vger.kernel.org Cc: "David S. Miller" <davem@davemloft.net>, mptcp@lists.01.org Subject: [PATCH net-next 6/8] subflow: explicitly check for plain tcp rsk Date: Thu, 23 Jul 2020 13:02:34 +0200 [thread overview] Message-ID: <3d0b2caefba40597d5678a4a94ac961a2db6db31.1595431326.git.pabeni@redhat.com> (raw) In-Reply-To: <cover.1595431326.git.pabeni@redhat.com> When syncookie are in use, the TCP stack may feed into subflow_syn_recv_sock() plain TCP request sockets. We can't access mptcp_subflow_request_sock-specific fields on such sockets. Explicitly check the rsk ops to do safe accesses. Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Tested-by: Christoph Paasch <cpaasch@apple.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> --- net/mptcp/subflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 7f3ef1840df5..3ef445f59556 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -415,7 +415,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, /* hopefully temporary handling for MP_JOIN+syncookie */ subflow_req = mptcp_subflow_rsk(req); - fallback_is_fatal = subflow_req->mp_join; + fallback_is_fatal = tcp_rsk(req)->is_mptcp && subflow_req->mp_join; fallback = !tcp_rsk(req)->is_mptcp; if (fallback) goto create_child; -- 2.26.2
next reply other threads:[~2020-07-23 11:02 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-23 11:02 Paolo Abeni [this message] 2020-07-23 11:02 ` [PATCH net-next 6/8] subflow: explicitly check for plain tcp rsk Paolo Abeni -- strict thread matches above, loose matches on Subject: below -- 2020-07-23 18:47 [MPTCP] Re: [PATCH net-next 0/8] mptcp: non backup subflows pre-reqs David Miller 2020-07-23 18:47 ` David Miller 2020-07-23 11:02 [MPTCP] [PATCH net-next 8/8] subflow: introduce and use mptcp_can_accept_new_subflow() Paolo Abeni 2020-07-23 11:02 ` Paolo Abeni 2020-07-23 11:02 [MPTCP] [PATCH net-next 7/8] subflow: use rsk_ops->send_reset() Paolo Abeni 2020-07-23 11:02 ` Paolo Abeni 2020-07-23 11:02 [MPTCP] [PATCH net-next 5/8] mptcp: cleanup subflow_finish_connect() Paolo Abeni 2020-07-23 11:02 ` Paolo Abeni 2020-07-23 11:02 [MPTCP] [PATCH net-next 4/8] mptcp: explicitly track the fully established status Paolo Abeni 2020-07-23 11:02 ` Paolo Abeni 2020-07-23 11:02 [MPTCP] [PATCH net-next 3/8] mptcp: mark as fallback even early ones Paolo Abeni 2020-07-23 11:02 ` Paolo Abeni 2020-07-23 11:02 [MPTCP] [PATCH net-next 2/8] mptcp: avoid data corruption on reinsert Paolo Abeni 2020-07-23 11:02 ` Paolo Abeni 2020-07-23 11:02 [MPTCP] [PATCH net-next 1/8] subflow: always init 'rel_write_seq' Paolo Abeni 2020-07-23 11:02 ` Paolo Abeni 2020-07-23 11:02 [MPTCP] [PATCH net-next 0/8] mptcp: non backup subflows pre-reqs Paolo Abeni 2020-07-23 11:02 ` Paolo Abeni
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=3d0b2caefba40597d5678a4a94ac961a2db6db31.1595431326.git.pabeni@redhat.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: linkBe 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.