]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: sendmsg: reset iter on error
authorFlorian Westphal <fw@strlen.de>
Fri, 14 Aug 2020 13:56:34 +0000 (15:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Aug 2020 21:11:37 +0000 (14:11 -0700)
commit9d8d1957019e6b18c9ee5e3e2e9030dd4238969f
tree08b0435c11e611b15290e3afdedbd9182d8b41ed
parent0765c6eff9b6a14dd7f2d8cd1e57f723a400fd14
mptcp: sendmsg: reset iter on error

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: ee77bebcc53fa7 ("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>
net/mptcp/protocol.c