]> git.ipfire.org Git - thirdparty/kernel/stable.git/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:27:51 +0000 (15:27 -0800)
commit9cb084df01e198119de477ac691d682fb01e80f3
treeccaa91a536ad0a0c902b5979a69c8e226857c184
parent7ae19ee81ca56b13c50a78de6c47d5b8fdc9d97b
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