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: <20150418203716.GC1347@kroah.com>
Date:	Sat, 18 Apr 2015 22:37:16 +0200
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
Cc:	Jens Wiklander <jens.wiklander@...aro.org>,
	valentin.manea@...wei.com, devicetree@...r.kernel.org,
	javier@...igon.com, emmanuel.michel@...com,
	Herbert Xu <herbert@...dor.apana.org.au>,
	Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
	jean-michel.delorme@...com, tpmdd-devel@...ts.sourceforge.net,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC PATCH 1/2] tee: generic TEE subsystem

On Sat, Apr 18, 2015 at 08:02:24PM +0100, Russell King - ARM Linux wrote:
> On Sat, Apr 18, 2015 at 08:47:13PM +0200, Greg Kroah-Hartman wrote:
> > On Sat, Apr 18, 2015 at 10:04:20AM +0100, Russell King - ARM Linux wrote:
> > > On Sat, Apr 18, 2015 at 10:57:12AM +0200, Greg Kroah-Hartman wrote:
> > > > On Fri, Apr 17, 2015 at 09:50:56AM +0200, Jens Wiklander wrote:
> > > > > +struct tee_device {
> > > > > +	char name[TEE_MAX_DEV_NAME_LEN];
> > > > > +	const struct tee_desc *desc;
> > > > > +	struct device *dev;
> > > > 
> > > > No, please embed the device in your structure, don't have a pointer to
> > > > it.
> > > 
> > > Greg, "dev" here is not a locally allocated device, but the parent device.
> > > It's actually the same as struct tee_device.miscdev.parent, which could be
> > > used instead and this member deleted.
> > 
> > A miscdev doesn't need to have a "parent", it's just there to provide a
> > character device node to userspace, not to represent a "device that you
> > can do things with in the heirachy".
> > 
> > If you really want that, then use a real 'struct device' as should be
> > done here.  Have just a pointer to a misc device, that is meant to be
> > dynamic.
> 
> Let's rewind.
> 
> You are saying that "struct device *dev;" should be "struct device dev;"

Yes.

> I'm saying that you are mis-interpreting in your review what _that_ is.

Probably, I really have no idea what it is anymore.  What it _should_ be
is the thing that controls the lifecycle of the structure.  Do not use a
miscdevice for that, it will not work, as the TPM developers found out
the hard way.

thanks,

greg k-h
--
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