netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: nf_tables: Modify nla_memdup's flag to GFP_KERNEL_ACCOUNT
@ 2023-04-06  4:01 Chen Aotian
  2023-04-06  9:21 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Aotian @ 2023-04-06  4:01 UTC (permalink / raw)
  To: pablo
  Cc: kadlec, fw, davem, edumazet, kuba, pabeni, netfilter-devel,
	coreteam, netdev, linux-kernel, Chen Aotian

For memory alloc that store user data from nla[NFTA_OBJ_USERDATA], 
use GFP_KERNEL_ACCOUNT is more suitable.

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] netfilter: nf_tables: Modify nla_memdup's flag to GFP_KERNEL_ACCOUNT
  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
  2023-04-06  9:23   ` [netfilter-core] " Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2023-04-06  9:21 UTC (permalink / raw)
  To: Chen Aotian
  Cc: kadlec, fw, davem, edumazet, kuba, pabeni, netfilter-devel,
	coreteam, netdev, linux-kernel

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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [netfilter-core] [PATCH] netfilter: nf_tables: Modify nla_memdup's flag to GFP_KERNEL_ACCOUNT
  2023-04-06  9:21 ` Pablo Neira Ayuso
@ 2023-04-06  9:23   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2023-04-06  9:23 UTC (permalink / raw)
  To: Chen Aotian
  Cc: netdev, linux-kernel, kadlec, edumazet, coreteam, netfilter-devel,
	kuba, pabeni, davem

On Thu, Apr 06, 2023 at 11:21:50AM +0200, Pablo Neira Ayuso wrote:
> 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>

BTW, this patch is intended for nf.git, I'll apply it now.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-06  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2023-04-06  9:23   ` [netfilter-core] " Pablo Neira Ayuso

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).