netfilter: nf_tables: missing attribute validation in nf_tables_delflowtable()
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 26 Feb 2018 12:16:05 +0000 (13:16 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 27 Feb 2018 07:06:57 +0000 (08:06 +0100)
Return -EINVAL is mandatory attributes are missing.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c

index 43acdee..2b5aa78 100644 (file)
@@ -5161,6 +5161,11 @@ static int nf_tables_delflowtable(struct net *net, struct sock *nlsk,
        struct nft_table *table;
        struct nft_ctx ctx;
 
+       if (!nla[NFTA_FLOWTABLE_TABLE] ||
+           (!nla[NFTA_FLOWTABLE_NAME] &&
+            !nla[NFTA_FLOWTABLE_HANDLE]))
+               return -EINVAL;
+
        table = nf_tables_table_lookup(net, nla[NFTA_FLOWTABLE_TABLE],
                                       family, genmask);
        if (IS_ERR(table))