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: <1452188266.8255.220.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Thu, 07 Jan 2016 09:37:46 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	paulmck@...ux.vnet.ibm.com
Cc:	Dave Jones <davej@...emonkey.org.uk>, netdev@...r.kernel.org
Subject: Re: suspicious rcu_dereference in tcp_v6_send_synack

On Thu, 2016-01-07 at 08:20 -0800, Paul E. McKenney wrote:
>  This is not clear if this is a lockdep false positive.
> > 
> > Paul, can you remind me why it is needed, as a softirq handler is not
> > allowed to schedule or be preempted ?
> 
> Hello, Eric!
> 
> If this were rcu_dereference_bh(), then you would be OK as is, given that
> you are in a softirq handler.  But for rcu_dereference(), lockdep does
> indeed insist on an rcu_read_lock().  Yes, you would in fact be OK with
> the current implementation (I think, anyway), even with preemptible RCU,
> but that is an accident of implementation.
> 
> Is the required rcu_read_lock() and rcu_read_unlock() resulting in a
> performance problem?

No performance problem.

This comes from my 45f6fad84cc305103b28d73482b344d7f5b76f39
commit ("ipv6: add complete rcu protection around np->opt")

I added the rcu_read_lock()/unlock() sections where I thought they were
needed, and when I considered tcp_v6_send_synack() case, my reasoning
was that we were holding rcu_read_lock() in the normal non retransmit
case, since the SYN packet is processed under rcu_read_lock()
protection, and wrongly assumed the timer irq was also holding
rcu_read_lock()

Also my RCU lockdep enabled tests did not trigger the warning seen by
Dave Jones.... Strange...

I will submit a formal patch.

Thanks !


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ