Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp937228ybl; Wed, 11 Dec 2019 09:48:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwRUfUsMQfuDo9ikKqYoRcYmvWtGTxMrPV2BPVHbPi/Ob7bJRQMSBwqYkoqSvlYspZsLjmY X-Received: by 2002:a9d:5550:: with SMTP id h16mr2939111oti.235.1576086489160; Wed, 11 Dec 2019 09:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576086489; cv=none; d=google.com; s=arc-20160816; b=kHmGrsq13JTM13qRcX66C3spKaFVLiAQQ2LM/38ofZOPuXT2dyuZaf4q9weJ/PbrA4 KjrPqL/EyK4yXQvuwILs+iS7ZEVYHhvIuJxFzoHX+NKY+6eYanJ0FEmhIGEkmPvJ4bd0 4mgmmYzcy4O/ZIfOuRkrFZL3fzTLVzQmcFAPEDyBc1ohJdQVIiYAB9TmCsxWMcxA7ruW lIaKXr1B6aOUSdGDYas/ZIuhv2AY5j4Kn/dBZDXaYmtJhgok07CUazzc9Xsn5PxtnPL0 BEDndpvvlTaQpgiLRNBRgU87GahsUmr9fkHWDYkTsbUdxB7B1fF4+Gpooh3hnKBDfGp+ GerA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4Onq2acaGMhAPo1gwQXOFUhzufO5PLlV3K+Uq6vU8xQ=; b=a14118hq+RAOeMKpgV8rv/tPtWp20A29P7n96+LCE7nuH/gzLdOBwu6p1id1iq4RCY GLRE0IYzVGc8XqVKQRDMCLHKpanpw3LvQeYcfQFCKExIbpUoeGH3s7KaTtvChxaprsoY wxoTarxHywcmfnWGK7Y4LZV18BdQaMOemGWO2drCVeTYB7NSsoMBBQ1N5rGDi1wjOuq4 MN7z5XqBVIGTbwW2K578CA1JBSCmW4eNCgQ9lLCavhvGlZMeIikxTSxLEZCfMFXaF6st doVolrZ1tPc6bGpLpRdGBbXtve5VzOzeP7rNDXd9qzSajt6zuZE9vKAWC3Go+63u/WNm +vNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si1520986oif.92.2019.12.11.09.47.56; Wed, 11 Dec 2019 09:48:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729524AbfLKRrK (ORCPT + 99 others); Wed, 11 Dec 2019 12:47:10 -0500 Received: from mga17.intel.com ([192.55.52.151]:46279 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729912AbfLKRrI (ORCPT ); Wed, 11 Dec 2019 12:47:08 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2019 09:47:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,302,1571727600"; d="scan'208";a="225614790" Received: from cmclough-mobl.ger.corp.intel.com (HELO localhost) ([10.251.85.152]) by orsmga002.jf.intel.com with ESMTP; 11 Dec 2019 09:47:02 -0800 Date: Wed, 11 Dec 2019 19:47:01 +0200 From: Jarkko Sakkinen To: Tadeusz Struk Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, jgg@ziepe.ca, mingo@redhat.com, jeffrin@rajagiritech.edu.in, linux-integrity@vger.kernel.org, will@kernel.org, peterhuewe@gmx.de Subject: Re: [PATCH] tpm: fix WARNING: lock held when returning to user space Message-ID: <20191211174639.GH4516@linux.intel.com> References: <34e5340f-de75-f20e-7898-6142eac45c13@intel.com> <157601267151.12904.7408818232910113434.stgit@tstruk-mobl1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <157601267151.12904.7408818232910113434.stgit@tstruk-mobl1> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 10, 2019 at 01:17:51PM -0800, Tadeusz Struk wrote: > When an application sends TPM commands in NONBLOCKING mode > the driver holds chip->tpm_mutex returning from write(), > which triggers WARNING: lock held when returning to user space! > To silence this warning the driver needs to release the mutex > and acquire it again in tpm_dev_async_work() before sending > the command. > > Cc: stable@vger.kernel.org > Fixes: 9e1b74a63f776 (tpm: add support for nonblocking operation) > Signed-off-by: Tadeusz Struk Bundle the patch and test into same patch set (no need for cover letter) in the case we need to iterate (as they must be in sync anyway). /Jarkko