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: <20190927022647.GC22969@cs-dulles.cs.umn.edu>
Date:   Thu, 26 Sep 2019 21:26:47 -0500
From:   Navid Emamdoost <navid.emamdoost@...il.com>
To:     Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc:     emamd001@....edu, smccaman@....edu, kjlu@....edu,
        "David S. Miller" <davem@...emloft.net>,
        Pablo Neira Ayuso <pablo@...filter.org>,
        John Hurley <john.hurley@...ronome.com>,
        Colin Ian King <colin.king@...onical.com>,
        oss-drivers@...ronome.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: flow_offload: fix memory leak in
 nfp_abm_u32_knode_replace

On Wed, Sep 25, 2019 at 09:53:14PM -0700, Jakub Kicinski wrote:
> On Wed, 25 Sep 2019 21:22:35 -0500, Navid Emamdoost wrote:
> > In nfp_abm_u32_knode_replace if the allocation for match fails it should
> > go to the error handling instead of returning.
> > 
> > Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
> > ---
> > Changes in v2:
> > 	- Reused err variable for erorr value returning.
> 
> Thanks, there's another goto up top. And I think subject prefix could
> be "nfp: abm:", perhaps?
> 
Thanks, v3 was sent which fixes this.

Navid.
> >  drivers/net/ethernet/netronome/nfp/abm/cls.c | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/netronome/nfp/abm/cls.c b/drivers/net/ethernet/netronome/nfp/abm/cls.c
> > index 23ebddfb9532..b0cb9d201f7d 100644
> > --- a/drivers/net/ethernet/netronome/nfp/abm/cls.c
> > +++ b/drivers/net/ethernet/netronome/nfp/abm/cls.c
> > @@ -198,14 +198,18 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
> >  		if ((iter->val & cmask) == (val & cmask) &&
> >  		    iter->band != knode->res->classid) {
> >  			NL_SET_ERR_MSG_MOD(extack, "conflict with already offloaded filter");
> > +			err = -EOPNOTSUPP;
> >  			goto err_delete;
> >  		}
> >  	}
> >  
> >  	if (!match) {
> >  		match = kzalloc(sizeof(*match), GFP_KERNEL);
> > -		if (!match)
> > -			return -ENOMEM;
> > +		if (!match) {
> > +			err = -ENOMEM;
> > +			goto err_delete;
> > +		}
> > +
> >  		list_add(&match->list, &alink->dscp_map);
> >  	}
> >  	match->handle = knode->handle;
> > @@ -221,7 +225,7 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
> >  
> >  err_delete:
> >  	nfp_abm_u32_knode_delete(alink, knode);
> > -	return -EOPNOTSUPP;
> > +	return err;
> >  }
> >  
> >  static int nfp_abm_setup_tc_block_cb(enum tc_setup_type type,
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ