Commit 8ffcd32f authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_tables: bogus EBUSY in helper removal from transaction

Proper use counter updates when activating and deactivating the object,
otherwise, this hits bogus EBUSY error.

Fixes: cd5125d8 ("netfilter: nf_tables: split set destruction in deactivate and destroy phase")
Reported-by: default avatarLaura Garcia <nevola@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 6d65561f
...@@ -65,21 +65,34 @@ static int nft_objref_dump(struct sk_buff *skb, const struct nft_expr *expr) ...@@ -65,21 +65,34 @@ static int nft_objref_dump(struct sk_buff *skb, const struct nft_expr *expr)
return -1; return -1;
} }
static void nft_objref_destroy(const struct nft_ctx *ctx, static void nft_objref_deactivate(const struct nft_ctx *ctx,
const struct nft_expr *expr) const struct nft_expr *expr,
enum nft_trans_phase phase)
{ {
struct nft_object *obj = nft_objref_priv(expr); struct nft_object *obj = nft_objref_priv(expr);
if (phase == NFT_TRANS_COMMIT)
return;
obj->use--; obj->use--;
} }
static void nft_objref_activate(const struct nft_ctx *ctx,
const struct nft_expr *expr)
{
struct nft_object *obj = nft_objref_priv(expr);
obj->use++;
}
static struct nft_expr_type nft_objref_type; static struct nft_expr_type nft_objref_type;
static const struct nft_expr_ops nft_objref_ops = { static const struct nft_expr_ops nft_objref_ops = {
.type = &nft_objref_type, .type = &nft_objref_type,
.size = NFT_EXPR_SIZE(sizeof(struct nft_object *)), .size = NFT_EXPR_SIZE(sizeof(struct nft_object *)),
.eval = nft_objref_eval, .eval = nft_objref_eval,
.init = nft_objref_init, .init = nft_objref_init,
.destroy = nft_objref_destroy, .activate = nft_objref_activate,
.deactivate = nft_objref_deactivate,
.dump = nft_objref_dump, .dump = nft_objref_dump,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment