mptcp: sendmsg: reset iter on error
authorFlorian Westphal <fw@strlen.de>
Fri, 14 Aug 2020 13:56:34 +0000 (15:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 10:59:48 +0000 (12:59 +0200)
commit22f290ab68251cc0f12b780b7b911d43fae236ce
treea505ffec37afe6935bae2c68f04553a83107576b
parent0c43f56ed9be6881ff8f50693916fd215b4d42e5
mptcp: sendmsg: reset iter on error

commit 35759383133f64d90eba120a0d3efe8f71241650 upstream.

Once we've copied data from the iterator we need to revert in case we
end up not sending any data.

This bug doesn't trigger with normal 'poll' based tests, because
we only feed a small chunk of data to kernel after poll indicated
POLLOUT.  With blocking IO and large writes this triggers. Receiver
ends up with less data than it should get.

Fixes: 72511aab95c94d ("mptcp: avoid blocking in tcp_sendpages")
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mptcp/protocol.c