]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
netfilter: nf_tables: warn when expr implements only one of activate/deactivate
authorFlorian Westphal <fw@strlen.de>
Thu, 30 Aug 2018 08:42:55 +0000 (10:42 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitc9a9e87cf8a8adacbec94b4990d2eba14948edb5
tree0ffb218a632517632601111dcb8dfa5407f4b8ab
parent73a54f7c0418e20aca75a985824543b8f8fb7fbf
netfilter: nf_tables: warn when expr implements only one of activate/deactivate

BugLink: https://bugs.launchpad.net/bugs/1838459
->destroy is only allowed to free data, or do other cleanups that do not
have side effects on other state, such as visibility to other netlink
requests.

Such things need to be done in ->deactivate.
As a transaction can fail, we need to make sure we can undo such
operations, therefore ->activate() has to be provided too.

So print a warning and refuse registration if expr->ops provides
only one of the two operations.

v2: fix nft_expr_check_ops to not repeat same check twice (Jones Desougi)

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/netfilter/nf_tables_api.c