From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753436AbdBJQUh (ORCPT ); Fri, 10 Feb 2017 11:20:37 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:51708 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752523AbdBJQUf (ORCPT ); Fri, 10 Feb 2017 11:20:35 -0500 Message-ID: <1486743078.2502.4.camel@HansenPartnership.com> Subject: Re: [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code From: James Bottomley To: Jarkko Sakkinen , tpmdd-devel@lists.sourceforge.net Cc: linux-security-module@vger.kernel.org, Peter Huewe , Marcel Selhorst , Jason Gunthorpe , open list Date: Fri, 10 Feb 2017 08:11:18 -0800 In-Reply-To: <20170210085256.eqhnrmdug2fcz4ql@intel.com> References: <20170208110713.14070-1-jarkko.sakkinen@linux.intel.com> <20170208110713.14070-7-jarkko.sakkinen@linux.intel.com> <20170210085256.eqhnrmdug2fcz4ql@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-02-10 at 10:52 +0200, Jarkko Sakkinen wrote: > On Wed, Feb 08, 2017 at 01:07:08PM +0200, Jarkko Sakkinen wrote: > > + rc = tpm2_load_context(chip, space->session_buf, > > + &offset, &handle); > > + if (rc == -ENOENT) { > > + /* load failed, just forget session */ > > + space->session_tbl[i] = 0; > > This is my only concern in this commit. Should we also in this case > just flush the space or not? I elected not to. If the handle is flushed by an external resource manager, we get this event. If the RM and the app agreed to release the session handle, then flushing the space would be overkill because it would destroy the client session, so simply removing the handle works. If the client tries to use the session again, it gets an error and if it doesn't everything just works, which seems to be optimal. James