netfilter: nf_tables: bogus EBUSY in helper removal from transaction
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/1 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.
Reported-by Laura Garcia <[email protected]>
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- net/netfilter/nft_objref.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
net/netfilter/nft_objref.c +16 -3
@@ -65,21 +65,34 @@ static int nft_objref_dump(struct sk_buff *skb, const struct nft_expr *expr)return -1 ; } -static void nft_objref_destroy (const struct nft_ctx *ctx, -const struct nft_expr *expr) +static void nft_objref_deactivate (const struct nft_ctx *ctx, +const struct nft_expr *expr, +enum nft_trans_phase phase) {struct nft_object *obj =nft_objref_priv (expr); +if (phase ==NFT_TRANS_COMMIT ) +return ; + 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 const struct nft_expr_ops nft_objref_ops = { .type = &nft_objref_type, .size =NFT_EXPR_SIZE (sizeof (struct nft_object *)), .eval = nft_objref_eval, .init = nft_objref_init, - .destroy = nft_objref_destroy, + .activate = nft_objref_activate, + .deactivate = nft_objref_deactivate, .dump = nft_objref_dump, };
Signature · 1 line
2.11.0