All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: will@kernel.org, pablo@netfilter.org, stranche@codeaurora.org,
	netfilter-devel@vger.kernel.org, tglx@linutronix.de,
	fw@strlen.de, peterz@infradead.org
Subject: Re: [PATCH nf] netfilter: x_tables: Switch synchronization to RCU
Date: Sun, 22 Nov 2020 20:35:37 +0100	[thread overview]
Message-ID: <20201122193537.GV15137@breakpoint.cc> (raw)
In-Reply-To: <1606072636-23555-1-git-send-email-subashab@codeaurora.org>

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.

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.

  reply	other threads:[~2020-11-22 19:35 UTC|newest]

Thread overview: 8+ 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 [this message]
2020-11-22 19:55   ` subashab
2020-11-25  6:25     ` subashab
2020-11-22 20:58 ` kernel test robot
2020-11-22 20:58   ` kernel test robot
2020-11-25  3:40 ` 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=20201122193537.GV15137@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=peterz@infradead.org \
    --cc=stranche@codeaurora.org \
    --cc=subashab@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.