ar71xx: fix double registration of usb host mode devices, add usb client support...
[openwrt/openwrt.git] / target / linux / generic / backport-4.14 / 333-netfilter-nf_tables-fix-chain-filter-in-nf_tables_du.patch
1 From: Pablo Neira Ayuso <pablo@netfilter.org>
2 Date: Tue, 19 Dec 2017 12:01:21 +0100
3 Subject: [PATCH] netfilter: nf_tables: fix chain filter in
4 nf_tables_dump_rules()
5
6 ctx->chain may be null now that we have very large object names,
7 so we cannot check for ctx->chain[0] here.
8
9 Fixes: b7263e071aba7 ("netfilter: nf_tables: Allow table names of up to 255 chars")
10 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
11 Acked-by: Phil Sutter <phil@nwl.cc>
12 ---
13
14 --- a/net/netfilter/nf_tables_api.c
15 +++ b/net/netfilter/nf_tables_api.c
16 @@ -2090,7 +2090,7 @@ static int nf_tables_dump_rules(struct s
17 continue;
18
19 list_for_each_entry_rcu(chain, &table->chains, list) {
20 - if (ctx && ctx->chain[0] &&
21 + if (ctx && ctx->chain &&
22 strcmp(ctx->chain, chain->name) != 0)
23 continue;
24