* [PATCH 4.14 0/1] netfilter: Fix EBUSY when removing objref
@ 2023-05-19 19:28 Thadeu Lima de Souza Cascardo
2023-05-19 19:28 ` [PATCH 4.14 1/1] netfilter: nf_tables: bogus EBUSY in helper removal from transaction Thadeu Lima de Souza Cascardo
0 siblings, 1 reply; 3+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2023-05-19 19:28 UTC (permalink / raw)
To: stable; +Cc: pablo, netfilter-devel
When removing a rule with an objref expression and the object it references in
the same batch, it will return EBUSY. The backported commit has a Fixes line
for one of the commits recently backported.
Pablo Neira Ayuso (1):
netfilter: nf_tables: bogus EBUSY in helper removal from transaction
net/netfilter/nft_objref.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 4.14 1/1] netfilter: nf_tables: bogus EBUSY in helper removal from transaction
2023-05-19 19:28 [PATCH 4.14 0/1] netfilter: Fix EBUSY when removing objref Thadeu Lima de Souza Cascardo
@ 2023-05-19 19:28 ` Thadeu Lima de Souza Cascardo
2023-05-26 18:33 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2023-05-19 19:28 UTC (permalink / raw)
To: stable; +Cc: pablo, netfilter-devel
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit 8ffcd32f64633926163cdd07a7d295c500a947d1 upstream.
Proper use counter updates when activating and deactivating the object,
otherwise, this hits bogus EBUSY error.
Fixes: cd5125d8f518 ("netfilter: nf_tables: split set destruction in deactivate and destroy phase")
Reported-by: Laura Garcia <nevola@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
net/netfilter/nft_objref.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/nft_objref.c b/net/netfilter/nft_objref.c
index 49a067a67e72..5deb997db9bb 100644
--- a/net/netfilter/nft_objref.c
+++ b/net/netfilter/nft_objref.c
@@ -64,21 +64,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,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 4.14 1/1] netfilter: nf_tables: bogus EBUSY in helper removal from transaction
2023-05-19 19:28 ` [PATCH 4.14 1/1] netfilter: nf_tables: bogus EBUSY in helper removal from transaction Thadeu Lima de Souza Cascardo
@ 2023-05-26 18:33 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2023-05-26 18:33 UTC (permalink / raw)
To: Thadeu Lima de Souza Cascardo; +Cc: stable, pablo, netfilter-devel
On Fri, May 19, 2023 at 04:28:59PM -0300, Thadeu Lima de Souza Cascardo wrote:
> From: Pablo Neira Ayuso <pablo@netfilter.org>
>
> commit 8ffcd32f64633926163cdd07a7d295c500a947d1 upstream.
>
> Proper use counter updates when activating and deactivating the object,
> otherwise, this hits bogus EBUSY error.
>
> Fixes: cd5125d8f518 ("netfilter: nf_tables: split set destruction in deactivate and destroy phase")
> Reported-by: Laura Garcia <nevola@gmail.com>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
> net/netfilter/nft_objref.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
>
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-26 18:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-19 19:28 [PATCH 4.14 0/1] netfilter: Fix EBUSY when removing objref Thadeu Lima de Souza Cascardo
2023-05-19 19:28 ` [PATCH 4.14 1/1] netfilter: nf_tables: bogus EBUSY in helper removal from transaction Thadeu Lima de Souza Cascardo
2023-05-26 18:33 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).