]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_tables: reject mismatching sum of field_len with set key length
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 28 Jan 2025 11:26:33 +0000 (12:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Feb 2025 09:02:20 +0000 (10:02 +0100)
commitab50d0eff4a939d20c37721fd9766347efcdb6f6
treea45c9fda054c2c83e76a373bdfd1938a23d192f1
parent5d08d4337ca5105f773220f923616ca87a1ed329
netfilter: nf_tables: reject mismatching sum of field_len with set key length

commit 1b9335a8000fb70742f7db10af314104b6ace220 upstream.

The field length description provides the length of each separated key
field in the concatenation, each field gets rounded up to 32-bits to
calculate the pipapo rule width from pipapo_init(). The set key length
provides the total size of the key aligned to 32-bits.

Register-based arithmetics still allows for combining mismatching set
key length and field length description, eg. set key length 10 and field
description [ 5, 4 ] leading to pipapo width of 12.

Cc: stable@vger.kernel.org
Fixes: 3ce67e3793f4 ("netfilter: nf_tables: do not allow mismatch field size and set key length")
Reported-by: Noam Rathaus <noamr@ssd-disclosure.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_tables_api.c