From: subashab@codeaurora.org
To: Florian Westphal <fw@strlen.de>
Cc: will@kernel.org, pablo@netfilter.org, stranche@codeaurora.org,
netfilter-devel@vger.kernel.org, tglx@linutronix.de,
peterz@infradead.org
Subject: Re: [PATCH nf] netfilter: x_tables: Switch synchronization to RCU
Date: Sun, 22 Nov 2020 12:55:26 -0700 [thread overview]
Message-ID: <849b3bf0b35edf5ba1b23636a4b57ba6@codeaurora.org> (raw)
In-Reply-To: <20201122193537.GV15137@breakpoint.cc>
On 2020-11-22 12:35, Florian Westphal wrote:
> Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> wrote:
>> diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
>> index af22dbe..416a617 100644
>> --- a/net/netfilter/x_tables.c
>> +++ b/net/netfilter/x_tables.c
>> @@ -1349,6 +1349,14 @@ struct xt_counters *xt_counters_alloc(unsigned
>> int counters)
>> }
>> EXPORT_SYMBOL(xt_counters_alloc);
> [..]
>
>> /* Do the substitution. */
>> - local_bh_disable();
>> - private = table->private;
>> + private = xt_table_get_private_protected(table);
>>
>> /* Check inside lock: is the old number correct? */
>> if (num_counters != private->number) {
>
> There is a local_bh_enable() here that needs removal.
Thanks, will update that.
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 416a617..acce622 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -1379,7 +1379,6 @@ xt_replace_table(struct xt_table *table,
if (num_counters != private->number) {
pr_debug("num_counters != table->private->number
(%u/%u)\n",
num_counters, private->number);
- local_bh_enable();
*error = -EAGAIN;
return NULL;
}
>
> Did you test it with PROVE_LOCKING enabled?
>
> The placement/use of rcu_dereference and the _protected version
> looks correct, I would not expect splats.
My config doesn't seem to have it. I will enable and try it out.
next prev parent reply other threads:[~2020-11-22 19:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-22 19:17 [PATCH nf] netfilter: x_tables: Switch synchronization to RCU Subash Abhinov Kasiviswanathan
2020-11-22 19:35 ` Florian Westphal
2020-11-22 19:55 ` subashab [this message]
2020-11-25 6:25 ` subashab
2020-11-22 20:58 ` kernel test robot
2020-11-25 3:40 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=849b3bf0b35edf5ba1b23636a4b57ba6@codeaurora.org \
--to=subashab@codeaurora.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=peterz@infradead.org \
--cc=stranche@codeaurora.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).