[Devel] [PATCH RHEL7 COMMIT] ms/netfilter: nf_tables: fix chain filter in nf_tables_dump_rules()

Konstantin Khorenko khorenko at virtuozzo.com
Wed Aug 31 19:37:30 MSK 2022


The commit is pushed to "branch-rh7-3.10.0-1160.76.1.vz7.189.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.76.1.vz7.189.1
------>
commit 368c1bb08c24d655cef660e29a8a68df6a91b720
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Mon Aug 15 20:12:19 2022 +0300

    ms/netfilter: nf_tables: fix chain filter in nf_tables_dump_rules()
    
    ctx->chain may be null now that we have very large object names,
    so we cannot check for ctx->chain[0] here.
    
    mFixes: b7263e071aba7 ("netfilter: nf_tables: Allow table names of up to 255 chars")
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
    Acked-by: Phil Sutter <phil at nwl.cc>
    
    https://jira.sw.ru/browse/PSBM-141578
    (cherry picked from ms commit 24c0df82ef7919e4d10cf2e4e65d368eb2e8ea21)
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.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 f5526bd2a435c..dd4d2f7ab077b 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1952,7 +1952,7 @@ static int nf_tables_dump_rules(struct sk_buff *skb,
 				continue;
 
 			list_for_each_entry_rcu(chain, &table->chains, list) {
-				if (ctx && ctx->chain[0] &&
+				if (ctx && ctx->chain &&
 				    strcmp(ctx->chain, chain->name) != 0)
 					continue;
 


More information about the Devel mailing list