Re: [PATCH nf,v2] netfilter: nf_tables: missing objects with no memcg accounting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 18, 2024 at 03:20:30PM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
> > v2: a more complete version.
> 
> Thanks Pablo, LGTM.  One nit below.
> > diff --git a/net/netfilter/nft_log.c b/net/netfilter/nft_log.c
> > index 5defe6e4fd98..e35588137995 100644
> > --- a/net/netfilter/nft_log.c
> > +++ b/net/netfilter/nft_log.c
> > @@ -163,7 +163,7 @@ static int nft_log_init(const struct nft_ctx *ctx,
> >  
> >  	nla = tb[NFTA_LOG_PREFIX];
> >  	if (nla != NULL) {
> > -		priv->prefix = kmalloc(nla_len(nla) + 1, GFP_KERNEL);
> > +		priv->prefix = kmalloc(nla_len(nla) + 1, GFP_KERNEL_ACCOUNT);
> >  		if (priv->prefix == NULL)
> >  			return -ENOMEM;
> >  		nla_strscpy(priv->prefix, nla, nla_len(nla) + 1);
> 
> You could update this to use nla_strdup instead of kmalloc+strscpy.
> 
> No need to send a v3 for this I think.

Thanks for reviewing, I promise to address this in nf-next.




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux