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]
Message-ID: <20190815143810.3a190c81@cakuba.netronome.com>
Date:   Thu, 15 Aug 2019 14:38:10 -0700
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Eric Dumazet <eric.dumazet@...il.com>
Cc:     Davide Caratti <dcaratti@...hat.com>,
        Boris Pismenny <borisp@...lanox.com>,
        John Fastabend <john.fastabend@...il.com>,
        Dave Watson <davejwatson@...com>,
        Aviad Yehezkel <aviadye@...lanox.com>,
        "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/3] tcp: ulp: add functions to dump
 ulp-specific information

On Thu, 15 Aug 2019 20:46:01 +0200, Eric Dumazet wrote:
> On 8/15/19 6:00 PM, Davide Caratti wrote:
> 
> >  
> > +	if (net_admin) {
> > +		const struct tcp_ulp_ops *ulp_ops;
> > +
> > +		rcu_read_lock();
> > +		ulp_ops = icsk->icsk_ulp_ops;
> > +		if (ulp_ops)
> > +			err = tcp_diag_put_ulp(skb, sk, ulp_ops);
> > +		rcu_read_unlock();
> > +		if (err)
> > +			return err;
> > +	}
> >  	return 0;  
> 
> 
> Why is rcu_read_lock() and rcu_read_unlock() used at all ?
> 
> icsk->icsk_ulp_ops does not seem to be rcu protected ?
> 
> If this was, then an rcu_dereference() would be appropriate.

Indeed it's ulp_data not ulp_ops that are protected. Davide, 
perhaps we could push the RCU lock into tls_get_info(), after all?

And tls_context has to use rcu_deference there, as Eric points out, 
plus we should probably NULL-check it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ