Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933901AbcDMGRB (ORCPT ); Wed, 13 Apr 2016 02:17:01 -0400 Received: from mga11.intel.com ([192.55.52.93]:45813 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933834AbcDMGRA (ORCPT ); Wed, 13 Apr 2016 02:17:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,478,1455004800"; d="scan'208";a="783827262" Date: Wed, 13 Apr 2016 09:16:51 +0300 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: Peter Huewe , Marcel Selhorst , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [PATCH] tpm: fix crash in tpm_tis deinitialization Message-ID: <20160413061651.GA6986@intel.com> References: <1460390720-9509-1-git-send-email-jarkko.sakkinen@linux.intel.com> <20160411174037.GA371@obsidianresearch.com> <20160412042627.GA6608@intel.com> <20160412172655.GA5759@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160412172655.GA5759@obsidianresearch.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 829 Lines: 25 On Tue, Apr 12, 2016 at 11:26:55AM -0600, Jason Gunthorpe wrote: > On Tue, Apr 12, 2016 at 07:26:27AM +0300, Jarkko Sakkinen wrote: > > > This needs to be after ops is fenced, something like this. > > > > I would appreciate a supporting argument. > > > > I guess the argument here is that this will prevent user space from > > issuing TPM commands after the shutdown command has been sent? > > It prevents everything including the kernel from issuing a command ^^^^^^^^^^^^^^^^^^^^ That lock is not used to exclude kernel access. Read lock is only taken for the user space device in tpm-dev.c. > after shutdown. The shutdown is sent as the last command and no other > commands can follow it. > > It doesn't make any sense to allow commands to follow shutdown. I agree with this. > Jason /Jarkko