From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH] tpm: fix crash in tpm_tis deinitialization Date: Wed, 13 Apr 2016 11:04:26 -0600 Message-ID: <20160413170426.GA28411@obsidianresearch.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> <20160413065805.GB6986@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20160413065805.GB6986-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jarkko Sakkinen Cc: "moderated list:TPM DEVICE DRIVER" , open list List-Id: tpmdd-devel@lists.sourceforge.net On Wed, Apr 13, 2016 at 09:58:05AM +0300, Jarkko Sakkinen wrote: > > > 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(). Right. At this point any thing that can run in-kernel concurrently with the write exclusion is a kernel bug. Those places will need to grab the read side of the lock. Jason ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbcDMREp (ORCPT ); Wed, 13 Apr 2016 13:04:45 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:56097 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752033AbcDMREo (ORCPT ); Wed, 13 Apr 2016 13:04:44 -0400 Date: Wed, 13 Apr 2016 11:04:26 -0600 From: Jason Gunthorpe To: Jarkko Sakkinen Cc: Peter Huewe , Marcel Selhorst , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [PATCH] tpm: fix crash in tpm_tis deinitialization Message-ID: <20160413170426.GA28411@obsidianresearch.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> <20160413065805.GB6986@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160413065805.GB6986@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.160 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 13, 2016 at 09:58:05AM +0300, Jarkko Sakkinen wrote: > > > 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(). Right. At this point any thing that can run in-kernel concurrently with the write exclusion is a kernel bug. Those places will need to grab the read side of the lock. Jason