From patchwork Tue Aug 6 13:37:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 170667 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp5722247ile; Tue, 6 Aug 2019 06:38:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxd4AcZyUDEMCRV/GdU8I4s+qhcyDdupaAzIRbI6wOuTiQvF1YyojKRRkNxLBjYd/4uHb7/ X-Received: by 2002:a63:2043:: with SMTP id r3mr3115673pgm.311.1565098711091; Tue, 06 Aug 2019 06:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565098711; cv=none; d=google.com; s=arc-20160816; b=SLxJToeA1PYUv8pD9kO0SA7aLyg1pnJOWyaRcMsxd+V32QzjzE7VTiovpb9Ik7T/xc gQ7XFJq7lTcyX4JzeOP+OADZYicRIgORfdQv5p0w7l4bhaQQLnfU2jI9++xLs2TUCEWa zvKdLhqkIw5/Iah5Xi2/QgA0MSa85EiEAofkwAu0e1DAYW8hdwkfNZIVq5Ej9ev9R6Or 878xnW96Sa5AWbFahVV+ONLE5gT94K2fksa20X0xoGA5iRzY1TkNQpIb5xSPCU339hDe UQFpnvNQ2eMOILTZYauCoy/9CiddwJh/kK8cElpKlL0w0adhrLGh32xMqWJShXAVFnq3 zICg== 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 :dkim-signature; bh=r40JvNtQzAmBXDCDF67wHN0+Oy3VvJDZYkpPqIGDFuQ=; b=ujWfpz8QbzPwVTo8lAZaUtmoB8gTU6eUtCZHYmZbVooB0Ju1ucg4dXNY+ZjGOueay6 jFtvKSmTF/Pp3daB9x1iCxIfWmyCqdGKqhIRQiBHu0tu2CSGEirIwSYL4u9+fi2p5qda nK8jcv4Yobw72oaabF1CNLYswXFn0ZezN8OX61aBjTx0XB949LNoDN66KCemMrQjKcU3 S8rQuPNMNrut9YzlNuHhpMx8w3Rj7EtqOy9S+y1KVF4XepyCqCkXZeMIA4exrJcTXgQ4 oBfVKn2kxAuOe5gO8txLv7nVwJ8gAxudUXqltcvjVjV32sjicki7+A7u073J6NcGKr6n Yozw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KBoVwZ04; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si14580442pjt.94.2019.08.06.06.38.30; Tue, 06 Aug 2019 06:38:31 -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; dkim=pass header.i=@linaro.org header.s=google header.b=KBoVwZ04; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731482AbfHFNi3 (ORCPT + 29 others); Tue, 6 Aug 2019 09:38:29 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35940 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbfHFNi2 (ORCPT ); Tue, 6 Aug 2019 09:38:28 -0400 Received: by mail-pf1-f196.google.com with SMTP id r7so41537528pfl.3 for ; Tue, 06 Aug 2019 06:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=r40JvNtQzAmBXDCDF67wHN0+Oy3VvJDZYkpPqIGDFuQ=; b=KBoVwZ04PhncET1tWdYPpy444Jn3q6H7B+LLVxKtCSaYCPfXuKaJl3qTHomWuNvfJf 4HhcU4vXAHz2cvXQl1j9itwqkUs69tQ5XtwKdJED34MhYZpdCals14n3uLdK5THxOXkW ACLhMWK182v4ZjR+wB0hKCQTYDwj8+tcK1hyNY9kj0e15uSy6Iq9BEc4hxBvbpEZTTzb Pk+YFPXEwoCl9xMngBXWhcehIdavfU97xnV7tMjgTUQ+La9B8gq3QWO3SBtMJ13Iu0Za bBG6ui8OGzWAV2/5i5NyonudDtwjmo0nbBOUFAz9z+jZ61HbkHFpNA98P1Top/Wpfk+D /jrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=r40JvNtQzAmBXDCDF67wHN0+Oy3VvJDZYkpPqIGDFuQ=; b=Y9oinqzU3PgoRT+SgZGqFnsWo+D5eIhukYu3JmxA9f3Nj7mi5ux1QXn8ZgGjdz9k8H 9NSxsyN7RKFPDS6kVkrcIli5r4Akkiy/fdSM8LrKZ8IxkOiUv5P52yrQ0/9FcKpVL5M8 WuC2TvHnUjl5vmBLTDDjP/ArQa8biZvUpn8G0OYIvpxvLlA76K2f3973GG8mA9f6A5Is QO9MSkPr1k87s9IeJoGqtWzXJxXhChvPFZ+GMBYBlA7yxtKDOIvuTDPBtgDxX55oFZB2 T0lGSQ2MtHc4JHC50bgDhajBjYzxW3t5HbNVWps/vknzf3SBCW44PYFmxEqS0mOwxXGO BTUg== X-Gm-Message-State: APjAAAUrXiIR1ukzBpJwntp0c+BTDV90laKQePGF9nOz5bIw4qMJ4arb isMOZoLOQ/zkN4Vd5FjPzeZdLA== X-Received: by 2002:a63:1b66:: with SMTP id b38mr3145892pgm.54.1565098707997; Tue, 06 Aug 2019 06:38:27 -0700 (PDT) Received: from localhost.localdomain ([45.114.72.197]) by smtp.gmail.com with ESMTPSA id l4sm89183984pff.50.2019.08.06.06.38.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Aug 2019 06:38:27 -0700 (PDT) From: Sumit Garg To: keyrings@vger.kernel.org, linux-integrity@vger.kernel.org, linux-crypto@vger.kernel.org, linux-security-module@vger.kernel.org Cc: dhowells@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, peterhuewe@gmx.de, jgg@ziepe.ca, jejb@linux.ibm.com, jarkko.sakkinen@linux.intel.com, arnd@arndb.de, gregkh@linuxfoundation.org, zohar@linux.ibm.com, jmorris@namei.org, serge@hallyn.com, casey@schaufler-ca.com, ard.biesheuvel@linaro.org, daniel.thompson@linaro.org, linux-kernel@vger.kernel.org, tee-dev@lists.linaro.org, Sumit Garg Subject: [RFC/RFT v3 0/3] KEYS: trusted: Add generic trusted keys framework Date: Tue, 6 Aug 2019 19:07:17 +0530 Message-Id: <1565098640-12536-1-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch-set is an outcome of discussion here [1]. I have tested this framework with trusted keys support provided via TEE but I wasn't able to test it with a TPM device as I don't possess one. It would be really helpful if others could test this patch-set using a TPM device. [1] https://www.mail-archive.com/linux-doc@vger.kernel.org/msg30591.html Changes in v3: Move TPM2 trusted keys code to trusted keys subsystem. Changes in v2: Split trusted keys abstraction patch for ease of review. Sumit Garg (3): KEYS: trusted: create trusted keys subsystem KEYS: trusted: move tpm2 trusted keys code KEYS: trusted: Add generic trusted keys framework crypto/asymmetric_keys/asym_tpm.c | 2 +- drivers/char/tpm/tpm-interface.c | 56 --- drivers/char/tpm/tpm.h | 224 ------------ drivers/char/tpm/tpm2-cmd.c | 307 ----------------- include/keys/trusted-type.h | 45 +++ include/keys/{trusted.h => trusted_tpm.h} | 42 +-- include/linux/tpm.h | 264 +++++++++++++- security/keys/Makefile | 2 +- security/keys/trusted-keys/Makefile | 8 + .../keys/{trusted.c => trusted-keys/trusted-tpm.c} | 363 ++++---------------- security/keys/trusted-keys/trusted-tpm2.c | 378 +++++++++++++++++++++ security/keys/trusted-keys/trusted.c | 343 +++++++++++++++++++ 12 files changed, 1109 insertions(+), 925 deletions(-) rename include/keys/{trusted.h => trusted_tpm.h} (72%) create mode 100644 security/keys/trusted-keys/Makefile rename security/keys/{trusted.c => trusted-keys/trusted-tpm.c} (76%) create mode 100644 security/keys/trusted-keys/trusted-tpm2.c create mode 100644 security/keys/trusted-keys/trusted.c -- 2.7.4