Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7108031ybi; Thu, 13 Jun 2019 09:41:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMGSRozxz4OFvmGB4kiLxUjhiotn55SHKZPO5o+Q1Se/vVPt/knMRLw1TEIy1WZ/OcfwZW X-Received: by 2002:a17:90a:8985:: with SMTP id v5mr6413853pjn.136.1560444060537; Thu, 13 Jun 2019 09:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560444060; cv=none; d=google.com; s=arc-20160816; b=VQGNhMq/+N2YIGsOQsmT8QapIauXV/EOa/2ipc0dS849eM0kIbbKwxnvl0TnxXP2NF p6i9/hTSMFAXeCqARrBqFZtTKSZVcCfZgzajQdjtEBDjSzQ+4Pa/bFaiaa6m6AxMckrN ZqJeRrlKjnyKTuBfGz7/OGacOGTUP84AAIbU5NSszpsQRfbWfQwDg/YHdqRwHy2SK1Yk kOfutC0X3cnfGPLNW5LUNSQ7nmItNTY6DJhEPZmTM/lHctM2Z7ZdNN7V2iEFf8Lv9QIl IGxTaAePM+KEJhryGEzyCaVod1FwPxXOgP90EjfGlrEj7RaHo66VpsvTcisjjHQGH35q f8WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=qhQvElX9cqqhv1EQCDi2FsHJE3Lx6OfUHHqmZGhpaWk=; b=V7kJYN0UX48d/KIiakhJAc7hR5xIBfGHGE0A6v+BaPyrH0oyGth3Y9gkJCaLrfiHGO NwdUn+O1L34vQA7p2MYT9AVHTQDVQzC4F3qPoJzZtX1K3A0hLQwsDgBor9mGyzitp/DC h514BruBFjnh1NkRvBP5QekkvESno6jgemLDwaT+dz7Z27inJaeRe1N8cV/2FwXfuuuK A7MzEX5CYU6iXzJZOH2qpZjKwAWz9dd3fDeOTevF3HVgqXCf/HX19ClqGDaejppwTDoA UxaRrVQpxbCSCmKh7dgi1hQHSaJcsqrUgLrCAMSFjl5unsxJV5q2FyXWzeEX1QHJzuz/ gGNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=DjxNOGja; 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 k1si93147pjt.70.2019.06.13.09.40.45; Thu, 13 Jun 2019 09:41:00 -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=@yahoo.com header.s=s2048 header.b=DjxNOGja; 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 S1730797AbfFMQkk (ORCPT + 99 others); Thu, 13 Jun 2019 12:40:40 -0400 Received: from sonic314-26.consmr.mail.ne1.yahoo.com ([66.163.189.152]:37585 "EHLO sonic314-26.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392833AbfFMQkP (ORCPT ); Thu, 13 Jun 2019 12:40:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1560444014; bh=qhQvElX9cqqhv1EQCDi2FsHJE3Lx6OfUHHqmZGhpaWk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=DjxNOGjaPR+2kmCZlCsqqxEr8gtubLUhk+Hu/g4qLAoWQHApjiuNw5nzHXDvsL6Gp2v2X62Xn14cI+DvBen7JlKwGHduEMCNjKqTNFAD7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MeZHmA8 Xzz_xompaumneVVKd18xaqFBW4vO.J02We76HLrW5u6JOyZiPStcq7WVzyF9.pV6Vz0pioXH23oH Wk9aVCCYfhOQe2eILhwkwGXSRZ9yEjuTQee.N6hElIaJcnhtgeMbaYSf2gNtqViL5iYm2IWtUWAI _PA26rIgfOlWmBYcND0U6xrPoYO6didYLqwdzi72ZbD48h6cdvlnzq95DK_I64mGgsp4jbKy4rCa zHmFouLe3hzxrJ2OcmgP12mZWvDAHp9N0b2C3b1Km_KHmTsAdWG3iY5SSUK7D3wcnui.2CI0FIzl p7MKQJO9DCl1UjGuagUYpiIUpG9XsR0l8N0iMM.uikgQcSyPza2ucT7utrnGxdgxh2rm4M7Oft1B SnbzdGOCUmzaglGi32kAbcjd6yr0uOJcECCm7d7tAb.fsYnQHqCLD7Y4AmsvUplkREAKg3x3oOyA R3ZeMBwgxUcdOiyRpw4mpnapjhQqPGcU4DbLzSSqQfYCfhA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Thu, 13 Jun 2019 16:40:14 +0000 Received: from c-73-223-4-185.hsd1.ca.comcast.net (EHLO [192.168.0.103]) ([73.223.4.185]) by smtp424.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID a8206ee583332d833244e3bfe406edd8; Thu, 13 Jun 2019 16:40:11 +0000 (UTC) Subject: Re: [RFC 0/7] Introduce TEE based Trusted Keys support To: Sumit Garg , keyrings@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org Cc: jens.wiklander@linaro.org, corbet@lwn.net, dhowells@redhat.com, jejb@linux.ibm.com, jarkko.sakkinen@linux.intel.com, zohar@linux.ibm.com, jmorris@namei.org, serge@hallyn.com, ard.biesheuvel@linaro.org, daniel.thompson@linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, tee-dev@lists.linaro.org References: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> From: Casey Schaufler Openpgp: preference=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U/A3DkWCVFEA//Vu1+BckbSbJKE7Hl6WdW19BXOZ7v3jo1q6lWwcFYth esJfk3ZPPJXuBokrFH8kqnEQ9W2QgrjDX3et2WwZFLOoOCItWxT0/1QO4ikcef/E7HXQf/ij Dxf9HG2o5hOlMIAkJq/uLNMvABEBAAGJAjwEGAEIACYWIQQL720fVjJTAhDNQh44pRV8jEPI EQUCXNX0cAIbDAUJEswDAAAKCRA4pRV8jEPIEWkzEACKFUnpp+wIVHpckMfBqN8BE5dUbWJc GyQ7wXWajLtlPdw1nNw0Wrv+ob2RCT7qQlUo6GRLcvj9Fn5tR4hBvR6D3m8aR0AGHbcC62cq I7LjaSDP5j/em4oVL2SMgNTrXgE2w33JMGjAx9oBzkxmKUqprhJomPwmfDHMJ0t7y39Da724 oLPTkQDpJL1kuraM9TC5NyLe1+MyIxqM/8NujoJbWeQUgGjn9uxQAil7o/xSCjrWCP3kZDID vd5ZaHpdl8e1mTExQoKr4EWgaMjmD/a3hZ/j3KfTVNpM2cLfD/QwTMaC2fkK8ExMsz+rUl1H icmcmpptCwOSgwSpPY1Zfio6HvEJp7gmDwMgozMfwQuT9oxyFTxn1X3rn1IoYQF3P8gsziY5 qtTxy2RrgqQFm/hr8gM78RhP54UPltIE96VywviFzDZehMvuwzW//fxysIoK97Y/KBZZOQs+ /T+Bw80Pwk/dqQ8UmIt2ffHEgwCTbkSm711BejapWCfklxkMZDp16mkxSt2qZovboVjXnfuq wQ1QL4o4t1hviM7LyoflsCLnQFJh6RSBhBpKQinMJl/z0A6NYDkQi6vEGMDBWX/M2vk9Jvwa v0cEBfY3Z5oFgkh7BUORsu1V+Hn0fR/Lqq/Pyq+nTR26WzGDkolLsDr3IH0TiAVH5ZuPxyz6 abzjfg== Message-ID: Date: Thu, 13 Jun 2019 09:40:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/13/2019 3:30 AM, Sumit Garg wrote: > Add support for TEE based trusted keys where TEE provides the functionality > to seal and unseal trusted keys using hardware unique key. Also, this is > an alternative in case platform doesn't possess a TPM device. > > This series also adds some TEE features like: Please expand the acronym TEE on first use. That will help people who don't work with it on a daily basis understand what you're going on about. > > Patch #1, #2 enables support for registered kernel shared memory with TEE. > > Patch #3 enables support for private kernel login method required for > cases like trusted keys where we don't wan't user-space to directly access > TEE service to retrieve trusted key contents. > > Rest of the patches from #4 to #7 adds support for TEE based trusted keys. > > This patch-set has been tested with OP-TEE based pseudo TA which can be > found here [1]. > > Looking forward to your valuable feedback/suggestions. > > [1] https://github.com/OP-TEE/optee_os/pull/3082 > > Sumit Garg (7): > tee: optee: allow kernel pages to register as shm > tee: enable support to register kernel memory > tee: add private login method for kernel clients > KEYS: trusted: Introduce TEE based Trusted Keys > KEYS: encrypted: Allow TEE based trusted master keys > doc: keys: Document usage of TEE based Trusted Keys > MAINTAINERS: Add entry for TEE based Trusted Keys > > Documentation/security/keys/tee-trusted.rst | 93 +++++ > MAINTAINERS | 9 + > drivers/tee/optee/call.c | 7 + > drivers/tee/tee_core.c | 6 + > drivers/tee/tee_shm.c | 16 +- > include/keys/tee_trusted.h | 84 ++++ > include/keys/trusted-type.h | 1 + > include/linux/tee_drv.h | 1 + > include/uapi/linux/tee.h | 2 + > security/keys/Kconfig | 3 + > security/keys/Makefile | 3 + > security/keys/encrypted-keys/masterkey_trusted.c | 10 +- > security/keys/tee_trusted.c | 506 +++++++++++++++++++++++ > 13 files changed, 737 insertions(+), 4 deletions(-) > create mode 100644 Documentation/security/keys/tee-trusted.rst > create mode 100644 include/keys/tee_trusted.h > create mode 100644 security/keys/tee_trusted.c >