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: <1372276361.3301.208.camel@edumazet-glaptop>
Date:	Wed, 26 Jun 2013 12:52:41 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	"Abodunrin, Akeem G" <akeem.g.abodunrin@...el.com>
Cc:	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
	"Duyck, Alexander H" <alexander.h.duyck@...el.com>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"gospo@...hat.com" <gospo@...hat.com>,
	"sassmann@...hat.com" <sassmann@...hat.com>
Subject: RE: [net-next 07/10] igb: Added rcu_lock to avoid race

On Wed, 2013-06-26 at 16:42 +0000, Abodunrin, Akeem G wrote:
> 
> > -----Original Message-----
> > From: Eric Dumazet [mailto:eric.dumazet@...il.com]
> > Sent: Wednesday, June 26, 2013 4:20 AM
> > To: Kirsher, Jeffrey T
> > Cc: davem@...emloft.net; Abodunrin, Akeem G; netdev@...r.kernel.org;
> > gospo@...hat.com; sassmann@...hat.com
> > Subject: Re: [net-next 07/10] igb: Added rcu_lock to avoid race
> > 
> > On Wed, 2013-06-26 at 03:55 -0700, Jeff Kirsher wrote:
> > > From: "Akeem G. Abodunrin" <akeem.g.abodunrin@...el.com>
> > >
> > > This patch adds rcu_lock to avoid possible race condition with
> > > igb_update_stats function accessing the rings in free_ q_vector.
> > >
> > > Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@...el.com>
> > > Tested-by: Aaron Brown <aaron.f.brown@...el.com>
> > > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> > > ---
> > >  drivers/net/ethernet/intel/igb/igb_main.c | 7 ++++++-
> > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
> > > b/drivers/net/ethernet/intel/igb/igb_main.c
> > > index 7112e52..c74ad78 100644
> > > --- a/drivers/net/ethernet/intel/igb/igb_main.c
> > > +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> > > @@ -705,6 +705,8 @@ static void __exit igb_exit_module(void)
> > >  	dca_unregister_notify(&dca_notifier);
> > >  #endif
> > >  	pci_unregister_driver(&igb_driver);
> > > +
> > > +	rcu_barrier(); /* Wait for completion of call_rcu()'s */
> > >  }
> > >
> > 
> > This is not needed.
> > 
> > If this is really needed, a better comment would be welcomed ;)
> 
> Thanks Eric!
> 
> I believe we need this to make sure memory is released before removing
> driver code from the kernel, especially with each call to rcu - that
> is the reason for the comment "Wait for completion of call_rcu()'s".

You did not add call_rcu() in this patch, therefore you do not need
this.

I am extra careful of people adding useless rcu synchronization just
because they feel better :)



--
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