mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 12:44:32 -04:00
netfilter: nf_tables: fix userdata memleak
When userdata was introduced for tables and objects its allocation was
only freed inside the error path of the new{table, object} functions.
Free user data inside corresponding destroy functions for tables and
objects.
Fixes: b131c96496 ("netfilter: nf_tables: add userdata support for nft_object")
Fixes: 7a81575b80 ("netfilter: nf_tables: add userdata attributes to nft_table")
Signed-off-by: Jose M. Guisado Gomez <guigom@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
committed by
Pablo Neira Ayuso
parent
18cd9b00ff
commit
bc7a708235
@@ -1211,6 +1211,7 @@ static void nf_tables_table_destroy(struct nft_ctx *ctx)
|
||||
|
||||
rhltable_destroy(&ctx->table->chains_ht);
|
||||
kfree(ctx->table->name);
|
||||
kfree(ctx->table->udata);
|
||||
kfree(ctx->table);
|
||||
}
|
||||
|
||||
@@ -6231,6 +6232,7 @@ static void nft_obj_destroy(const struct nft_ctx *ctx, struct nft_object *obj)
|
||||
|
||||
module_put(obj->ops->type->owner);
|
||||
kfree(obj->key.name);
|
||||
kfree(obj->udata);
|
||||
kfree(obj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user