From: Pablo Neira Ayuso Date: Tue, 19 Dec 2017 11:01:21 +0000 (+0100) Subject: netfilter: nf_tables: fix chain filter in nf_tables_dump_rules() X-Git-Tag: v4.14.24~73 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2f52fa3f8d6fa949afebbb4dc24f71bc0785803;p=platform%2Fkernel%2Flinux-exynos.git netfilter: nf_tables: fix chain filter in nf_tables_dump_rules() [ Upstream commit 24c0df82ef7919e4d10cf2e4e65d368eb2e8ea21 ] ctx->chain may be null now that we have very large object names, so we cannot check for ctx->chain[0] here. Fixes: b7263e071aba7 ("netfilter: nf_tables: Allow table names of up to 255 chars") Signed-off-by: Pablo Neira Ayuso Acked-by: Phil Sutter Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 64e1ee0..ce49946 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -2072,7 +2072,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;