[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260108175357.52ad56c1@kernel.org>
Date: Thu, 8 Jan 2026 17:53:57 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Tuo Li <islituo@...il.com>
Cc: ayush.sawal@...lsio.com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, kernelxing@...cent.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] chcr_ktls: add a defensive NULL check to prevent a
possible null-pointer dereference in chcr_ktls_dev_del()
On Tue, 6 Jan 2026 20:33:02 +0800 Tuo Li wrote:
> In this function, u_ctx is guarded by an if statement, which indicates that
> it may be NULL:
>
> u_ctx = tx_info->adap->uld[CXGB4_ULD_KTLS].handle;
> if (u_ctx && u_ctx->detach)
> return;
>
> Consequently, a potential null-pointer dereference may occur when
> tx_info->tid != -1, as shown below:
>
> if (tx_info->tid != -1) {
> ...
> xa_erase(&u_ctx->tid_list, tx_info->tid);
> }
>
> Therefore, add a defensive NULL check to prevent this issue.
There seems to be no locking here.
It'd take much more to make this code safe, sprinking random ifs
here and there seem like a waste of time.
--
pw-bot: reject
Powered by blists - more mailing lists