[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CYYPR11MB8429C86B639760B11EEFB994BD622@CYYPR11MB8429.namprd11.prod.outlook.com>
Date: Wed, 18 Sep 2024 07:57:46 +0000
From: "Pucha, HimasekharX Reddy" <himasekharx.reddy.pucha@...el.com>
To: "Kitszel, Przemyslaw" <przemyslaw.kitszel@...el.com>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"Nguyen, Anthony L" <anthony.l.nguyen@...el.com>
CC: "Zaremba, Larysa" <larysa.zaremba@...el.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "Polchlopek, Mateusz"
<mateusz.polchlopek@...el.com>, "Keller, Jacob E" <jacob.e.keller@...el.com>,
"Kitszel, Przemyslaw" <przemyslaw.kitszel@...el.com>
Subject: RE: [Intel-wired-lan] [PATCH iwl-net v2] ice: fix memleak in
ice_init_tx_topology()
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of Przemek Kitszel
> Sent: Tuesday, September 10, 2024 7:27 PM
> To: intel-wired-lan@...ts.osuosl.org; Nguyen, Anthony L <anthony.l.nguyen@...el.com>
> Cc: Pucha, HimasekharX Reddy <himasekharx.reddy.pucha@...el.com>; Zaremba, Larysa <larysa.zaremba@...el.com>; netdev@...r.kernel.org; Polchlopek, Mateusz <mateusz.polchlopek@...el.com>; Keller, Jacob E <jacob.e.keller@...el.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@...el.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net v2] ice: fix memleak in ice_init_tx_topology()
>
> Fix leak of the FW blob (DDP pkg).
>
> Make ice_cfg_tx_topo() const-correct, so ice_init_tx_topology() can avoid copying whole FW blob. Copy just the topology section, and only when needed. Reuse the buffer allocated for the read of the current topology.
>
> This was found by kmemleak, with the following trace for each PF:
> [<ffffffff8761044d>] kmemdup_noprof+0x1d/0x50
> [<ffffffffc0a0a480>] ice_init_ddp_config+0x100/0x220 [ice]
> [<ffffffffc0a0da7f>] ice_init_dev+0x6f/0x200 [ice]
> [<ffffffffc0a0dc49>] ice_init+0x29/0x560 [ice]
> [<ffffffffc0a10c1d>] ice_probe+0x21d/0x310 [ice]
>
> Constify ice_cfg_tx_topo() @buf parameter.
> This cascades further down to few more functions.
>
> Fixes: cc5776fe1832 ("ice: Enable switching default Tx scheduler topology")
> CC: Larysa Zaremba <larysa.zaremba@...el.com>
> CC: Jacob Keller <jacob.e.keller@...el.com>
> CC: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@...el.com>
> CC: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
> ---
> this patch obsoletes two other, so I'm dropping RB tags v1, iwl-net: https://lore.kernel.org/netdev/20240904123306.14629-2-przemyslaw.kitszel@intel.com/
> wrong assumption that ice_get_set_tx_topo() does not modify the buffer
> on adminq SET variant, it sometimes does, to fill the response, thanks
> to Pucha Himasekhar Reddy for finding it out; almost-const-correct iwl-next patch:
> https://lore.kernel.org/intel-wired-lan/20240904093135.8795-2-przemyslaw.kitszel@intel.com
> it was just some of this patch, now it is const-correct
> ---
> drivers/net/ethernet/intel/ice/ice_ddp.h | 4 +- drivers/net/ethernet/intel/ice/ice_ddp.c | 58 +++++++++++------------ drivers/net/ethernet/intel/ice/ice_main.c | 8 +---
> 3 files changed, 31 insertions(+), 39 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@...el.com> (A Contingent worker at Intel)
Powered by blists - more mailing lists