]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: nf_tables: do not allow mismatch field size and set key length
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 14 Jan 2024 22:53:39 +0000 (23:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:45:30 +0000 (15:45 -0800)
commitff67e3e488090908dc015ba04d7407d8bd467f7e
tree19c88c1c31a79eea81de122e0eca02445e4809d3
parent544add1f1cfb78c3dfa3e6edcf4668f6be5e730c
netfilter: nf_tables: do not allow mismatch field size and set key length

[ Upstream commit 3ce67e3793f48c1b9635beb9bb71116ca1e51b58 ]

The set description provides the size of each field in the set whose sum
should not mismatch the set key length, bail out otherwise.

I did not manage to crash nft_set_pipapo with mismatch fields and set key
length so far, but this is UB which must be disallowed.

Fixes: f3a2181e16f1 ("netfilter: nf_tables: Support for sets with multiple ranged fields")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_tables_api.c