netfilter: nft_quota: copy content when cloning expression
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 28 Feb 2023 19:43:02 +0000 (20:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:23 +0000 (08:50 +0100)
commit34869f8e713e7235fce22ba7ac47d975fb81dd60
tree64a78bd2721030e3a4ed5659d52b778b0dda0fdc
parent227a7266fcd17029ba76cda8c81b38bd28fe7938
netfilter: nft_quota: copy content when cloning expression

[ Upstream commit aabef97a35160461e9c576848ded737558d89055 ]

If the ruleset contains consumed quota, restore them accordingly.
Otherwise, listing after restoration shows never used items.

Restore the user-defined quota and flags too.

Fixes: ed0a0c60f0e5 ("netfilter: nft_quota: move stateful fields out of expression data")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_quota.c