netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Chen Aotian <chenaotian2@163.com>
Cc: kadlec@netfilter.org, fw@strlen.de, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netfilter: nf_tables: Modify nla_memdup's flag to GFP_KERNEL_ACCOUNT
Date: Thu, 6 Apr 2023 11:21:50 +0200	[thread overview]
Message-ID: <ZC6PLsY0+WWW21wE@salvia> (raw)
In-Reply-To: <20230406040151.1676-1-chenaotian2@163.com>

On Thu, Apr 06, 2023 at 12:01:51PM +0800, Chen Aotian wrote:
> For memory alloc that store user data from nla[NFTA_OBJ_USERDATA], 
> use GFP_KERNEL_ACCOUNT is more suitable.
>

Fixes: 33758c891479 ("memcg: enable accounting for nft objects")

> Signed-off-by: Chen Aotian <chenaotian2@163.com>
> ---
>  net/netfilter/nf_tables_api.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> index 6004d4b24..cd52109e6 100644
> --- a/net/netfilter/nf_tables_api.c
> +++ b/net/netfilter/nf_tables_api.c
> @@ -7052,7 +7052,7 @@ static int nf_tables_newobj(struct sk_buff *skb, const struct nfnl_info *info,
>  	}
>  
>  	if (nla[NFTA_OBJ_USERDATA]) {
> -		obj->udata = nla_memdup(nla[NFTA_OBJ_USERDATA], GFP_KERNEL);
> +		obj->udata = nla_memdup(nla[NFTA_OBJ_USERDATA], GFP_KERNEL_ACCOUNT);
>  		if (obj->udata == NULL)
>  			goto err_userdata;
>  
> -- 
> 2.25.1
> 

  reply	other threads:[~2023-04-06  9:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06  4:01 [PATCH] netfilter: nf_tables: Modify nla_memdup's flag to GFP_KERNEL_ACCOUNT Chen Aotian
2023-04-06  9:21 ` Pablo Neira Ayuso [this message]
2023-04-06  9:23   ` [netfilter-core] " Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2023-04-06  3:41 Chen Aotian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZC6PLsY0+WWW21wE@salvia \
    --to=pablo@netfilter.org \
    --cc=chenaotian2@163.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).