Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp961190ybl; Wed, 11 Dec 2019 10:11:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyAf2xRJXvk7/m/BVJra6ms9zWSDsKLLfTOCVz3cMX46HuRFdu+GKrkBPdK/YcRdmEjm0eS X-Received: by 2002:a05:6830:1e75:: with SMTP id m21mr3181187otr.36.1576087891147; Wed, 11 Dec 2019 10:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576087891; cv=none; d=google.com; s=arc-20160816; b=NRM4TWwXKslUzVlMLZ4e+ZmtDICZLa0d3QpcGxi/+GNRwzOxAB0fvwJ/ZUwT8rC6yF 9/LmoRhqGoLJRdM5RRiZUXY2M9WGahn/0hgn5IyDw8JZ7G2mbvDEfo0kaDSUjA6rDemj ZLRc7Kj6E6iaqpOg07uE91StEu7MaVgnTJIql8WhOxBATmfxRjAbvUR9nwCcz9NVF3am CEnFdKGR6MrFQaJRTeC0mr9InG0oEospkJTEdx8Pug7zTo/7oltFbzNbjwuXiJozApD8 cNuJMWEv/gFfv3juvI3Ss/kbZ7ugIoipzZSbG4ADutsIskMOby/QZLWj43b7/HFuwOaR Mc9w== 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=KW/n8xTbhr/uFO5skweMBNHIAFzcK/aNLxTcOLSo9P8=; b=O5sSuzg0b+dp0xQ4REMLTYIatEkSX2i5wX6+R3LTZsL1rxiP6dFQ6VsYolL8asKUWv 0j1hvdFVdYivcbhEbMt5inphmSFH0egALmDaUZvrwPOfdZPnJvSyRXWMB8m3HlIeY1Bp c56yl2loXQ3Wa1UuO2jX2SiJZpTKv/k0U2+D2+0623uBrcyRj3KS5Cm9LFA4H8KSqrFh pRumwqXACVbT8hvahDPGTVEJFl+Y9abECwbBSHFqhIp25rb0NAJtylay1Xuikkt8M+VA XZqN36d2GkF2RrK1SXSyXKuC9mPBCJ6+5Gx/b4kpJcmBm+GhO9lbIY+g0PSZVaWaJvB9 ZuIw== 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 65si1511665otw.204.2019.12.11.10.11.18; Wed, 11 Dec 2019 10:11:31 -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 S1731135AbfLKSKe (ORCPT + 99 others); Wed, 11 Dec 2019 13:10:34 -0500 Received: from mga14.intel.com ([192.55.52.115]:29866 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbfLKSKc (ORCPT ); Wed, 11 Dec 2019 13:10:32 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2019 09:52:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,302,1571727600"; d="scan'208";a="238636752" Received: from cmclough-mobl.ger.corp.intel.com (HELO localhost) ([10.251.85.152]) by fmsmga004.fm.intel.com with ESMTP; 11 Dec 2019 09:52:04 -0800 Date: Wed, 11 Dec 2019 19:52:02 +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: <20191211175119.GI4516@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. This commit message is nonsense ATM. The code leaves locks held, which is unacceptable. Silencing warnings is worst possible rationale for a code change that I can think of starting from the fact that is straight out wrong and malicious. /Jarkko