diff options
author | Vasily Averin <vasily.averin@linux.dev> | 2022-04-02 12:50:37 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-04-05 11:55:46 +0200 |
commit | 42193ffd79bd3acd91bd947e53f3548a3661d0a1 (patch) | |
tree | 61fcfde10c7b4a8fed378d8685b11f80e27464fa /net/netfilter/nft_last.c | |
parent | 31818213170caa51d116eb5dc1167b88523b4fe1 (diff) | |
download | linux-42193ffd79bd3acd91bd947e53f3548a3661d0a1.tar.gz linux-42193ffd79bd3acd91bd947e53f3548a3661d0a1.tar.bz2 linux-42193ffd79bd3acd91bd947e53f3548a3661d0a1.zip |
netfilter: nf_tables: memcg accounting for dynamically allocated objects
nft_*.c files whose NFT_EXPR_STATEFUL flag is set on need to
use __GFP_ACCOUNT flag for objects that are dynamically
allocated from the packet path.
Such objects are allocated inside nft_expr_ops->init() callbacks
executed in task context while processing netlink messages.
In addition, this patch adds accounting to nft_set_elem_expr_clone()
used for the same purposes.
Signed-off-by: Vasily Averin <vvs@openvz.org>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_last.c')
-rw-r--r-- | net/netfilter/nft_last.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nft_last.c b/net/netfilter/nft_last.c index 43d0d4aadb1f..bb15a55dad5c 100644 --- a/net/netfilter/nft_last.c +++ b/net/netfilter/nft_last.c @@ -30,7 +30,7 @@ static int nft_last_init(const struct nft_ctx *ctx, const struct nft_expr *expr, u64 last_jiffies; int err; - last = kzalloc(sizeof(*last), GFP_KERNEL); + last = kzalloc(sizeof(*last), GFP_KERNEL_ACCOUNT); if (!last) return -ENOMEM; |