netfilter: nft_set_pipapo: Actually validate intervals in fields after the first one
authorStefano Brivio <sbrivio@redhat.com>
Thu, 24 Nov 2022 12:04:37 +0000 (13:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:37:22 +0000 (11:37 +0100)
commit7b09ba9036b26a7ed41c62b1ce7cad378549021f
tree683d8b0a3d632e299a2a66e33ea8b7d40daf468c
parent6daaa84b621485fe28c401be18debf92ae8ef04a
netfilter: nft_set_pipapo: Actually validate intervals in fields after the first one

[ Upstream commit 97d4d394b58777f7056ebba8ffdb4002d0563259 ]

Embarrassingly, nft_pipapo_insert() checked for interval validity in
the first field only.

The start_p and end_p pointers were reset to key data from the first
field at every iteration of the loop which was supposed to go over
the set fields.

Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges")
Reported-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_set_pipapo.c