netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <ruc_gongyuanjun@163.com>
Cc: <jmaloy@redhat.com>, <netdev@vger.kernel.org>,
	<ying.xue@windriver.com>, <kuniyu@amazon.com>
Subject: Re: [PATCH 1/1] net:tipc: check return value of pskb_trim()
Date: Mon, 17 Jul 2023 11:57:10 -0700	[thread overview]
Message-ID: <20230717185710.93256-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20230717145049.27642-1-ruc_gongyuanjun@163.com>

From: Yuanjun Gong <ruc_gongyuanjun@163.com>
Date: Mon, 17 Jul 2023 22:50:49 +0800
> goto free_skb if an unexpected result is returned by pskb_tirm()
> in tipc_crypto_rcv_complete().
> 
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
> ---
>  net/tipc/crypto.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c
> index 577fa5af33ec..1b86cea261a5 100644
> --- a/net/tipc/crypto.c
> +++ b/net/tipc/crypto.c
> @@ -1894,6 +1894,7 @@ static void tipc_crypto_rcv_complete(struct net *net, struct tipc_aead *aead,
>  	struct tipc_aead *tmp = NULL;
>  	struct tipc_ehdr *ehdr;
>  	struct tipc_node *n;
> +	int ret;
>  
>  	/* Is this completed by TX? */
>  	if (unlikely(is_tx(aead->crypto))) {
> @@ -1960,7 +1961,9 @@ static void tipc_crypto_rcv_complete(struct net *net, struct tipc_aead *aead,
>  
>  	skb_reset_network_header(*skb);
>  	skb_pull(*skb, tipc_ehdr_size(ehdr));
> -	pskb_trim(*skb, (*skb)->len - aead->authsize);
> +	ret = pskb_trim(*skb, (*skb)->len - aead->authsize);
> +	if (ret)

No need to define ret.


> +		goto free_skb;
>  
>  	/* Validate TIPCv2 message */
>  	if (unlikely(!tipc_msg_validate(skb))) {
> -- 
> 2.17.1

  reply	other threads:[~2023-07-17 18:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 14:50 [PATCH 1/1] net:tipc: check return value of pskb_trim() Yuanjun Gong
2023-07-17 18:57 ` Kuniyuki Iwashima [this message]
2023-07-25  6:48   ` [PATCH v2 1/1] tipc: " Yuanjun Gong
2023-07-25  7:19     ` Tung Quang Nguyen
2023-07-27  8:50     ` patchwork-bot+netdevbpf

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=20230717185710.93256-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=jmaloy@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=ruc_gongyuanjun@163.com \
    --cc=ying.xue@windriver.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).