diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-01-15 12:50:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-25 15:45:30 -0800 |
commit | ce2189d3985be2d72628b78a7e0e2b6d7db15c10 (patch) | |
tree | f9404da9bd91c71ae065da55b6db27ced7a1fa56 | |
parent | 9f0254479da4180d194fce950cee1dc975416177 (diff) | |
download | linux-stable-ce2189d3985be2d72628b78a7e0e2b6d7db15c10.tar.gz linux-stable-ce2189d3985be2d72628b78a7e0e2b6d7db15c10.tar.bz2 linux-stable-ce2189d3985be2d72628b78a7e0e2b6d7db15c10.zip |
netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description
[ Upstream commit 113661e07460a6604aacc8ae1b23695a89e7d4b3 ]
It is still possible to set on the NFT_SET_CONCAT flag by specifying a
set size and no field description, report EINVAL in such case.
Fixes: 1b6345d4160e ("netfilter: nf_tables: check NFT_SET_CONCAT flag if field_count is specified")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | net/netfilter/nf_tables_api.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 47ffb9e4c353..f032c29f1da6 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -5068,8 +5068,12 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info, if (err < 0) return err; - if (desc.field_count > 1 && !(flags & NFT_SET_CONCAT)) + if (desc.field_count > 1) { + if (!(flags & NFT_SET_CONCAT)) + return -EINVAL; + } else if (flags & NFT_SET_CONCAT) { return -EINVAL; + } } else if (flags & NFT_SET_CONCAT) { return -EINVAL; } |