mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 05:12:49 +00:00
netfilter: nft_compat: use-after-free when deleting targets
commit753c111f65
upstream. Fetch pointer to module before target object is released. Fixes:29e3880109
("netfilter: nf_tables: fix use-after-free when deleting compat expressions") Fixes:0ca743a559
("netfilter: nf_tables: add compatibility layer for x_tables") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1500d94e33
commit
a905b82e1e
1 changed files with 2 additions and 1 deletions
|
@ -282,6 +282,7 @@ nft_target_destroy(const struct nft_ctx *ctx, const struct nft_expr *expr)
|
|||
{
|
||||
struct xt_target *target = expr->ops->data;
|
||||
void *info = nft_expr_priv(expr);
|
||||
struct module *me = target->me;
|
||||
struct xt_tgdtor_param par;
|
||||
|
||||
par.net = ctx->net;
|
||||
|
@ -292,7 +293,7 @@ nft_target_destroy(const struct nft_ctx *ctx, const struct nft_expr *expr)
|
|||
par.target->destroy(&par);
|
||||
|
||||
if (nft_xt_put(container_of(expr->ops, struct nft_xt, ops)))
|
||||
module_put(target->me);
|
||||
module_put(me);
|
||||
}
|
||||
|
||||
static int nft_target_dump(struct sk_buff *skb, const struct nft_expr *expr)
|
||||
|
|
Loading…
Reference in a new issue