netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Yuanjun Gong <ruc_gongyuanjun@163.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] net: ipv4: fix return value check in esp_remove_trailer()
Date: Tue, 18 Jul 2023 08:44:47 -0600	[thread overview]
Message-ID: <f6831ace-df6c-f0bd-188e-a2b23a75c1a8@kernel.org> (raw)
In-Reply-To: <20230717144930.26197-1-ruc_gongyuanjun@163.com>

On 7/17/23 8:49 AM, Yuanjun Gong wrote:
> return an error number if an unexpected result is returned by
> pskb_tirm() in esp_remove_trailer().
> 
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
> ---
>  net/ipv4/esp4.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
> index ba06ed42e428..0660bf2bdbae 100644
> --- a/net/ipv4/esp4.c
> +++ b/net/ipv4/esp4.c
> @@ -732,7 +732,10 @@ static inline int esp_remove_trailer(struct sk_buff *skb)
>  		skb->csum = csum_block_sub(skb->csum, csumdiff,
>  					   skb->len - trimlen);
>  	}
> -	pskb_trim(skb, skb->len - trimlen);
> +	if (pskb_trim(skb, skb->len - trimlen)) {
> +		ret = -EINVAL;

pskb_trim returns the error from ___pskb_trim; use it instead of
changing it here.


> +		goto out;
> +	}
>  
>  	ret = nexthdr[1];
>  


  reply	other threads:[~2023-07-18 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 14:49 [PATCH 1/1] net: ipv4: fix return value check in esp_remove_trailer() Yuanjun Gong
2023-07-18 14:44 ` David Ahern [this message]
2023-07-25  6:40   ` [PATCH v2 " Yuanjun Gong
2023-07-25 17:44     ` Alexander H Duyck
2023-07-28 10:00       ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6831ace-df6c-f0bd-188e-a2b23a75c1a8@kernel.org \
    --to=dsahern@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=ruc_gongyuanjun@163.com \
    --cc=steffen.klassert@secunet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).