All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw at strlen.de>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [PATCH v2 9/9] don't flag parent socket as RCV_SHUTDOWN if one one subflow has closed
Date: Fri, 06 Dec 2019 17:37:32 +0100	[thread overview]
Message-ID: <20191206163732.GA795@breakpoint.cc> (raw)
In-Reply-To: a0204fbd-6678-c9ce-1273-9f6183892615@tessares.net

[-- Attachment #1: Type: text/plain, Size: 2060 bytes --]

Matthieu Baerts <matthieu.baerts(a)tessares.net> wrote:
> 00:07:58.688 [   14.025780] #PF: supervisor read access in kernel mode
> 00:07:58.689 [   14.026588] #PF: error_code(0x0000) - not-present page
> 00:07:58.690 [   14.027394] PGD 0 P4D 0
> 00:07:58.690 [   14.027801] Oops: 0000 [#1] SMP PTI
> 00:07:58.691 [   14.028355] CPU: 0 PID: 731 Comm: mptcp_connect Not tainted
> 5.4.0+ #5
> 00:07:58.692 [   14.029365] Hardware name: QEMU Standard PC (i440FX + PIIX,
> 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
> 00:07:58.693 [   14.030752] RIP: 0010:mptcp_stream_accept+0x8d/0x160
> 00:07:58.694 [   14.031533] Code: 8b 9c 24 b0 05 00 00 49 81 c4 b0 05 00 00
> 4c 39 e3 74 71 49 8d 76 40 48 89 74 24 08 eb 08 48 8b 1b 4c 39 e3 74 5e 48
> 8b 6b 78 <48> 83 bd 78 02 00 00 00 75 ea 4c 8d bd 28 02 00 00 89 44 24 04 4c
> 00:07:58.697 [   14.034405] RSP: 0018:ffffad8d8044bdf0 EFLAGS: 00010283
> 00:07:58.698 [   14.035218] RAX: 0000000000000000 RBX: ffff96f35d0d9928 RCX:
> 0000000000000001

The faulty commit is

    make accept not allocate kernel socket struct


When doing the last version I broke tcp-ipv6 fallback.  This fixes
things:

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1512,6 +1512,15 @@ static int mptcp_listen(struct socket *sock, int backlog)
 	return err;
 }
 
+static bool is_tcp_proto(const struct proto *p)
+{
+#ifdef CONFIG_MPTCP_IPV6
+	return p == &tcp_prot || p == &tcpv6_prot;
+#else
+	return p == &tcp_prot;
+#endif
+}
+
 static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
 			       int flags, bool kern)
 {
@@ -1526,7 +1535,7 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
 		return -EINVAL;
 
 	err = ssock->ops->accept(sock, newsock, flags, kern);
-	if (err == 0 && newsock->sk->sk_prot != &tcp_prot) {
+	if (err == 0 && !is_tcp_proto(newsock->sk->sk_prot)) {
 		struct mptcp_sock *msk = mptcp_sk(newsock->sk);
 		struct mptcp_subflow_context *subflow;
 

             reply	other threads:[~2019-12-06 16:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 16:37 Florian Westphal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-12-06 17:04 [MPTCP] Re: [PATCH v2 9/9] don't flag parent socket as RCV_SHUTDOWN if one one subflow has closed Matthieu Baerts
2019-12-06 15:57 Florian Westphal
2019-12-06 15:52 Matthieu Baerts
2019-12-03  9:13 Matthieu Baerts
2019-12-03  9:05 Paolo Abeni
2019-12-03  7:44 Matthieu Baerts
2019-12-02 21:21 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=20191206163732.GA795@breakpoint.cc \
    --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.