From: Leon Romanovsky <leon@kernel.org>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, netdev@vger.kernel.org,
Jakob Koschel <jkl820.git@gmail.com>,
Arpana Arland <arpanax.arland@intel.com>
Subject: Re: [PATCH net 4/4] ice: fix invalid check for empty list in ice_sched_assoc_vsi_to_agg()
Date: Wed, 29 Mar 2023 15:08:26 +0300 [thread overview]
Message-ID: <20230329120826.GR831478@unreal> (raw)
In-Reply-To: <20230328172035.3904953-5-anthony.l.nguyen@intel.com>
On Tue, Mar 28, 2023 at 10:20:35AM -0700, Tony Nguyen wrote:
> From: Jakob Koschel <jkl820.git@gmail.com>
>
> The code implicitly assumes that the list iterator finds a correct
> handle. If 'vsi_handle' is not found the 'old_agg_vsi_info' was
> pointing to an bogus memory location. For safety a separate list
> iterator variable should be used to make the != NULL check on
> 'old_agg_vsi_info' correct under any circumstances.
>
> Additionally Linus proposed to avoid any use of the list iterator
> variable after the loop, in the attempt to move the list iterator
> variable declaration into the macro to avoid any potential misuse after
> the loop. Using it in a pointer comparison after the loop is undefined
> behavior and should be omitted if possible [1].
>
> Fixes: 37c592062b16 ("ice: remove the VSI info from previous agg")
> Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1]
> Signed-off-by: Jakob Koschel <jkl820.git@gmail.com>
> Tested-by: Arpana Arland <arpanax.arland@intel.com> (A Contingent worker at Intel)
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_sched.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
next prev parent reply other threads:[~2023-03-29 12:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-28 17:20 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2023-03-28 (ice) Tony Nguyen
2023-03-28 17:20 ` [PATCH net 1/4] ice: fix W=1 headers mismatch Tony Nguyen
2023-03-29 12:06 ` Leon Romanovsky
2023-03-28 17:20 ` [PATCH net 2/4] ice: Fix ice_cfg_rdma_fltr() to only update relevant fields Tony Nguyen
2023-03-29 12:08 ` Leon Romanovsky
2023-03-28 17:20 ` [PATCH net 3/4] ice: add profile conflict check for AVF FDIR Tony Nguyen
2023-03-29 12:08 ` Leon Romanovsky
2023-03-28 17:20 ` [PATCH net 4/4] ice: fix invalid check for empty list in ice_sched_assoc_vsi_to_agg() Tony Nguyen
2023-03-29 12:08 ` Leon Romanovsky [this message]
2023-03-30 4:50 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2023-03-28 (ice) patchwork-bot+netdevbpf
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=20230329120826.GR831478@unreal \
--to=leon@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=arpanax.arland@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jkl820.git@gmail.com \
--cc=kuba@kernel.org \
--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).