Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp141561imu; Thu, 8 Nov 2018 06:16:41 -0800 (PST) X-Google-Smtp-Source: AJdET5f03ytEqmVSqHsV/iI5qUg/mb+AgfJX/BSVO1ENj9m/VL2k0eEKEdqlPzpWy2gRq7t5Ye5p X-Received: by 2002:a62:3891:: with SMTP id f139-v6mr4776775pfa.196.1541686601446; Thu, 08 Nov 2018 06:16:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541686601; cv=none; d=google.com; s=arc-20160816; b=myBzeqyYHDYqq4eQVCIkEwhUjAjGEiQu0m4pwMtYA8xCfDrHkHEHs4QtmYJSuQuCzp UvbkLzbyLSjb04iYgXoz6KtgY3bz8hHp0h8/pi+upOS9qysEHfL6yrXgrBW7pLD/HxKD uGZuVmQ2c/Zh0tsIYByXvjfADHrZS4pcQqdAv/jiWO3WVQcTuuu1R9Iwyc3qieKrsXz4 9ba6+NyyfJW9AmnGafn7H0cWEeit6fmEQtdt4Vp5x46RPAMIb4tQL+8l4fTExc5rEFlV Lu851PPO76jYW/vIRU/bDreWCHsV0TvHnebzJH6PxL6CJjgqz3xrV57+XFX56yyZxE6n nHSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=II22I5p3hmRbt3+r0SBbYaCc2VWYewSLJUKx8zpmeP8=; b=OMy24XCwFZViVCFYY0MB8Zu1YETPb84xpr/6txskCTpRpHjA2Hd9bnxbrKqfMnF2T7 lpOkpw0RUwIg5MmOfjjRuEI7HoxixRrdBq3PIa4kzbmYy97SW3YzZRAIulx5c0FbteJH 94bDRMsXyIjsXBoyu++12thPrc0W0T4cCp6duwpqc2Rkyt6In6574d0einGq7pIQSMfz IcYG01BUeGyVqvWaTASXuB/6R0Y+QMmADZkfNdXhkE5SKO8EX8fuDl0SnpTWpFdVuU6R CguScrVWbtUqbmqRwMdOQpMcqn4sIsE+huiUAqFiXsmaDPudgFkwRp7jMxiRARxQLKyk xxfA== 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 a93-v6si4834003pla.226.2018.11.08.06.16.25; Thu, 08 Nov 2018 06:16:41 -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 S1727003AbeKHXvb (ORCPT + 99 others); Thu, 8 Nov 2018 18:51:31 -0500 Received: from mga01.intel.com ([192.55.52.88]:39898 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726359AbeKHXvb (ORCPT ); Thu, 8 Nov 2018 18:51:31 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Nov 2018 06:15:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,478,1534834800"; d="scan'208";a="94663665" Received: from ibanaga-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.254.75]) by FMSMGA003.fm.intel.com with ESMTP; 08 Nov 2018 06:15:44 -0800 From: Jarkko Sakkinen To: linux-integrity@vger.kernel.org Cc: linux-security-module@vger.kernel.org, James Bottomley , Tomas Winkler , Tadeusz Struk , Stefan Berger , Nayna Jain , Jarkko Sakkinen , Jason Gunthorpe , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Microchip (AT91) SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v5 00/17] Remove nested TPM operations Date: Thu, 8 Nov 2018 16:15:21 +0200 Message-Id: <20181108141541.12832-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [was Detach TPM space code out of the tpm_transmit() flow but the scope expanded a bit.] Make the changes necessary to detach TPM space code and TPM activation code out of the tpm_transmit() flow because of both of these can cause nested tpm_transmit() calls. The nesteds calls make the whole flow hard to maintain, and thus, it is better to just fix things now before this turns into a bigger mess. The commits are available in a branch called 'nested' in git://git.infradead.org/users/jjs/linux-tpmdd.git v5: * Add the missing rev's from Stefan Berger. v4: * Return 0 from pcrs_show() when tpm1_pcr_read() fails. * Fix error handling flow in tpm_try_transmit(). * Replace struct tpm_input_header and struct tpm_output_header with struct tpm_header. v3: * Encapsulate power gating code to tpm_chip_start() and tpm_chip_stop(). * Move TPM power gating code and locking to tpm_try_get_ops() and tpm_put_ops(). * Call power gating code directly in tpm_chip_register() and tpm2_del_space(). v2: * Print tpm2_commit_space() error inside tpm2_commit_space() * Error code was not printed when recv() callback failed. It is fixed in this version. * Added a patch that removes @space from tpm_transmit(). * Fixed a regression in earlier series. Forgot to amend the change from the staging area that renames NESTED to UNLOCKED in tpm2-space.c. Jarkko Sakkinen (17): tpm: use tpm_buf in tpm_transmit_cmd() as the IO parameter tpm: fix invalid return value in pubek_show() tpm: return 0 from pcrs_show() when tpm1_pcr_read() fails tpm: call tpm2_flush_space() on error in tpm_try_transmit() tpm: print tpm2_commit_space() error inside tpm2_commit_space() tpm: clean up tpm_try_transmit() error handling flow tpm: declare struct tpm_header tpm: access command header through struct in tpm_try_transmit() tpm: move tpm_validate_commmand() to tpm2-space.c tpm: encapsulate tpm_dev_transmit() tpm: move TPM space code out of tpm_transmit() tpm: remove @space from tpm_transmit() tpm: use tpm_try_get_ops() in tpm-sysfs.c. tpm: remove TPM_TRANSMIT_UNLOCKED flag tpm: introduce tpm_chip_start() and tpm_chip_stop() tpm: take TPM chip power gating out of tpm_transmit() tpm: remove @flags from tpm_transmit() drivers/char/tpm/tpm-chip.c | 105 +++++++++++- drivers/char/tpm/tpm-dev-common.c | 45 ++++- drivers/char/tpm/tpm-interface.c | 267 ++++++------------------------ drivers/char/tpm/tpm-sysfs.c | 138 +++++++++------ drivers/char/tpm/tpm.h | 64 +++---- drivers/char/tpm/tpm1-cmd.c | 28 +--- drivers/char/tpm/tpm2-cmd.c | 72 +++----- drivers/char/tpm/tpm2-space.c | 93 ++++++++--- drivers/char/tpm/tpm_i2c_atmel.c | 5 +- drivers/char/tpm/tpm_vtpm_proxy.c | 12 +- drivers/char/tpm/xen-tpmfront.c | 2 +- 11 files changed, 406 insertions(+), 425 deletions(-) -- 2.19.1