From: Patrick McHardy Date: Sat, 21 Mar 2015 15:19:16 +0000 (+0000) Subject: netfilter: nf_tables: reject NFT_SET_ELEM_INTERVAL_END flag for non-interval sets X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=55df35d22fe3433032d82b8c67dfd283cb071953;p=linux-beck.git netfilter: nf_tables: reject NFT_SET_ELEM_INTERVAL_END flag for non-interval sets Signed-off-by: Patrick McHardy Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index a072d8769b9b..f7e3371ce856 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -3138,6 +3138,9 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set, elem.flags = ntohl(nla_get_be32(nla[NFTA_SET_ELEM_FLAGS])); if (elem.flags & ~NFT_SET_ELEM_INTERVAL_END) return -EINVAL; + if (!(set->flags & NFT_SET_INTERVAL) && + elem.flags & NFT_SET_ELEM_INTERVAL_END) + return -EINVAL; } if (set->flags & NFT_SET_MAP) {