Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1632871

Re: [PATCH] iov_iter: don't revert if csum error

From Sabrina Dubroca <sd@queasysnail.net>
Newsgroups linux.kernel
Subject Re: [PATCH] iov_iter: don't revert if csum error
Date 2017-04-28 15:20 +0200
Message-ID <tBdYu-7Nk-27@gated-at.bofh.it> (permalink)
References <tBdF8-7pE-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2017-04-28, 20:48:45 +0800, Ding Tianhong wrote:
> The patch 3278682 (make skb_copy_datagram_msg() et.al. preserve
> ->msg_iter on error) will revert the iov buffer if copy to iter
> failed, but it looks no need to revert for csum error, so fix it.
> 
> Fixes: 3278682 ("make skb_copy_datagram_msg() et.al. preserve->msg_iter on error")

Please use 12 digits, ie 327868212381.

> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> ---
>  net/core/datagram.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/datagram.c b/net/core/datagram.c
> index f4947e7..475a8e9 100644
> --- a/net/core/datagram.c
> +++ b/net/core/datagram.c
> @@ -760,7 +760,7 @@ int skb_copy_and_csum_datagram_msg(struct sk_buff *skb,
> 
>  	if (msg_data_left(msg) < chunk) {
>  		if (__skb_checksum_complete(skb))
> -			goto csum_error;
> +			goto fault;

With this patch, skb_copy_and_csum_datagram_msg() will return -EFAULT
for an incorrect checksum, that doesn't seem right.

>  		if (skb_copy_datagram_msg(skb, hlen, msg, chunk))
>  			goto fault;
>  	} else {
> -- 
> 1.8.3.1
> 

-- 
Sabrina

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] iov_iter: don't revert if csum error Ding Tianhong <dingtianhong@huawei.com> - 2017-04-28 15:00 +0200
  Re: [PATCH] iov_iter: don't revert if csum error Sabrina Dubroca <sd@queasysnail.net> - 2017-04-28 15:20 +0200
    RE: [PATCH] iov_iter: don't revert if csum error David Laight <David.Laight@ACULAB.COM> - 2017-04-28 16:00 +0200
    Re: [PATCH] iov_iter: don't revert if csum error Ding Tianhong <dingtianhong@huawei.com> - 2017-04-29 04:20 +0200

csiph-web