aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-07-04 02:51:28 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2020-07-04 02:51:28 +0200
commitc1f79a2eefdcc0aef5d7a911c27a3f75f1936ecd (patch)
treeb734a2cd2ed9ee3f00f7a7921ff49425b42e2a71 /net/netfilter
parentnetfilter: nf_tables: add NFT_CHAIN_BINDING (diff)
downloadlinux-dev-c1f79a2eefdcc0aef5d7a911c27a3f75f1936ecd.tar.xz
linux-dev-c1f79a2eefdcc0aef5d7a911c27a3f75f1936ecd.zip
netfilter: nf_tables: reject unsupported chain flags
Bail out if userspace sends unsupported chain flags. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_tables_api.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index b8a970dad213..f96785586f64 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2285,6 +2285,9 @@ static int nf_tables_newchain(struct net *net, struct sock *nlsk,
else if (chain)
flags = chain->flags;
+ if (flags & ~NFT_CHAIN_FLAGS)
+ return -EOPNOTSUPP;
+
nft_ctx_init(&ctx, net, skb, nlh, family, table, chain, nla);
if (chain != NULL) {