Received: by 10.213.65.68 with SMTP id h4csp1312051imn; Mon, 26 Mar 2018 05:15:33 -0700 (PDT) X-Google-Smtp-Source: AG47ELtY3V3Gc/3pgg4iWzelwRbkl5F9sfwajNGA4kFOL4jY5d5+XyTXkc3FQ0O+Do6mZ3+hZRKW X-Received: by 2002:a17:902:7b85:: with SMTP id w5-v6mr40642038pll.131.1522066532979; Mon, 26 Mar 2018 05:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522066532; cv=none; d=google.com; s=arc-20160816; b=tNAgeubmgeA3DJokgdn3iAE6hHAggup8+PJFs3p1OOAvomU8T7K3SjaK6HlR1ek7Xu UvjRZ7C0zmsHGNAQkEBiit3MA4s2rf9KIEjFoZnHi0yeeoFBK8xZPvMqymqYagswpD1g k5TwiZlVNPrkG/NBbx3KjRYr3nNuAM7UILE7Pvhh38/mXe11N2PmiHaKZCQTu8BP0ZUo CnxaLybeM7hR9z2rPdSqiCJEDVElbjSRTAdlSaFaush5cURKslQ6xfbJhHQwl5YsyR+g KOWeTgoFERJlewaa89R5EJIKqGVHxePXj8FTQnIjDqNwfY5vnwrQ9maefXVR3/xhdZ/J +cFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=lTmwibIetu7/YXdp3slonyggsKCCJFqqYLkhdwxrWsM=; b=xpYxOefcT+ijeQb7o2QhEMhK073Mskr38HGLV+sgjlz0NTx89+4WhpJt3PGrkLJMTl coVSv7n1j5sXYT1aGXbuJIeF77sS80F9Q9j7APv5HhudvOeaZBeUZNMagPmxwBpOA4SI ZDNL+6Ewj+OFfoQGevgZNyks7kNvpUoqPIX2zjQBuFMNFEsP9ayb9jw1waB13GpV2IaF 4XHOyqh2e17dwdDFZUKbcAoocz4EagYfDRIczrCsrTMpZc7DBs5j5t9+bH6gs7eTQbLM CvSe8jZNA43n61uj+wqLAmMLkEGVvkUbMSL+Or60wBIkgW0Z30rQj9m6z0+OBEEE4KAe Cu6w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34-v6si14765722plp.252.2018.03.26.05.15.18; Mon, 26 Mar 2018 05:15:32 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398AbeCZMOZ (ORCPT + 99 others); Mon, 26 Mar 2018 08:14:25 -0400 Received: from mga07.intel.com ([134.134.136.100]:54462 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750984AbeCZMOX (ORCPT ); Mon, 26 Mar 2018 08:14:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2018 05:14:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,364,1517904000"; d="scan'208";a="31341162" Received: from meskola-mobl3.ger.corp.intel.com (HELO localhost) ([10.249.254.165]) by fmsmga002.fm.intel.com with ESMTP; 26 Mar 2018 05:14:19 -0700 From: Jarkko Sakkinen To: linux-integrity@vger.kernel.org Cc: linux-security-module@vger.kernel.org, Jarkko Sakkinen , Jason Gunthorpe , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v4 0/4] Migrate all TPM 2.0 commands to use struct tpm_buf Date: Mon, 26 Mar 2018 15:14:02 +0300 Message-Id: <20180326121406.14548-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to make struct tpm_buf the first class object for constructing TPM commands, this patch set migrates all TPM 2.0 commands to use it. Eventually, tpm_transmit_cmd() can take simply struct tpm_buf as its argument and this interface can be exported to be used by the kernel keyring and potentially other subsystems. The ultimate goal of this work is to make constructing TPM commands inside the kernel simple and robust. v4: * Fixed invalid return value from tpm2_probe(). TPM return codes are ignored on purpose as we only care about the tag. * Removed James' fix for the self test as it was separately applied. v3: * Fixed error handling in tpm2_get_random() v2: * Fixed author information in the commit that fixes the self-test issue, removed '\n' from the log message and added the missing tested-by. (James: sincere apologies about this) * Removed the redundant "out of memory" log message from tpm2_shutdown(). * tpm_buf_destroy() was called before using the response data in tpm2_probe(). * Added missing tpm_buf_destroy() to tpm2_get_random(). Jarkko Sakkinen (4): tpm: migrate tpm2_shutdown() to use struct tpm_buf tpm: migrate tpm2_probe() to use struct tpm_buf tpm: migrate tpm2_get_tpm_pt() to use struct tpm_buf tpm: migrate tpm2_get_random() to use struct tpm_buf drivers/char/tpm/tpm.h | 19 ++-- drivers/char/tpm/tpm2-cmd.c | 242 +++++++++++++++++--------------------------- 2 files changed, 105 insertions(+), 156 deletions(-) -- 2.15.1