tls: Fix improper revert in zerocopy_from_iter
authorDoron Roberts-Kedes <doronrk@fb.com>
Thu, 26 Jul 2018 14:59:36 +0000 (07:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Jul 2018 05:53:31 +0000 (22:53 -0700)
commit2da19ed3e4a87db16c0f69039da9f17a9596c350
tree6dd8ede8accd1eb18152b00f6004d7df14d42b37
parent5a3611efe5b3095f348c892d040202b2ae969f4e
tls: Fix improper revert in zerocopy_from_iter

The current code is problematic because the iov_iter is reverted and
never advanced in the non-error case. This patch skips the revert in the
non-error case. This patch also fixes the amount by which the iov_iter
is reverted. Currently, iov_iter is reverted by size, which can be
greater than the amount by which the iter was actually advanced.
Instead, only revert by the amount that the iter was advanced.

Fixes: 4718799817c5 ("tls: Fix zerocopy_from_iter iov handling")
Signed-off-by: Doron Roberts-Kedes <doronrk@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c