]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: validate NFTA_SET_ELEM_OBJREF based on NFT_SET_OBJECT flag
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 16 May 2023 14:44:34 +0000 (16:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:08 +0000 (12:44 +0100)
commit664ca791b87dc73fe897d24a9236aaa671814aeb
tree7c4716953022a564368821c9c4c035a90d878ab8
parent773ef55f3cdad90cd16b4ec1b247d2b1e33c87da
netfilter: nf_tables: validate NFTA_SET_ELEM_OBJREF based on NFT_SET_OBJECT flag

c15dc142aaa7630a4348df6f46ce2afe59688f70 ]

If the NFTA_SET_ELEM_OBJREF netlink attribute is present and
NFT_SET_OBJECT flag is set on, report EINVAL.

Move existing sanity check earlier to validate that NFT_SET_OBJECT
requires NFTA_SET_ELEM_OBJREF.

Fixes: b8103279a36a ("netfilter: nf_tables: add stateful object reference to set elements")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_tables_api.c