[Devel] [PATCH RHEL9 COMMIT] ms/netfilter: nf_tables: Modify nla_memdup's flag to GFP_KERNEL_ACCOUNT

Konstantin Khorenko khorenko at virtuozzo.com
Tue Jan 30 19:06:24 MSK 2024


The commit is pushed to "branch-rh9-5.14.0-362.8.1.vz9.35.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-362.8.1.vz9.35.9
------>
commit 74de53465d66a1c5c9c377b9ec8a2436f3e189ef
Author: Chen Aotian <chenaotian2 at 163.com>
Date:   Thu Apr 6 12:01:51 2023 +0800

    ms/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.
    
    mFixes: 33758c891479 ("memcg: enable accounting for nft objects")
    Signed-off-by: Chen Aotian <chenaotian2 at 163.com>
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
    
    https://virtuozzo.atlassian.net/browse/PSBM-153598
    (cherry picked from commit af0acf22aea359e04412237d68787401f96bb583)
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
    
    Feature: mm: fix CT resources accounting
---
 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 6ceb25bb8dfa..5e66093333ca 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -7032,7 +7032,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;
 


More information about the Devel mailing list