lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SJ0PR11MB5865CACBC2D09B4F34A581708FA92@SJ0PR11MB5865.namprd11.prod.outlook.com>
Date: Tue, 23 Jul 2024 08:05:11 +0000
From: "Romanowski, Rafal" <rafal.romanowski@...el.com>
To: Simon Horman <horms@...nel.org>, "Zaki, Ahmed" <ahmed.zaki@...el.com>
CC: "Guo, Junfeng" <junfeng.guo@...el.com>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, Marcin Szycik <marcin.szycik@...ux.intel.com>,
	"Nguyen, Anthony L" <anthony.l.nguyen@...el.com>, "Keller, Jacob E"
	<jacob.e.keller@...el.com>, "intel-wired-lan@...ts.osuosl.org"
	<intel-wired-lan@...ts.osuosl.org>
Subject: RE: [Intel-wired-lan] [PATCH iwl-next v2 11/13] ice: enable FDIR
 filters from raw binary patterns for VFs

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of Simon
> Horman
> Sent: Friday, May 31, 2024 8:12 PM
> To: Zaki, Ahmed <ahmed.zaki@...el.com>
> Cc: Guo, Junfeng <junfeng.guo@...el.com>; netdev@...r.kernel.org; Marcin
> Szycik <marcin.szycik@...ux.intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@...el.com>; Keller, Jacob E <jacob.e.keller@...el.com>; intel-
> wired-lan@...ts.osuosl.org
> Subject: Re: [Intel-wired-lan] [PATCH iwl-next v2 11/13] ice: enable FDIR filters
> from raw binary patterns for VFs
> 
> On Fri, May 31, 2024 at 09:47:47AM -0600, Ahmed Zaki wrote:
> >
> >
> > On 2024-05-31 7:18 a.m., Simon Horman wrote:
> > > On Mon, May 27, 2024 at 12:58:08PM -0600, Ahmed Zaki wrote:
> > > > From: Junfeng Guo <junfeng.guo@...el.com>
> > > >
> > > > Enable VFs to create FDIR filters from raw binary patterns.
> > > > The corresponding processes for raw flow are added in the Parse /
> > > > Create / Destroy stages.
> > > >
> > > > Reviewed-by: Marcin Szycik <marcin.szycik@...ux.intel.com>
> > > > Signed-off-by: Junfeng Guo <junfeng.guo@...el.com>
> > > > Co-developed-by: Ahmed Zaki <ahmed.zaki@...el.com>
> > > > Signed-off-by: Ahmed Zaki <ahmed.zaki@...el.com>
> > >
> > > ...
> > >
> > > > diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c
> > > > b/drivers/net/ethernet/intel/ice/ice_flow.c
> > >
> > > ...
> > >
> > > > +/**
> > > > + * ice_flow_set_parser_prof - Set flow profile based on the
> > > > +parsed profile info
> > > > + * @hw: pointer to the HW struct
> > > > + * @dest_vsi: dest VSI
> > > > + * @fdir_vsi: fdir programming VSI
> > > > + * @prof: stores parsed profile info from raw flow
> > > > + * @blk: classification blk
> > > > + */
> > > > +int
> > > > +ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi,
> > > > +			 struct ice_parser_profile *prof, enum ice_block blk) {
> > > > +	u64 id = find_first_bit(prof->ptypes, ICE_FLOW_PTYPE_MAX);
> > > > +	struct ice_flow_prof_params *params __free(kfree);
> > > > +	u8 fv_words = hw->blk[blk].es.fvw;
> > > > +	int status;
> > > > +	int i, idx;
> > > > +
> > > > +	params = kzalloc(sizeof(*params), GFP_KERNEL);
> > > > +	if (!params)
> > > > +		return -ENOMEM;
> > >
> > >
> > > params seems to be leaked when this function returns below, in both
> > > error and non-error cases.
> >
> > Shouldn't the __free guard take care of this?
> 
> Yes, sorry for missing that.
> 
> ...
> 
> > > > diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > > b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > > index 5635e9da2212..9138f7783da0 100644
> > > > --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > > +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > > @@ -1,8 +1,8 @@
> > > >   // SPDX-License-Identifier: GPL-2.0
> > > >   /* Copyright (C) 2022, Intel Corporation. */ -#include
> > > > "ice_vf_lib_private.h"
> > > >   #include "ice.h"
> > > > +#include "ice_vf_lib_private.h"
> > > >   #include "ice_lib.h"
> > > >   #include "ice_fltr.h"
> > > >   #include "ice_virtchnl_allowlist.h"
> > >
> > > To me tweaking the order of includes seems to indicate that
> > > something isn't quite right. Is there some sort of dependency loop
> > > being juggled here?
> >
> > This was needed because of the changes in ice_flow.h, struct ice_vsi
> > is now used. I will check if there is a better fix.
> 
> Thanks.
> 
> ...
> 
> > > > +static int
> > > > +ice_vc_fdir_parse_raw(struct ice_vf *vf,
> > > > +		      struct virtchnl_proto_hdrs *proto,
> > > > +		      struct virtchnl_fdir_fltr_conf *conf) {
> > > > +	u8 *pkt_buf, *msk_buf __free(kfree);
> > > > +	struct ice_parser_result rslt;
> > > > +	struct ice_pf *pf = vf->pf;
> > > > +	struct ice_parser *psr;
> > > > +	int status = -ENOMEM;
> > > > +	struct ice_hw *hw;
> > > > +	u16 udp_port = 0;
> > > > +
> > > > +	pkt_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL);
> > > > +	msk_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL);
> > >
> > > msk_buf appears to be leaked both in when this function returns for
> > > both error and non-error cases.
> >
> > Same, guarded by __free. I am new to these guards myself, pls let me
> > know if I am missing something.
> 
> No, sorry. Somehow I missed the __free.
> I think we are good here.


Tested-by: Rafal Romanowski <rafal.romanowski@...el.com>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ