From patchwork Sat Nov 3 17:07:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Sakkinen X-Patchwork-Id: 10666687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5677914E2 for ; Sat, 3 Nov 2018 17:08:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F3FD29FD0 for ; Sat, 3 Nov 2018 17:08:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3121B29FDE; Sat, 3 Nov 2018 17:08:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D71DB29FD0 for ; Sat, 3 Nov 2018 17:08:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727162AbeKDCUE (ORCPT ); Sat, 3 Nov 2018 22:20:04 -0400 Received: from mga09.intel.com ([134.134.136.24]:25467 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727100AbeKDCUE (ORCPT ); Sat, 3 Nov 2018 22:20:04 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Nov 2018 10:08:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,460,1534834800"; d="scan'208";a="271118484" Received: from rysgaard-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.46]) by orsmga005.jf.intel.com with ESMTP; 03 Nov 2018 10:08:08 -0700 From: Jarkko Sakkinen To: linux-integrity@vger.kernel.org Cc: linux-security-module@vger.kernel.org, James Bottomley , Tomas Winkler , Tadeusz Struk , Stefan Berger , Jarkko Sakkinen , Jason Gunthorpe , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 0/8] Detach TPM space code out of the tpm_transmit() flow Date: Sat, 3 Nov 2018 19:07:57 +0200 Message-Id: <20181103170806.12177-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Make the changes that are needed to detach TPM space code from tpm_transmit() flow so that we do no longer need nested tpm_transmit() calls. 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 (8): tpm: use tpm_buf in tpm_transmit_cmd() as the IO parameter tpm: print tpm2_commit_space() error inside tpm2_commit_space() tpm: clean up tpm_try_transmit() error handling flow 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() drivers/char/tpm/tpm-dev-common.c | 50 ++++++- drivers/char/tpm/tpm-interface.c | 240 +++++++++++------------------- drivers/char/tpm/tpm-sysfs.c | 5 +- drivers/char/tpm/tpm.h | 16 +- drivers/char/tpm/tpm1-cmd.c | 28 +--- drivers/char/tpm/tpm2-cmd.c | 39 ++--- drivers/char/tpm/tpm2-space.c | 77 +++++++--- drivers/char/tpm/tpm_vtpm_proxy.c | 3 +- 8 files changed, 220 insertions(+), 238 deletions(-)