Netdev List
 help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Kang Chen <void0red@gmail.com>
Cc: <borisp@nvidia.com>, <davem@davemloft.net>,
	<dirk.vandermerwe@netronome.com>, <edumazet@google.com>,
	<john.fastabend@gmail.com>, <kuba@kernel.org>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<pabeni@redhat.com>
Subject: Re: [PATCH net v2] net/tls: refine the branch condition in tls_dev_event
Date: Fri, 17 Mar 2023 10:56:53 +0100	[thread overview]
Message-ID: <20230317095653.x5az7jrhziwctwjg@soft-dev3-1> (raw)
In-Reply-To: <20230317083338.1085194-1-void0red@gmail.com>

The 03/17/2023 16:33, Kang Chen wrote:
> 
> dev->tlsdev_ops may be null and cause null pointer dereference later.

Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> 
> Fixes: eeb2efaf36c7 ("net/tls: generalize the resync callback")
> Signed-off-by: Kang Chen <void0red@gmail.com>
> ---
> v2 -> v1: simplify the condition
> 
>  net/tls/tls_device.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
> index a7cc4f9faac2..45b07162d062 100644
> --- a/net/tls/tls_device.c
> +++ b/net/tls/tls_device.c
> @@ -1449,7 +1449,8 @@ static int tls_dev_event(struct notifier_block *this, unsigned long event,
>                 if (netif_is_bond_master(dev))
>                         return NOTIFY_DONE;
>                 if ((dev->features & NETIF_F_HW_TLS_RX) &&
> -                   !dev->tlsdev_ops->tls_dev_resync)
> +                  (!dev->tlsdev_ops ||
> +                   !dev->tlsdev_ops->tls_dev_resync))
>                         return NOTIFY_BAD;
> 
>                 if  (dev->tlsdev_ops &&
> --
> 2.34.1
> 

-- 
/Horatiu

  reply	other threads:[~2023-03-17  9:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17  7:16 [PATCH] net/tls: refine the branch condition in tls_dev_event Kang Chen
2023-03-17  8:15 ` Horatiu Vultur
2023-03-17  8:33   ` [PATCH net v2] " Kang Chen
2023-03-17  9:56     ` Horatiu Vultur [this message]
2023-03-17 19:54     ` Jakub Kicinski

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=20230317095653.x5az7jrhziwctwjg@soft-dev3-1 \
    --to=horatiu.vultur@microchip.com \
    --cc=borisp@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dirk.vandermerwe@netronome.com \
    --cc=edumazet@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=void0red@gmail.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