From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760657AbdACSrk (ORCPT ); Tue, 3 Jan 2017 13:47:40 -0500 Received: from quartz.orcorp.ca ([184.70.90.242]:33590 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753228AbdACSrc (ORCPT ); Tue, 3 Jan 2017 13:47:32 -0500 Date: Tue, 3 Jan 2017 11:46:27 -0700 From: Jason Gunthorpe To: Jarkko Sakkinen Cc: tpmdd-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, Peter Huewe , Marcel Selhorst , open list Subject: Re: [PATCH RFC 4/4] tpm: add the infrastructure for TPM space for TPM 2.0 Message-ID: <20170103184627.GA26706@obsidianresearch.com> References: <20170102132213.22880-1-jarkko.sakkinen@linux.intel.com> <20170102132213.22880-5-jarkko.sakkinen@linux.intel.com> <20170102210953.GB5544@obsidianresearch.com> <20170103003730.he32vl55kkta2q64@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170103003730.he32vl55kkta2q64@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.156 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 03, 2017 at 02:37:30AM +0200, Jarkko Sakkinen wrote: > On Mon, Jan 02, 2017 at 02:09:53PM -0700, Jason Gunthorpe wrote: > > On Mon, Jan 02, 2017 at 03:22:10PM +0200, Jarkko Sakkinen wrote: > > > Added a ioctl for creating a TPM space. The space is isolated from the > > > other users of the TPM. Only a process holding the file with the handle > > > can access the objects and only objects that are created through that > > > file handle can be accessed. > > > > I don't understand this comment. /dev/tpmX is forced to be > > single-process-open, so how can there ever be more than 1 FD for it? > > > > Since the space is tied to that single fd these patches just create a > > way for the single user-space process to auto-cleanup if it crashes? > > > > Is that the entire intent of this design? I guess it is OK as a > > stepping point.. > > is_open is cleared in tpm_ioc_new_space. That is no good, it is racy if the intention is to use multiple clients, and any single client that doesn't support the new API blocks all access. Jason