[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230317095653.x5az7jrhziwctwjg@soft-dev3-1>
Date: Fri, 17 Mar 2023 10:56:53 +0100
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: Kang Chen <void0red@...il.com>
CC: <borisp@...dia.com>, <davem@...emloft.net>,
<dirk.vandermerwe@...ronome.com>, <edumazet@...gle.com>,
<john.fastabend@...il.com>, <kuba@...nel.org>,
<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<pabeni@...hat.com>
Subject: Re: [PATCH net v2] net/tls: refine the branch condition in
tls_dev_event
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@...rochip.com>
>
> Fixes: eeb2efaf36c7 ("net/tls: generalize the resync callback")
> Signed-off-by: Kang Chen <void0red@...il.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
Powered by blists - more mailing lists