netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wojciech Drewek <wojciech.drewek@intel.com>
To: Aleksandr Mishin <amishin@t-argos.ru>,
	Edwin Peer <edwin.peer@broadcom.com>
Cc: Michael Chan <michael.chan@broadcom.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<lvc-project@linuxtesting.org>
Subject: Re: [PATCH net] bnxt_en: Adjust logging of firmware messages in case of released token in __hwrm_send()
Date: Fri, 7 Jun 2024 13:02:38 +0200	[thread overview]
Message-ID: <7a8d76c0-e1ee-4ded-af41-3f1e3aa85530@intel.com> (raw)
In-Reply-To: <20240607070613.12156-1-amishin@t-argos.ru>



On 07.06.2024 09:06, Aleksandr Mishin wrote:
> In case of token is released due to token->state == BNXT_HWRM_DEFERRED,
> released token (set to NULL) is used in log messages. This issue is
> expected to be prevented by HWRM_ERR_CODE_PF_UNAVAILABLE error code. But
> this error code is returned by recent firmware. So some firmware may not
> return it. This may lead to NULL pointer dereference.
> Adjust this issue by adding token pointer check.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: 8fa4219dba8e ("bnxt_en: add dynamic debug support for HWRM messages")
> Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
> ---

Thanks!
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

>  drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c
> index 1df3d56cc4b5..14585ac476c8 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c
> @@ -678,7 +678,7 @@ static int __hwrm_send(struct bnxt *bp, struct bnxt_hwrm_ctx *ctx)
>  	if (rc == HWRM_ERR_CODE_BUSY && !(ctx->flags & BNXT_HWRM_CTX_SILENT))
>  		netdev_warn(bp->dev, "FW returned busy, hwrm req_type 0x%x\n",
>  			    req_type);
> -	else if (rc && rc != HWRM_ERR_CODE_PF_UNAVAILABLE)
> +	else if (rc && token && rc != HWRM_ERR_CODE_PF_UNAVAILABLE)
>  		hwrm_err(bp, ctx, "hwrm req_type 0x%x seq id 0x%x error 0x%x\n",
>  			 req_type, token->seq_id, rc);
>  	rc = __hwrm_to_stderr(rc);

  reply	other threads:[~2024-06-07 11:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07  7:06 [PATCH net] bnxt_en: Adjust logging of firmware messages in case of released token in __hwrm_send() Aleksandr Mishin
2024-06-07 11:02 ` Wojciech Drewek [this message]
2024-06-08 15:40 ` Michael Chan

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=7a8d76c0-e1ee-4ded-af41-3f1e3aa85530@intel.com \
    --to=wojciech.drewek@intel.com \
    --cc=amishin@t-argos.ru \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=edwin.peer@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).