From: Eric Dumazet <eric.duma...@gmail.com> Date: Wed, 02 Nov 2016 14:41:50 -0700
> From: Eric Dumazet <eduma...@google.com> > > After my commit, tcp_sendmsg() might restart its loop after > processing socket backlog. > > If sk_err is set, we blindly return an error, even though we > copied data to user space before. > > We should instead return number of bytes that could be copied, > otherwise user space might resend data and corrupt the stream. > > This might happen if another thread is using recvmsg(MSG_ERRQUEUE) > to process timestamps. > > Issue was diagnosed by Soheil and Willem, big kudos to them ! > > Fixes: d41a69f1d390f ("tcp: make tcp_sendmsg() aware of socket backlog") > Signed-off-by: Eric Dumazet <eduma...@google.com> Applied and queued up for -stable.