netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jijie Shao <shaojijie@huawei.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, andrew+netdev@lunn.ch, shenjian15@huawei.com,
	wangpeiyang1@huawei.com, liuyonglong@huawei.com,
	chenhao418@huawei.com, jonathan.cameron@huawei.com,
	shameerali.kolothum.thodi@huawei.com, salil.mehta@huawei.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/3] net: hns3: fix a use of uninitialized variable problem
Date: Wed, 2 Apr 2025 14:58:00 +0100	[thread overview]
Message-ID: <20250402135800.GP214849@horms.kernel.org> (raw)
In-Reply-To: <20250402121001.663431-2-shaojijie@huawei.com>

On Wed, Apr 02, 2025 at 08:09:59PM +0800, Jijie Shao wrote:
> From: Yonglong Liu <liuyonglong@huawei.com>
> 
> In hclge_add_fd_entry(), if the flow type is FLOW_EXT, and the data of
> m_ext is all zero, then some members of the local variable "info" are
> not initialized.

Hi,

I am assuming that this occurs when hclge_fd_check_spec() returns early
like this:

        if (!(fs->flow_type & FLOW_EXT) || hclge_fd_is_user_def_all_masked(fs))
                return 0;

But if so, should the description be "flow type is not FLOW_EXT, ..."
(note the "not")? Or perhaps more clearly refer to the FLOW_EXT bit
not being set?

Also, I think it would be worth mentioning hclge_fd_check_spec()
in the patch description, perhaps something like this.

  In hclge_add_fd_entry(), if  hclge_fd_check_spec() returns early
  because the FLOW_EXT bit is not set in the flow type, and ...

Also, does this manifest in a user-visible problem? If so, I think
it would be good to describe it in the patch description.

If not, I think it would be good to mention how the problem was found.
E.g.: "flagged by static analysis" (and mention the tool if it is publicly
Available. Or, "found by inspection".

> 
> Fixes: 67b0e1428e2f ("net: hns3: add support for user-def data of flow director")
> Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>

...

  reply	other threads:[~2025-04-02 13:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02 12:09 [PATCH net 0/3] There are some bugfix for the HNS3 ethernet driver Jijie Shao
2025-04-02 12:09 ` [PATCH net 1/3] net: hns3: fix a use of uninitialized variable problem Jijie Shao
2025-04-02 13:58   ` Simon Horman [this message]
2025-04-03  1:27     ` Jijie Shao
2025-04-02 12:10 ` [PATCH net 2/3] net: hns3: fix spelling mistake "reg_um" -> "reg_num" Jijie Shao
2025-04-02 13:59   ` Simon Horman
2025-04-03  1:22     ` Jijie Shao
2025-04-02 12:10 ` [PATCH net 3/3] net: hns3: store rx VLAN tag offload state for VF Jijie Shao
2025-04-02 14:01   ` Simon Horman
2025-04-03  1:21     ` Jijie Shao

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=20250402135800.GP214849@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=chenhao418@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=shaojijie@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=wangpeiyang1@huawei.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).