[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BN9PR11MB535442A326EDAD2FFAA1588B808B9@BN9PR11MB5354.namprd11.prod.outlook.com>
Date: Mon, 27 Mar 2023 10:59:52 +0000
From: "Arland, ArpanaX" <arpanax.arland@...el.com>
To: Jakob Koschel <jkl820.git@...il.com>,
"Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
"Nguyen, Anthony L" <anthony.l.nguyen@...el.com>,
"David S. Miller" <davem@...emloft.net>,
"Eric Dumazet" <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Pietro Borrello <borrello@...g.uniroma1.it>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Bos, H.J." <h.j.bos@...nl>,
"Cristiano Giuffrida" <c.giuffrida@...nl>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>
Subject: RE: [Intel-wired-lan] [PATCH net v2] ice: fix invalid check for empty
list in ice_sched_assoc_vsi_to_agg()
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of Jakob Koschel
> Sent: Monday, March 20, 2023 6:18 PM
> To: Brandeburg, Jesse <jesse.brandeburg@...el.com>; Nguyen, Anthony L <anthony.l.nguyen@...el.com>; David S. Miller <davem@...emloft.net>; Eric Dumazet <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>
> Cc: netdev@...r.kernel.org; Pietro Borrello <borrello@...g.uniroma1.it>; linux-kernel@...r.kernel.org; Bos, H.J. <h.j.bos@...nl>; Cristiano Giuffrida <c.giuffrida@...nl>; intel-wired-lan@...ts.osuosl.org; Jakob Koschel <jkl820.git@...il.com>
> Subject: [Intel-wired-lan] [PATCH net v2] ice: fix invalid check for empty list in ice_sched_assoc_vsi_to_agg()
>
> 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@...il.com>
> ---
> Changes in v2:
> - add Fixes tag
> - Link to v1: https://lore.kernel.org/r/20230301-ice-fix-invalid-iterator-found-check-v1-1-87c26deed999@gmail.com
> ---
> drivers/net/ethernet/intel/ice/ice_sched.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
Tested-by: Arpana Arland <arpanax.arland@...el.com> (A Contingent worker at Intel)
Powered by blists - more mailing lists