Loading
netfilter: nf_tables: do not allow mismatch field size and set key length
stable inclusion from stable-v5.10.209 commit 2d4c0798a1ef8db15b3277697ac2def4eda42312 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9U3NW Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2d4c0798a1ef8db15b3277697ac2def4eda42312 -------------------------------- [ 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: f3a2181e ("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> Signed-off-by:
sanglipeng1 <sanglipeng1@jd.com>