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] [day] [month] [year] [list]
Message-ID: <20200302123701.qnjmnmyoxycaixs6@salvia>
Date:   Mon, 2 Mar 2020 13:37:01 +0100
From:   Pablo Neira Ayuso <pablo@...filter.org>
To:     Amol Grover <frextrite@...il.com>
Cc:     Jozsef Kadlecsik <kadlec@...filter.org>,
        Florian Westphal <fw@...len.de>,
        "David S . Miller" <davem@...emloft.net>,
        Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        Jakub Kicinski <kuba@...nel.org>, linux-kernel@...r.kernel.org,
        linux-kernel-mentees@...ts.linuxfoundation.org,
        Joel Fernandes <joel@...lfernandes.org>,
        Madhuparna Bhowmik <madhuparnabhowmik10@...il.com>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        netfilter-devel@...r.kernel.org, coreteam@...filter.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH] netfilter: ipt_CLUSTERIP: Pass lockdep expression to RCU
 lists

On Wed, Feb 19, 2020 at 03:46:27PM +0530, Amol Grover wrote:
> cn->configs is traversed using list_for_each_entry_rcu
> outside an RCU read-side critical section but under the protection
> of cn->lock.
> 
> Hence, add corresponding lockdep expression to silence false-positive
> warnings, and harden RCU lists.
> 
> Signed-off-by: Amol Grover <frextrite@...il.com>
> ---
>  net/ipv4/netfilter/ipt_CLUSTERIP.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
> index 6bdb1ab8af61..df856ff835b7 100644
> --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
> +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
> @@ -139,7 +139,8 @@ __clusterip_config_find(struct net *net, __be32 clusterip)
>  	struct clusterip_config *c;
>  	struct clusterip_net *cn = clusterip_pernet(net);
>  
> -	list_for_each_entry_rcu(c, &cn->configs, list) {
> +	list_for_each_entry_rcu(c, &cn->configs, list,
> +				lockdep_is_held(&cn->lock)) {

bh is disabled before calling __clusterip_config_find(), then
rcu_read_lock_any_held() evaluates true.

Are you sure this really results in a WARN_ON splat?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ