]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: sanitize nft_set_desc_concat_parse()
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 27 May 2022 07:56:18 +0000 (09:56 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 31 May 2022 21:13:10 +0000 (23:13 +0200)
commit43814e60dcd38a7e721d1b4ea6d9d9571ffa9f3b
tree6d90cad797014df56c589ad7e3310946d04ff78a
parent8ff0447ee4d5afcd9aad0814fc36f1a8b099be6d
netfilter: nf_tables: sanitize nft_set_desc_concat_parse()

Add several sanity checks for nft_set_desc_concat_parse():

- validate desc->field_count not larger than desc->field_len array.
- field length cannot be larger than desc->field_len (ie. U8_MAX)
- total length of the concatenation cannot be larger than register array.

Joint work with Florian Westphal.

Fixes: c1894f2477ec ("netfilter: nf_tables: Support for sets with multiple ranged fields")
Reported-by: <zhangziming.zzm@antgroup.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c