linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amol Grover <frextrite@gmail.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Florian Westphal <fw@strlen.de>, Jakub Kicinski <kuba@kernel.org>,
	Jeremy Sowden <jeremy@azazel.net>,
	Florent Fourcot <florent.fourcot@wifirst.fr>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Johannes Berg <johannes.berg@intel.com>,
	linux-kernel-mentees@lists.linuxfoundation.org,
	Joel Fernandes <joel@joelfernandes.org>,
	Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>,
	"Paul E . McKenney" <paulmck@kernel.org>
Subject: Re: [PATCH] netfilter: ipset: Pass lockdep expression to RCU lists
Date: Mon, 6 Apr 2020 12:36:12 +0530	[thread overview]
Message-ID: <20200406070612.GA240@workstation-LAP.localdomain> (raw)
In-Reply-To: <20200216172653.19772-1-frextrite@gmail.com>

On Sun, Feb 16, 2020 at 10:56:54PM +0530, Amol Grover wrote:
> ip_set_type_list is traversed using list_for_each_entry_rcu
> outside an RCU read-side critical section but under the protection
> of ip_set_type_mutex.
> 
> Hence, add corresponding lockdep expression to silence false-positive
> warnings, and harden RCU lists.
> 
> Signed-off-by: Amol Grover <frextrite@gmail.com>
> ---

Hi David

Could you please go through this patch aswell? This patch was directed to 
preemptively fix the _suspicious RCU usage_ warning which is now also
being reported by Kernel Test Robot.

[   11.654186] =============================
[   11.654619] WARNING: suspicious RCU usage
[   11.655022] 5.6.0-rc1-00179-gdb4ead2cd5253 #1 Not tainted
[   11.655583] -----------------------------
[   11.656001] net/netfilter/ipset/ip_set_core.c:89 RCU-list traversed in non-reader section!!

Thanks
Amol

>  net/netfilter/ipset/ip_set_core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
> index cf895bc80871..97c851589160 100644
> --- a/net/netfilter/ipset/ip_set_core.c
> +++ b/net/netfilter/ipset/ip_set_core.c
> @@ -86,7 +86,8 @@ find_set_type(const char *name, u8 family, u8 revision)
>  {
>  	struct ip_set_type *type;
>  
> -	list_for_each_entry_rcu(type, &ip_set_type_list, list)
> +	list_for_each_entry_rcu(type, &ip_set_type_list, list,
> +				lockdep_is_held(&ip_set_type_mutex))
>  		if (STRNCMP(type->name, name) &&
>  		    (type->family == family ||
>  		     type->family == NFPROTO_UNSPEC) &&
> -- 
> 2.24.1
> 

  reply	other threads:[~2020-04-06  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16 17:26 [PATCH] netfilter: ipset: Pass lockdep expression to RCU lists Amol Grover
2020-04-06  7:06 ` Amol Grover [this message]
2020-04-06 12:31 ` Pablo Neira Ayuso

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=20200406070612.GA240@workstation-LAP.localdomain \
    --to=frextrite@gmail.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=florent.fourcot@wifirst.fr \
    --cc=fw@strlen.de \
    --cc=jeremy@azazel.net \
    --cc=joel@joelfernandes.org \
    --cc=johannes.berg@intel.com \
    --cc=kadlec@netfilter.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madhuparnabhowmik10@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=paulmck@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).