Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759441AbcDMG61 (ORCPT ); Wed, 13 Apr 2016 02:58:27 -0400 Received: from mga01.intel.com ([192.55.52.88]:2463 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759227AbcDMG60 (ORCPT ); Wed, 13 Apr 2016 02:58:26 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,478,1455004800"; d="scan'208";a="84196611" Date: Wed, 13 Apr 2016 09:58:05 +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: <20160413065805.GB6986@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> <20160413061651.GA6986@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160413061651.GA6986@intel.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: 814 Lines: 21 On Wed, Apr 13, 2016 at 09:16:51AM +0300, Jarkko Sakkinen wrote: > 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. My bad. For the in-kernel API it is taken through tpm_find_get(). I'll update the fix. /Jarkko