From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751399AbdAQQVI (ORCPT ); Tue, 17 Jan 2017 11:21:08 -0500 Received: from mga06.intel.com ([134.134.136.31]:2208 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbdAQQVE (ORCPT ); Tue, 17 Jan 2017 11:21:04 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,245,1477983600"; d="scan'208";a="1113977621" Date: Tue, 17 Jan 2017 18:21:01 +0200 From: Jarkko Sakkinen To: Ken Goldman Cc: tpmdd-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [tpmdd-devel] [PATCH] tpm: add session handles to the save and restore of the tpm2 space manager Message-ID: <20170117162101.3usgfxlbug77zeew@intel.com> References: <1484335453.2527.31.camel@linux.vnet.ibm.com> <20170116100415.ieyweqjjcg5d3zzd@intel.com> <1484608725.2540.88.camel@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 17, 2017 at 09:01:59AM -0500, Ken Goldman wrote: > On 1/16/2017 6:18 PM, James Bottomley wrote: > > > > Basically this means that the advice to virtualize session handles > > in the TCG RM document is wrong and we have to use physical handles. > > I'll redo the implementation for this ... and now, since we'll have > > nothing to use as an index, it probably does make sense to have > > sessions in a separate array. I can also separate isolation from > > context switching ... although I really think this is less optimal: > > my TPM only allows three active context handles, so if we don't > > context switch them identically to transient object (which it also > > only allows three of) I'm going to run out. I actually redid my > > openssl_tpm_engine patches so they use session handles for parameter > > encryption and HMAC based authority, so this may end up biting me > > soon ... > > I think you have to context save sessions, just as you do with transient > objects. Otherwise, only one process at a time can connect. Isolation is self-contained step that can be tested and possible regressions catched. I could even consider landing isolation in one release and swapping in subsequent in order to keep the release content more digestable for upper layer maintainers and risk of causing major regressions small. /Jarkko