lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 6 Apr 2020 12:36:12 +0530
From:   Amol Grover <frextrite@...il.com>
To:     "David S . Miller" <davem@...emloft.net>
Cc:     netfilter-devel@...r.kernel.org, coreteam@...filter.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Pablo Neira Ayuso <pablo@...filter.org>,
        Jozsef Kadlecsik <kadlec@...filter.org>,
        Florian Westphal <fw@...len.de>,
        Jakub Kicinski <kuba@...nel.org>,
        Jeremy Sowden <jeremy@...zel.net>,
        Florent Fourcot <florent.fourcot@...irst.fr>,
        Kate Stewart <kstewart@...uxfoundation.org>,
        Johannes Berg <johannes.berg@...el.com>,
        linux-kernel-mentees@...ts.linuxfoundation.org,
        Joel Fernandes <joel@...lfernandes.org>,
        Madhuparna Bhowmik <madhuparnabhowmik10@...il.com>,
        "Paul E . McKenney" <paulmck@...nel.org>
Subject: Re: [PATCH] netfilter: ipset: Pass lockdep expression to RCU lists

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@...il.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ