]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iov_iter: don't revert iov buffer if csum error
authorDing Tianhong <dingtianhong@huawei.com>
Sat, 29 Apr 2017 02:38:48 +0000 (10:38 +0800)
committerBrian Maly <brian.maly@oracle.com>
Tue, 4 Dec 2018 16:34:44 +0000 (11:34 -0500)
commit2314b9a460e7c5941373fc2f6715863c187970c4
treecb3ddb0dc9975289ddf82ed227502ed34db49ed4
parent4711a01c99fa261168904d33e397cbb847d1a86a
iov_iter: don't revert iov buffer if csum error

commit a6a5993243550b09f620941dea741b7421fdf79c upstream.

The patch 327868212381 (make skb_copy_datagram_msg() et.al. preserve
->msg_iter on error) will revert the iov buffer if copy to iter
failed, but it didn't copy any datagram if the skb_checksum_complete
error, so no need to revert any data at this place.

v2: Sabrina notice that return -EFAULT when checksum error is not correct
    here, it would confuse the caller about the return value, so fix it.

Fixes: 327868212381 ("make skb_copy_datagram_msg() et.al. preserve->msg_iter on error")
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
UEK4: iov_iter_revert() doesn't exist until 4.9, so stash a copy of the
iov_iter for revert purposes [Junxiao Bi]

Orabug: 28960296
Signed-off-by: Todd Vierling <todd.vierling@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
net/core/datagram.c