]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
mptcp: Return EPIPE if sending is shut down during a sendmsg
authorMat Martineau <mathew.j.martineau@linux.intel.com>
Tue, 28 Jul 2020 22:12:00 +0000 (15:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jul 2020 00:02:41 +0000 (17:02 -0700)
A MPTCP socket where sending has been shut down should not attempt to
send additional data, since DATA_FIN has already been sent.

Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c

index 2891ae8a10285d5eb52db39dc91afda6d287f509..b3c3dbc89b3f9068b81722278bf9f2ce3ec06859 100644 (file)
@@ -748,6 +748,11 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 restart:
        mptcp_clean_una(sk);
 
+       if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN)) {
+               ret = -EPIPE;
+               goto out;
+       }
+
 wait_for_sndbuf:
        __mptcp_flush_join_list(msk);
        ssk = mptcp_subflow_get_send(msk);