netfilter: nf_tables: Modify nla_memdup's flag to GFP_KERNEL_ACCOUNT
Subsystems (3)
PATCH 1/1 netfilter: nf_tables: Modify nla_memdup's flag to GFP_KERNEL_ACCOUNT
For memory alloc that store user data from nla[NFTA_OBJ_USERDATA], use GFP_KERNEL_ACCOUNT is more suitable.
Signed-off-by Chen Aotian <[email protected]>
--- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_tables_api.c +1 -1
@@ -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;
Signature · 1 line
2.25.1
Pablo Neira Ayuso
maintainerQuoted 3 lines · Chen Aotian
For memory alloc that store user data from nla[NFTA_OBJ_USERDATA], use
GFP_KERNEL_ACCOUNTis more suitable.
Fixes 33758c891479 ("memcg: enable accounting for nft objects")
Quoted 21 lines
Signed-off-by Chen Aotian <[email protected]>--- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/netfilter/nf_tables_api.c +1
-1@@ -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;Signature · 1 line
2.25.1
Pablo Neira Ayuso
maintainerQuoted 8 lines · Pablo Neira Ayuso
Quoted 3 lines · Chen Aotian
For memory alloc that store user data from nla[NFTA_OBJ_USERDATA], use
GFP_KERNEL_ACCOUNTis more suitable.Fixes 33758c891479 ("memcg: enable accounting for nft objects")Quoted 1 line
Signed-off-by Chen Aotian <[email protected]>
BTW, this patch is intended for nf.git, I'll apply it now.