[Devel] [PATCH RHEL8 COMMIT] netfilter/x_tables: account entry offsets allocations

Konstantin Khorenko khorenko at virtuozzo.com
Mon May 24 16:20:34 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.32
------>
commit f56d3b8d60039331b7fab1ea119743e32fbb1ea8
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Mon May 24 16:20:34 2021 +0300

    netfilter/x_tables: account entry offsets allocations
    
    Entry offsets may consume a lot of kernel memory. So let's account
    them.
    
    https://jira.sw.ru/browse/PSBM-54407
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
    
    (cherry picked from vz7 commit 56c0d7d5cc4b ("netfilter/x_tables: account
    entry offsets allocations"))
    
    VZ 8 rebase part https://jira.sw.ru/browse/PSBM-127783
    
    Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
---
 net/netfilter/x_tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 9ff9d4b83d0f..38584a504a29 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -983,7 +983,7 @@ unsigned int *xt_alloc_entry_offsets(unsigned int size)
 	if (size > XT_MAX_TABLE_SIZE / sizeof(unsigned int))
 		return NULL;
 
-	return kvmalloc_array(size, sizeof(unsigned int), GFP_KERNEL | __GFP_ZERO);
+	return kvmalloc_array(size, sizeof(unsigned int), GFP_KERNEL_ACCOUNT | __GFP_ZERO);
 
 }
 EXPORT_SYMBOL(xt_alloc_entry_offsets);


More information about the Devel mailing list