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]
Date:	Thu, 25 Sep 2008 09:59:30 -0500
From:	"Serge E. Hallyn" <serue@...ibm.com>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:	Rajiv Andrade <srajiv@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	serue@...ux.vnet.ibm.com, zohar@...ux.vnet.ibm.com,
	safford@...son.ibm.com, debora@...ux.vnet.ibm.com
Subject: Re: [PATCH 3/4] TPM: rcu locking

Quoting Paul E. McKenney (paulmck@...ux.vnet.ibm.com):
> On Thu, Sep 25, 2008 at 08:36:45AM -0500, Serge E. Hallyn wrote:
> > Quoting Paul E. McKenney (paulmck@...ux.vnet.ibm.com):
> > > On Tue, Sep 23, 2008 at 05:18:17PM -0300, Rajiv Andrade wrote:
> > > > Paul,
> > > > 
> > > > On Tue, 2008-09-23 at 11:19 -0700, Paul E. McKenney wrote:
> > > > > 
> > > > > But here we are deleting from what appears to be some other list.
> > > > > And I don't see any insertiong into either list.
> > > > > 
> > > > > What am I missing here?
> > > > > 
> > > > >                                                         Thanx, Paul
> > > > 
> > > > Sorry, forgot to change list_add() to list_add_rcu() in the code section
> > > > below:
> > > > 
> > > > > > +     /* Make chip available */
> > > > > > +     spin_lock(&driver_lock);
> > > > > > +     list_add(&chip->list, &tpm_chip_list);
> > > > > > +     spin_unlock(&driver_lock);
> > > > 
> > > > I'll resubmit.
> > > 
> > > Cool!
> > > 
> > > So tpm_chip_list and the not-obviously-identical list manipulated
> > > in tpm_remove_hardware() really are the same list?
> > > 
> > > 							Thanx, Paul
> > 
> > Hey Paul,
> > 
> > curious, why do they not look like the same list?
> 
> Because one of them is named &tpm_chip_list, a global variable, and the
> other seemed to be returned from a function taking a struct device as an
> argument.  This is indeed consistent with an element in this list being
> hung off of the struct device, so perhaps I was just being insufficiently
> persistent in tracking things down.
> 
> 							Thanx, Paul

Right, tpm_register_hardware both does
	dev_set_drvdata(dev, chip)
to set dev->driver_data = chip, and list_add(chip->list, &tpm_chip_list).
The tpm_remove_hardware(), then, gets the device, gets the chip from
dev->driver_data,  and removes it from the tpm_chip_list.

It does look kosher.

Though once this is all applied to some public git tree, I want to take
some time to look at the full result.

-serge
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ