From patchwork Thu Jun 13 10:30:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 10992375 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 4252F13AD for ; Thu, 13 Jun 2019 15:35:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 318D421FAC for ; Thu, 13 Jun 2019 15:35:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25FE52228E; Thu, 13 Jun 2019 15:35:04 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI autolearn=ham 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 C57122239C for ; Thu, 13 Jun 2019 15:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727010AbfFMPfC (ORCPT ); Thu, 13 Jun 2019 11:35:02 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:35872 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727973AbfFMKbg (ORCPT ); Thu, 13 Jun 2019 06:31:36 -0400 Received: by mail-pl1-f194.google.com with SMTP id d21so7957481plr.3 for ; Thu, 13 Jun 2019 03:31:35 -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:in-reply-to:references; bh=zNYSDlioe1/7qDzUymWdeZ+QFAflos+mlnY8eEGg+0o=; b=yGqrc+PyiSy4n5qr9NdwCtvk10NU0RuIEZpKtR38SSnXyuNE9KtNc4LOsjqZwwRHrh PQjFPkSB3hzxovhRjl67Bjzjq+MyaDq8caifL9XcLBUffnDo6fKiNVZJMaRJqYYrTpLD 236tIR/c1HHyhBzC+DbYQbzknd6nXkp2yR69CfUSomWNfHZq7zDwLo6CtP6Rcz9jQoyU t+UUwCGOlMlfHHdRXEbat32VLMC64YiRRvC+ES6Lwz/POGU5yfdzTRVFTEJkScAUUYU3 CLOA6wc/os0XTJLHRiURlUUYawm0WGmE6fu8bzeXwSSiF2jgcH82LXA8DmqI9CW5kKWM JwmA== 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:in-reply-to :references; bh=zNYSDlioe1/7qDzUymWdeZ+QFAflos+mlnY8eEGg+0o=; b=LVH5EU1btAPlaZO1jIZTWBr1t0W5wIi8VMCGfjBSg/KJaFnpw0K0dR2a2rcS278/JC XYjgNqu3fUb9SYwUYavLkQ/3Z9kWaka+raL7jLEUvEsZLQydojSedN6lQHYbyAmuho4/ PHgSWcTDk5DlU0UpXodnBvJrW4wBZVZhCXuWf+gLmRH3XWTH15v7QTHsqW/SGydB+vwT J0NgSrVdTkfwGMqKicvCQE2L8Q3qZuIWEcqNeq26anUsTo2iR2TNYYe5wvuyFpQCjOWj 4nM5nK53ZE15mSMZeWnl9ps9nMN9uR2dsJ6vU2Fkegd2KNuqTfVHq7Z/49NHNxGgokjT 5zlw== X-Gm-Message-State: APjAAAWaQ3bemm2BVDoS/vsyy+T660HV3IMnrbSOxqvEXM4O1uk/oHH3 /z9b3DtDxXXlZzi7GjswMB678w== X-Google-Smtp-Source: APXvYqy4QNXOS9+usIQOYreRnBfssjCFTNyHTKoO86Zu6g/HvXHvK12eofupFfZNMLkwbIdNB6kb7A== X-Received: by 2002:a17:902:1e6:: with SMTP id b93mr43575179plb.295.1560421895353; Thu, 13 Jun 2019 03:31:35 -0700 (PDT) Received: from localhost.localdomain ([117.196.234.139]) by smtp.gmail.com with ESMTPSA id a12sm2265078pgq.0.2019.06.13.03.31.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Jun 2019 03:31:34 -0700 (PDT) From: Sumit Garg To: 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, Sumit Garg Subject: [RFC 1/7] tee: optee: allow kernel pages to register as shm Date: Thu, 13 Jun 2019 16:00:27 +0530 Message-Id: <1560421833-27414-2-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> References: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Kernel pages are marked as normal type memory only so allow kernel pages to be registered as shared memory with OP-TEE. Signed-off-by: Sumit Garg Reviewed-by: Jens Wiklander --- drivers/tee/optee/call.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c index aa94270..bce45b1 100644 --- a/drivers/tee/optee/call.c +++ b/drivers/tee/optee/call.c @@ -553,6 +553,13 @@ static int check_mem_type(unsigned long start, size_t num_pages) struct mm_struct *mm = current->mm; int rc; + /* + * Allow kernel address to register with OP-TEE as kernel + * pages are configured as normal memory only. + */ + if (virt_addr_valid(start)) + return 0; + down_read(&mm->mmap_sem); rc = __check_mem_type(find_vma(mm, start), start + num_pages * PAGE_SIZE); From patchwork Thu Jun 13 10:30:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 10992373 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 71A4415E6 for ; Thu, 13 Jun 2019 15:34:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6334F2237D for ; Thu, 13 Jun 2019 15:34:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5765C223A1; Thu, 13 Jun 2019 15:34:53 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 CE7EC2239C for ; Thu, 13 Jun 2019 15:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbfFMPew (ORCPT ); Thu, 13 Jun 2019 11:34:52 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:45888 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728025AbfFMKbs (ORCPT ); Thu, 13 Jun 2019 06:31:48 -0400 Received: by mail-pf1-f194.google.com with SMTP id r1so12271pfq.12 for ; Thu, 13 Jun 2019 03:31:48 -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:in-reply-to:references; bh=X1ybKF8wUkHdnaXcEVMx2e6e4CdYBWVAzo6oWbimFYQ=; b=qQC72JqyNS5M5jXNAY8R3qU0KXWZM5lNzLTY1x45KapGIu5nY1kzXvtp8ytpYYAhNe VgEDc2Xb0TO9QjIR1scrGcXdU1EZBuzhgCjzfe7X1+jpmGG6K1x+Pf/9uqbgffhKrmNG wAPT1c1JfaM31idoL06nNamvN48hNPdql4a3HXfHAOdWsQOsfRkD3H3nKJpZB6TPX0ee lVLcpBU+49fTw+3zzRIdis+1cNwUKR2A2T/WWhA/MY121JqRxbEReGNv2toR6GuMHHgy yiSnAlAD6mp1f8mPJKrUvuiGbO6NmXN56mS8pPbZRAPe4I32m2XLpwja0iWkRglQCnZf F3Uw== 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:in-reply-to :references; bh=X1ybKF8wUkHdnaXcEVMx2e6e4CdYBWVAzo6oWbimFYQ=; b=JqWbapfQzMXALpF8uqw6HgbxyQE7e3L9l+R8kALCwspC9lRDGYvJSnEwDkoLUegtaV SCOWi7PIUTj2c1Ubi25dp6a9qiIAXoRIFLtV6mH6n/s1IrF+x3vyeunR8uerTXyWQBrE H4qnWJQLFJYxFTvCxHqr6HlbMDdWCqg0XDMWnw8dPpEtqRX0Id0efSwBJMDu7g69aRvf 2hjwiVuHawzD7UEm8VHmpUzENw0uJqsl3Zy+JQDXr1HR4PvUZelEqst/3LkkNYOXfhi0 dtTY0ydDCG4hpPoLQ9jCgZkn8bwuPhQuiLBIpR5FoR4+mAxIEtFRgjzwaV3NMrZ/bhQ5 rcgQ== X-Gm-Message-State: APjAAAX+p/HriTmf1i7iWNzLLjS+yAE06/yXcdYIk8qM2V38ifHKMNdm P+CEbyJlsLJHIXAgIGrLaZcvvw== X-Google-Smtp-Source: APXvYqw0m+SBvdVQmbAIqGHxz8wWKmEDiAXyPgV/c4Ovyt4Pnd4N4physSGHsq7lD1C9XamuJuH9gA== X-Received: by 2002:a63:e24:: with SMTP id d36mr29935015pgl.80.1560421908050; Thu, 13 Jun 2019 03:31:48 -0700 (PDT) Received: from localhost.localdomain ([117.196.234.139]) by smtp.gmail.com with ESMTPSA id a12sm2265078pgq.0.2019.06.13.03.31.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Jun 2019 03:31:47 -0700 (PDT) From: Sumit Garg To: 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, Sumit Garg Subject: [RFC 2/7] tee: enable support to register kernel memory Date: Thu, 13 Jun 2019 16:00:28 +0530 Message-Id: <1560421833-27414-3-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> References: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Enable support to register kernel memory reference with TEE. This change will allow TEE bus drivers to register memory references. Signed-off-by: Sumit Garg Reviewed-by: Jens Wiklander --- drivers/tee/tee_shm.c | 16 ++++++++++++++-- include/linux/tee_drv.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c index 2da026f..5c69b89 100644 --- a/drivers/tee/tee_shm.c +++ b/drivers/tee/tee_shm.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "tee_private.h" static void tee_shm_release(struct tee_shm *shm) @@ -224,13 +225,14 @@ struct tee_shm *tee_shm_register(struct tee_context *ctx, unsigned long addr, { struct tee_device *teedev = ctx->teedev; const u32 req_flags = TEE_SHM_DMA_BUF | TEE_SHM_USER_MAPPED; + const u32 req_ker_flags = TEE_SHM_DMA_BUF | TEE_SHM_KERNEL_MAPPED; struct tee_shm *shm; void *ret; int rc; int num_pages; unsigned long start; - if (flags != req_flags) + if (flags != req_flags && flags != req_ker_flags) return ERR_PTR(-ENOTSUPP); if (!tee_device_get(teedev)) @@ -264,7 +266,17 @@ struct tee_shm *tee_shm_register(struct tee_context *ctx, unsigned long addr, goto err; } - rc = get_user_pages_fast(start, num_pages, FOLL_WRITE, shm->pages); + if (flags & TEE_SHM_USER_MAPPED) { + rc = get_user_pages_fast(start, num_pages, FOLL_WRITE, + shm->pages); + } else { + const struct kvec kiov = { + .iov_base = (void *)start, + .iov_len = PAGE_SIZE + }; + + rc = get_kernel_pages(&kiov, num_pages, 0, shm->pages); + } if (rc > 0) shm->num_pages = rc; if (rc != num_pages) { diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index 7a03f68..dedf8fa 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -26,6 +26,7 @@ #define TEE_SHM_REGISTER BIT(3) /* Memory registered in secure world */ #define TEE_SHM_USER_MAPPED BIT(4) /* Memory mapped in user space */ #define TEE_SHM_POOL BIT(5) /* Memory allocated from pool */ +#define TEE_SHM_KERNEL_MAPPED BIT(6) /* Memory mapped in kernel space */ struct device; struct tee_device; From patchwork Thu Jun 13 10:30:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 10992369 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 635D61515 for ; Thu, 13 Jun 2019 15:34:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5430B20243 for ; Thu, 13 Jun 2019 15:34:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47EF1212DA; Thu, 13 Jun 2019 15:34:48 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 5144F22701 for ; Thu, 13 Jun 2019 15:34:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727146AbfFMPeq (ORCPT ); Thu, 13 Jun 2019 11:34:46 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34591 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728069AbfFMKcB (ORCPT ); Thu, 13 Jun 2019 06:32:01 -0400 Received: by mail-pf1-f194.google.com with SMTP id c85so11584566pfc.1 for ; Thu, 13 Jun 2019 03:32:00 -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:in-reply-to:references; bh=TYugXC8ytxOCfgDh3mg7Chcw/fQ6qx25pA1xGAB2wEo=; b=om1b7q3qqqL3hVwwom76w942uIQ0/B4EPiCLfCuWVjwAg29AoGLw6WXFFUHqXBibE+ 0j0OKdm3jdlxA1D/O0QRQOpLhNv5Ogrd9JNks1szszwbDlTE8sSL+SuHA47qdtkMVcBK fh0ruIWuUdE46y+O1g9vrHQwJ2XRu4UtkLoRcxKKBfjvZ+D+584zH7JEa39p/I12YLsd c4SCaI0zDdmJTRvb82Hyib1W7COcIB0wpLY7Sh0Zb0Rch/NfitptGgRpcVvVcY2jHp4N Dv9pfi9mVEfWv5k4TDh02gX+UvZQ5e9qjmJ5q90DuaaSymHzayeEBweOhsV/SAvK222W fDOw== 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:in-reply-to :references; bh=TYugXC8ytxOCfgDh3mg7Chcw/fQ6qx25pA1xGAB2wEo=; b=MFpLm8XL1gJn3sbAZCtAjv33PRHyWE0wU4KwHrhqFjFArSA+scuYCpWTcnHye5Rt7R t4YBudAig40yns1663DurM2cx9nzuY3Q23hBKwGHsehlbMssxnP/dDhB5p7vMUn9K/9O 5GK9S/kQKvbQPdjlK0Mibak7Dv+88AUt9DaEsei/eakNDoPSxd5uXcQOzawG91BZE8S+ ofHomLc/HwxTZ+/yO4ZGeRs6Y3rnXvZm+FjB+tg843OiMOTZzeKBEdtIsUpbxOyojpdw Vb03L+oLcWVe4JGxyL2Cp10J90ZmungzzOiot71wx8Q2c2UWrETEneMOwQ/xfFxtFUO9 VbJg== X-Gm-Message-State: APjAAAVrFThlYFZMxaTxsU0F6NdLsxCUpV0MGMQd2OCFWnEhyy9zFq5N PAlqF6Vv3P3n0f9K4sL7Gfbwyg== X-Google-Smtp-Source: APXvYqxmU/pTtNFnVKD+LmruR3Lv1HQKoTORB4xR6IcJsmcwYl4ehUJoxUdXSONGKCUx4lvt1igbXQ== X-Received: by 2002:a62:1c92:: with SMTP id c140mr92232910pfc.258.1560421920566; Thu, 13 Jun 2019 03:32:00 -0700 (PDT) Received: from localhost.localdomain ([117.196.234.139]) by smtp.gmail.com with ESMTPSA id a12sm2265078pgq.0.2019.06.13.03.31.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Jun 2019 03:31:59 -0700 (PDT) From: Sumit Garg To: 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, Sumit Garg Subject: [RFC 3/7] tee: add private login method for kernel clients Date: Thu, 13 Jun 2019 16:00:29 +0530 Message-Id: <1560421833-27414-4-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> References: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP There are use-cases where user-space shouldn't be allowed to communicate directly with a TEE device which is dedicated to provide a specific service for a kernel client. So add a private login method for kernel clients and disallow user-space to open-session using this login method. Signed-off-by: Sumit Garg --- drivers/tee/tee_core.c | 6 ++++++ include/uapi/linux/tee.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 0f16d9f..4581bd1 100644 --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -334,6 +334,12 @@ static int tee_ioctl_open_session(struct tee_context *ctx, goto out; } + if (arg.clnt_login == TEE_IOCTL_LOGIN_REE_KERNEL) { + pr_err("login method not allowed for user-space client\n"); + rc = -EPERM; + goto out; + } + rc = ctx->teedev->desc->ops->open_session(ctx, &arg, params); if (rc) goto out; diff --git a/include/uapi/linux/tee.h b/include/uapi/linux/tee.h index 4b9eb06..f33c69c 100644 --- a/include/uapi/linux/tee.h +++ b/include/uapi/linux/tee.h @@ -172,6 +172,8 @@ struct tee_ioctl_buf_data { #define TEE_IOCTL_LOGIN_APPLICATION 4 #define TEE_IOCTL_LOGIN_USER_APPLICATION 5 #define TEE_IOCTL_LOGIN_GROUP_APPLICATION 6 +/* Private login method for REE kernel clients */ +#define TEE_IOCTL_LOGIN_REE_KERNEL 0x80000000 /** * struct tee_ioctl_param - parameter From patchwork Thu Jun 13 10:30:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 10992365 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 31E1C15E6 for ; Thu, 13 Jun 2019 15:34:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 212FB223B3 for ; Thu, 13 Jun 2019 15:34:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1554F2237D; Thu, 13 Jun 2019 15:34:43 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 0577E212DB for ; Thu, 13 Jun 2019 15:34:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728199AbfFMPel (ORCPT ); Thu, 13 Jun 2019 11:34:41 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:39635 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728142AbfFMKcO (ORCPT ); Thu, 13 Jun 2019 06:32:14 -0400 Received: by mail-pf1-f193.google.com with SMTP id j2so11573264pfe.6 for ; Thu, 13 Jun 2019 03:32:13 -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:in-reply-to:references; bh=eT8LPwGDFMfUyXsNtLU9GXeTPVS5UTspteAl3GI5bcc=; b=Uk1HnJFMQm0vEuFoU0TuFyKJICqg6OAyqKvR1FuNLoDQJ7CcH3m9qBwzlh1bDSxlN4 6NwuM2gdcK7DrCebzpHhWB0k1mUwjFku5qAHXQ8SBIUadNbd5ejy4SDpVHuBi0bj5GZJ 1IDfRwwWNw2EmhFYaTY3XwmEjmUCcJKjk4ay4ASmvAZA+ACPv03yFBWDvGlfYW87NtS3 0jWHDPSNUf3VHiSMcjYtoiZnETCNSeeHCARMd2/72+wo45oP8GgcBoaLGBQtgwueptrg 1WrHAlAHEcNdXmG0s11zTnFDms5XE9md4Rx4PVBHocxotwDPzQhO1JePK9bzbnBIx4lT BrMA== 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:in-reply-to :references; bh=eT8LPwGDFMfUyXsNtLU9GXeTPVS5UTspteAl3GI5bcc=; b=BYt/E3Hc1rHBFqigrRiLk3CWpsU2irmYY7ibSZBPexXNyEL9xwIu5UED4n+6zuH5JJ XCfUzClnp4wiVgts+IPYbvZgNak4zBTiMUCY6iFiblqet2puw/KaDIDftdlEAiqgIjV9 g73dVszOWOtMtoCkgnIu/Yn8fktSds0h9PjVTs1KS558SaLLnuRNt0YO8OqVRZtnFyAH G/mW4x8Z9jvqyt+F3QeAjrPKo9q3QGpIhdDqhu2JbneMRIuU76lEn8tTt/NMhyVCGbtb Ad32BwG8d859kXZ1LYdFFZLTn53udY7OC8/10cpb0qh8hS8dfdW/wNIW4p0/5Z54958Q FdoA== X-Gm-Message-State: APjAAAXKbUMj9LiyNlOgIKsTpjIlSy3477BFfe2b+mf65EbCNhurewgB 150c2nzhbG5ivqxUTnrJmech0A== X-Google-Smtp-Source: APXvYqyNLe5/Yjjt9Zs+JvcAjgm8ld8WjFxcBN0mSNyjFDGt+z+2uaxLue4qAg/3Fk+D8AmTyw5UPQ== X-Received: by 2002:a62:3287:: with SMTP id y129mr35676542pfy.251.1560421933269; Thu, 13 Jun 2019 03:32:13 -0700 (PDT) Received: from localhost.localdomain ([117.196.234.139]) by smtp.gmail.com with ESMTPSA id a12sm2265078pgq.0.2019.06.13.03.32.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Jun 2019 03:32:12 -0700 (PDT) From: Sumit Garg To: 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, Sumit Garg Subject: [RFC 4/7] KEYS: trusted: Introduce TEE based Trusted Keys Date: Thu, 13 Jun 2019 16:00:30 +0530 Message-Id: <1560421833-27414-5-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> References: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Add support for TEE based trusted keys where TEE provides the functionality to seal and unseal trusted keys using hardware unique key. Refer to Documentation/tee.txt for detailed information about TEE. Approach taken in this patch acts as an alternative to a TPM device in case platform doesn't possess one. Signed-off-by: Sumit Garg --- include/keys/tee_trusted.h | 84 ++++++++ include/keys/trusted-type.h | 1 + security/keys/Kconfig | 3 + security/keys/Makefile | 3 + security/keys/tee_trusted.c | 506 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 597 insertions(+) create mode 100644 include/keys/tee_trusted.h create mode 100644 security/keys/tee_trusted.c diff --git a/include/keys/tee_trusted.h b/include/keys/tee_trusted.h new file mode 100644 index 0000000..e5c0042 --- /dev/null +++ b/include/keys/tee_trusted.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2019 Linaro Ltd. + * + * Author: + * Sumit Garg + */ + +#ifndef __TEE_TRUSTED_KEY_H +#define __TEE_TRUSTED_KEY_H + +#include + +#define DRIVER_NAME "tee-trusted-key" + +/* + * Get random data for symmetric key + * + * [out] memref[0] Random data + * + * Result: + * TEE_SUCCESS - Invoke command success + * TEE_ERROR_BAD_PARAMETERS - Incorrect input param + */ +#define TA_CMD_GET_RANDOM 0x0 + +/* + * Seal trusted key using hardware unique key + * + * [in] memref[0] Plain key + * [out] memref[1] Sealed key datablob + * + * Result: + * TEE_SUCCESS - Invoke command success + * TEE_ERROR_BAD_PARAMETERS - Incorrect input param + */ +#define TA_CMD_SEAL 0x1 + +/* + * Unseal trusted key using hardware unique key + * + * [in] memref[0] Sealed key datablob + * [out] memref[1] Plain key + * + * Result: + * TEE_SUCCESS - Invoke command success + * TEE_ERROR_BAD_PARAMETERS - Incorrect input param + */ +#define TA_CMD_UNSEAL 0x2 + +/** + * struct trusted_key_private - TEE Trusted key private data + * @dev: TEE based Trusted key device. + * @ctx: TEE context handler. + * @session_id: Trusted key TA session identifier. + * @shm_pool: Memory pool shared with TEE device. + */ +struct trusted_key_private { + struct device *dev; + struct tee_context *ctx; + u32 session_id; + u32 data_rate; + struct tee_shm *shm_pool; +}; + +#define TEE_KEY_DEBUG 0 + +#if TEE_KEY_DEBUG +static inline void dump_tee_payload(struct trusted_key_payload *p) +{ + pr_info("trusted_key: key_len %d\n", p->key_len); + print_hex_dump(KERN_INFO, "key ", DUMP_PREFIX_NONE, + 16, 1, p->key, p->key_len, 0); + pr_info("trusted_key: bloblen %d\n", p->blob_len); + print_hex_dump(KERN_INFO, "blob ", DUMP_PREFIX_NONE, + 16, 1, p->blob, p->blob_len, 0); +} +#else +static inline void dump_tee_payload(struct trusted_key_payload *p) +{ +} +#endif + +#endif diff --git a/include/keys/trusted-type.h b/include/keys/trusted-type.h index a94c03a..363ec83 100644 --- a/include/keys/trusted-type.h +++ b/include/keys/trusted-type.h @@ -41,5 +41,6 @@ struct trusted_key_options { }; extern struct key_type key_type_trusted; +extern struct key_type key_type_tee_trusted; #endif /* _KEYS_TRUSTED_TYPE_H */ diff --git a/security/keys/Kconfig b/security/keys/Kconfig index ee502e4..b206a20 100644 --- a/security/keys/Kconfig +++ b/security/keys/Kconfig @@ -70,6 +70,9 @@ config TRUSTED_KEYS if the boot PCRs and other criteria match. Userspace will only ever see encrypted blobs. + It also provides support for alternative TEE based Trusted keys + generation and sealing in case TPM isn't present. + If you are unsure as to whether this is required, answer N. config ENCRYPTED_KEYS diff --git a/security/keys/Makefile b/security/keys/Makefile index 9cef540..07ad3e2 100644 --- a/security/keys/Makefile +++ b/security/keys/Makefile @@ -30,3 +30,6 @@ obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += keyctl_pkey.o obj-$(CONFIG_BIG_KEYS) += big_key.o obj-$(CONFIG_TRUSTED_KEYS) += trusted.o obj-$(CONFIG_ENCRYPTED_KEYS) += encrypted-keys/ +ifdef CONFIG_TEE +obj-$(CONFIG_TRUSTED_KEYS) += tee_trusted.o +endif diff --git a/security/keys/tee_trusted.c b/security/keys/tee_trusted.c new file mode 100644 index 0000000..081e45e --- /dev/null +++ b/security/keys/tee_trusted.c @@ -0,0 +1,506 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 Linaro Ltd. + * + * Author: + * Sumit Garg + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static struct trusted_key_private pvt_data; + +/* + * Have the TEE seal(encrypt) the symmetric key + */ +static int tee_key_seal(struct trusted_key_payload *p) +{ + int ret = 0; + struct tee_ioctl_invoke_arg inv_arg; + struct tee_param param[4]; + struct tee_shm *reg_shm_in = NULL, *reg_shm_out = NULL; + + memset(&inv_arg, 0, sizeof(inv_arg)); + memset(¶m, 0, sizeof(param)); + + reg_shm_in = tee_shm_register(pvt_data.ctx, (unsigned long)p->key, + p->key_len, TEE_SHM_DMA_BUF | + TEE_SHM_KERNEL_MAPPED); + if (IS_ERR(reg_shm_in)) { + dev_err(pvt_data.dev, "key shm register failed\n"); + return PTR_ERR(reg_shm_in); + } + + reg_shm_out = tee_shm_register(pvt_data.ctx, (unsigned long)p->blob, + sizeof(p->blob), TEE_SHM_DMA_BUF | + TEE_SHM_KERNEL_MAPPED); + if (IS_ERR(reg_shm_out)) { + dev_err(pvt_data.dev, "blob shm register failed\n"); + ret = PTR_ERR(reg_shm_out); + goto out; + } + + inv_arg.func = TA_CMD_SEAL; + inv_arg.session = pvt_data.session_id; + inv_arg.num_params = 4; + + param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT; + param[0].u.memref.shm = reg_shm_in; + param[0].u.memref.size = p->key_len; + param[0].u.memref.shm_offs = 0; + param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT; + param[1].u.memref.shm = reg_shm_out; + param[1].u.memref.size = sizeof(p->blob); + param[1].u.memref.shm_offs = 0; + + ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); + if ((ret < 0) || (inv_arg.ret != 0)) { + dev_err(pvt_data.dev, "TA_CMD_SEAL invoke err: %x\n", + inv_arg.ret); + ret = -EFAULT; + } else { + p->blob_len = param[1].u.memref.size; + } + +out: + if (reg_shm_out) + tee_shm_free(reg_shm_out); + if (reg_shm_in) + tee_shm_free(reg_shm_in); + + return ret; +} + +/* + * Have the TEE unseal(decrypt) the symmetric key + */ +static int tee_key_unseal(struct trusted_key_payload *p) +{ + int ret = 0; + struct tee_ioctl_invoke_arg inv_arg; + struct tee_param param[4]; + struct tee_shm *reg_shm_in = NULL, *reg_shm_out = NULL; + + memset(&inv_arg, 0, sizeof(inv_arg)); + memset(¶m, 0, sizeof(param)); + + reg_shm_in = tee_shm_register(pvt_data.ctx, (unsigned long)p->blob, + p->blob_len, TEE_SHM_DMA_BUF | + TEE_SHM_KERNEL_MAPPED); + if (IS_ERR(reg_shm_in)) { + dev_err(pvt_data.dev, "blob shm register failed\n"); + return PTR_ERR(reg_shm_in); + } + + reg_shm_out = tee_shm_register(pvt_data.ctx, (unsigned long)p->key, + sizeof(p->key), TEE_SHM_DMA_BUF | + TEE_SHM_KERNEL_MAPPED); + if (IS_ERR(reg_shm_out)) { + dev_err(pvt_data.dev, "key shm register failed\n"); + ret = PTR_ERR(reg_shm_out); + goto out; + } + + inv_arg.func = TA_CMD_UNSEAL; + inv_arg.session = pvt_data.session_id; + inv_arg.num_params = 4; + + param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT; + param[0].u.memref.shm = reg_shm_in; + param[0].u.memref.size = p->blob_len; + param[0].u.memref.shm_offs = 0; + param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT; + param[1].u.memref.shm = reg_shm_out; + param[1].u.memref.size = sizeof(p->key); + param[1].u.memref.shm_offs = 0; + + ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); + if ((ret < 0) || (inv_arg.ret != 0)) { + dev_err(pvt_data.dev, "TA_CMD_UNSEAL invoke err: %x\n", + inv_arg.ret); + ret = -EFAULT; + } else { + p->key_len = param[1].u.memref.size; + } + +out: + if (reg_shm_out) + tee_shm_free(reg_shm_out); + if (reg_shm_in) + tee_shm_free(reg_shm_in); + + return ret; +} + +/* + * Have the TEE generate random symmetric key + */ +static int tee_get_random(unsigned char *key, unsigned int key_len) +{ + int ret = 0; + struct tee_ioctl_invoke_arg inv_arg; + struct tee_param param[4]; + struct tee_shm *reg_shm = NULL; + + memset(&inv_arg, 0, sizeof(inv_arg)); + memset(¶m, 0, sizeof(param)); + + reg_shm = tee_shm_register(pvt_data.ctx, (unsigned long)key, key_len, + TEE_SHM_DMA_BUF | TEE_SHM_KERNEL_MAPPED); + if (IS_ERR(reg_shm)) { + dev_err(pvt_data.dev, "random key shm register failed\n"); + return PTR_ERR(reg_shm); + } + + inv_arg.func = TA_CMD_GET_RANDOM; + inv_arg.session = pvt_data.session_id; + inv_arg.num_params = 4; + + param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT; + param[0].u.memref.shm = reg_shm; + param[0].u.memref.size = key_len; + param[0].u.memref.shm_offs = 0; + + ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); + if ((ret < 0) || (inv_arg.ret != 0)) { + dev_err(pvt_data.dev, "TA_CMD_GET_RANDOM invoke err: %x\n", + inv_arg.ret); + ret = -EFAULT; + } else { + ret = param[0].u.memref.size; + } + + tee_shm_free(reg_shm); + + return ret; +} + +enum { + Opt_err, + Opt_new, Opt_load +}; + +static const match_table_t key_tokens = { + {Opt_new, "new"}, + {Opt_load, "load"}, + {Opt_err, NULL} +}; + +/* + * datablob_parse - parse the keyctl data and fill in the + * payload structure + * + * On success returns 0, otherwise -EINVAL. + */ +static int datablob_parse(char *datablob, struct trusted_key_payload *p) +{ + substring_t args[MAX_OPT_ARGS]; + long keylen; + int ret = -EINVAL; + int key_cmd; + char *c; + + /* main command */ + c = strsep(&datablob, " \t"); + if (!c) + return -EINVAL; + + key_cmd = match_token(c, key_tokens, args); + switch (key_cmd) { + case Opt_new: + /* first argument is key size */ + c = strsep(&datablob, " \t"); + if (!c) + return -EINVAL; + ret = kstrtol(c, 10, &keylen); + if (ret < 0 || keylen < MIN_KEY_SIZE || keylen > MAX_KEY_SIZE) + return -EINVAL; + p->key_len = keylen; + ret = Opt_new; + break; + case Opt_load: + /* first argument is sealed blob */ + c = strsep(&datablob, " \t"); + if (!c) + return -EINVAL; + p->blob_len = strlen(c) / 2; + if (p->blob_len > MAX_BLOB_SIZE) + return -EINVAL; + ret = hex2bin(p->blob, c, p->blob_len); + if (ret < 0) + return -EINVAL; + ret = Opt_load; + break; + case Opt_err: + return -EINVAL; + } + + return ret; +} + +static struct trusted_key_payload *trusted_payload_alloc(struct key *key) +{ + struct trusted_key_payload *p = NULL; + int ret; + + ret = key_payload_reserve(key, sizeof(*p)); + if (ret < 0) + return p; + + p = kzalloc(sizeof(*p), GFP_KERNEL); + + return p; +} + +/* + * trusted_instantiate - create a new trusted key + * + * Unseal an existing trusted blob or, for a new key, get a + * random key, then seal and create a trusted key-type key, + * adding it to the specified keyring. + * + * On success, return 0. Otherwise return errno. + */ +static int trusted_instantiate(struct key *key, + struct key_preparsed_payload *prep) +{ + struct trusted_key_payload *payload = NULL; + size_t datalen = prep->datalen; + char *datablob; + int ret = 0; + int key_cmd; + size_t key_len; + + if (datalen <= 0 || datalen > 32767 || !prep->data) + return -EINVAL; + + datablob = kmalloc(datalen + 1, GFP_KERNEL); + if (!datablob) + return -ENOMEM; + memcpy(datablob, prep->data, datalen); + datablob[datalen] = '\0'; + + payload = trusted_payload_alloc(key); + if (!payload) { + ret = -ENOMEM; + goto out; + } + + key_cmd = datablob_parse(datablob, payload); + if (key_cmd < 0) { + ret = key_cmd; + goto out; + } + + dump_tee_payload(payload); + + switch (key_cmd) { + case Opt_load: + ret = tee_key_unseal(payload); + dump_tee_payload(payload); + if (ret < 0) + dev_err(pvt_data.dev, "key_unseal failed (%d)\n", ret); + break; + case Opt_new: + key_len = payload->key_len; + ret = tee_get_random(payload->key, key_len); + if (ret != key_len) { + dev_err(pvt_data.dev, "key_create failed (%d)\n", ret); + goto out; + } + + ret = tee_key_seal(payload); + if (ret < 0) + dev_err(pvt_data.dev, "key_seal failed (%d)\n", ret); + dump_tee_payload(payload); + break; + default: + ret = -EINVAL; + goto out; + } +out: + kzfree(datablob); + if (!ret) + rcu_assign_keypointer(key, payload); + else + kzfree(payload); + return ret; +} + +static int trusted_update(struct key *key, struct key_preparsed_payload *prep) +{ + dev_info(pvt_data.dev, "trusted key update method not supported\n"); + + return -EINVAL; +} + +/* + * trusted_read - copy the sealed blob data to userspace in hex. + * On success, return to userspace the trusted key datablob size. + */ +static long trusted_read(const struct key *key, char __user *buffer, + size_t buflen) +{ + const struct trusted_key_payload *p; + char *ascii_buf; + char *bufp; + int i; + + p = dereference_key_locked(key); + if (!p) + return -EINVAL; + + if (buffer && buflen >= 2 * p->blob_len) { + ascii_buf = kmalloc_array(2, p->blob_len, GFP_KERNEL); + if (!ascii_buf) + return -ENOMEM; + + bufp = ascii_buf; + for (i = 0; i < p->blob_len; i++) + bufp = hex_byte_pack(bufp, p->blob[i]); + if (copy_to_user(buffer, ascii_buf, 2 * p->blob_len) != 0) { + kzfree(ascii_buf); + return -EFAULT; + } + kzfree(ascii_buf); + } + return 2 * p->blob_len; +} + +/* + * trusted_destroy - clear and free the key's payload + */ +static void trusted_destroy(struct key *key) +{ + kzfree(key->payload.data[0]); +} + +struct key_type key_type_tee_trusted = { + .name = "trusted", + .instantiate = trusted_instantiate, + .update = trusted_update, + .destroy = trusted_destroy, + .describe = user_describe, + .read = trusted_read, +}; +EXPORT_SYMBOL_GPL(key_type_tee_trusted); + +static int optee_ctx_match(struct tee_ioctl_version_data *ver, const void *data) +{ + if (ver->impl_id == TEE_IMPL_ID_OPTEE) + return 1; + else + return 0; +} + +static int trusted_key_probe(struct device *dev) +{ + struct tee_client_device *rng_device = to_tee_client_device(dev); + int ret = 0, err = -ENODEV; + struct tee_ioctl_open_session_arg sess_arg; + + memset(&sess_arg, 0, sizeof(sess_arg)); + + /* Open context with TEE driver */ + pvt_data.ctx = tee_client_open_context(NULL, optee_ctx_match, NULL, + NULL); + if (IS_ERR(pvt_data.ctx)) + return -ENODEV; + + /* Open session with hwrng Trusted App */ + memcpy(sess_arg.uuid, rng_device->id.uuid.b, TEE_IOCTL_UUID_LEN); + sess_arg.clnt_login = TEE_IOCTL_LOGIN_REE_KERNEL; + sess_arg.num_params = 0; + + ret = tee_client_open_session(pvt_data.ctx, &sess_arg, NULL); + if ((ret < 0) || (sess_arg.ret != 0)) { + dev_err(dev, "tee_client_open_session failed, err: %x\n", + sess_arg.ret); + err = -EINVAL; + goto out_ctx; + } + pvt_data.session_id = sess_arg.session; + + ret = register_key_type(&key_type_tee_trusted); + if (ret < 0) + goto out_sess; + + pvt_data.dev = dev; + + return 0; + +out_sess: + tee_client_close_session(pvt_data.ctx, pvt_data.session_id); +out_ctx: + tee_client_close_context(pvt_data.ctx); + + return err; +} + +static int trusted_key_remove(struct device *dev) +{ + unregister_key_type(&key_type_tee_trusted); + tee_client_close_session(pvt_data.ctx, pvt_data.session_id); + tee_client_close_context(pvt_data.ctx); + + return 0; +} + +static const struct tee_client_device_id trusted_key_id_table[] = { + {UUID_INIT(0xf04a0fe7, 0x1f5d, 0x4b9b, + 0xab, 0xf7, 0x61, 0x9b, 0x85, 0xb4, 0xce, 0x8c)}, + {} +}; + +MODULE_DEVICE_TABLE(tee, trusted_key_id_table); + +static struct tee_client_driver trusted_key_driver = { + .id_table = trusted_key_id_table, + .driver = { + .name = DRIVER_NAME, + .bus = &tee_bus_type, + .probe = trusted_key_probe, + .remove = trusted_key_remove, + }, +}; + +static int __init init_tee_trusted(void) +{ + struct tpm_chip *chip; + + /* + * Check for TPM availability as that is default source for trusted + * keys. If not present, then register driver for TEE based device + * providing support for trusted keys. + */ + chip = tpm_default_chip(); + if (chip) + return 0; + + return driver_register(&trusted_key_driver.driver); +} + +static void __exit cleanup_tee_trusted(void) +{ + driver_unregister(&trusted_key_driver.driver); +} + +late_initcall(init_tee_trusted); +module_exit(cleanup_tee_trusted); + +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Sumit Garg "); +MODULE_DESCRIPTION("TEE based trusted keys"); From patchwork Thu Jun 13 10:30:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 10992359 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 2F20C13AD for ; Thu, 13 Jun 2019 15:34:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BC68212DA for ; Thu, 13 Jun 2019 15:34:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1030B2239C; Thu, 13 Jun 2019 15:34:41 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI autolearn=ham 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 AE8FA223A1 for ; Thu, 13 Jun 2019 15:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728256AbfFMPek (ORCPT ); Thu, 13 Jun 2019 11:34:40 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34211 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728171AbfFMKc0 (ORCPT ); Thu, 13 Jun 2019 06:32:26 -0400 Received: by mail-pg1-f193.google.com with SMTP id p10so4864305pgn.1 for ; Thu, 13 Jun 2019 03:32:26 -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:in-reply-to:references; bh=zAP35FMwIaJoHRTsWTgqlS+4eqrXf3lXTLZsbBgKALU=; b=I8WZqaHuq/yhoMfw5I5pMLLVxm8cNFa61hNwQ8JLEMlCB8EUyJDcawmklBfvxhPYCl 5QfsPIYKqAlH9CKbXYD8qGVKPqgYgYNL5qFGx11M2gg4jknzMJ2je5vQxiIEo2GWD5G/ RxhSDlH9Q9RQ/EG0N/XQAWCefLd9GHdFP0Ho9vndyKfvJW/F0y6GH3rSRSR/oA8ric1P KaJ5iam2I3ar+sVxc5p9E9Bfv94xReZjTfPJhJnUezS8g8jb+A8kp0qWVI4luHG7wWWh PrG1F5qZGOs5QlF8Jcng3xBuK+0z2rvPRMRUkxRXs3sbtmIRmZNB6mWw8sVkKHcVmOb8 uK1g== 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:in-reply-to :references; bh=zAP35FMwIaJoHRTsWTgqlS+4eqrXf3lXTLZsbBgKALU=; b=PS54lKrB5NYV37FjwMTrVjm3jvQ1i9TgqEnxJo20i5Tf0ST3hENd12ref4/N58ZdxO 1NNoru7/JcedXJ1/Pzs5PbA0h4mrTU+b9G9ebChTwRClxCWEFDithn6sIxU1wsLIDhr2 4JMRKRlgxIKRqASYPkpQ9oUbptCRxLRiDgVe9d2E/DivmCkYSQh+9x0Pdl2P11ysyObj kSgn53W5594It8yHtpc167S2ysqtYdyxm7ilD29D2DxaalSi4KGozM6d7KI5xQBST3cG um60EFWX8WmMoUlBIY6Gg8DnetdA5Kfb2UTqcVIiTYzqExpais8pf0cUEfesne5VZcLn kzRQ== X-Gm-Message-State: APjAAAVzRQaTOto6RRz//mXkT1h974+nHT4xKtZxoeiGKC2FkQTSNjMd ISSiTlBFj/Z0Bokc7XYT710/2A== X-Google-Smtp-Source: APXvYqy9ZWJWVG2HSV4XCNQ97i8SPNUISZ00sFzqKzjXi5CJzuVmgDH7W765D0LXzkPhO24L9HPVDA== X-Received: by 2002:a17:90a:2525:: with SMTP id j34mr383810pje.11.1560421945985; Thu, 13 Jun 2019 03:32:25 -0700 (PDT) Received: from localhost.localdomain ([117.196.234.139]) by smtp.gmail.com with ESMTPSA id a12sm2265078pgq.0.2019.06.13.03.32.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Jun 2019 03:32:25 -0700 (PDT) From: Sumit Garg To: 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, Sumit Garg Subject: [RFC 5/7] KEYS: encrypted: Allow TEE based trusted master keys Date: Thu, 13 Jun 2019 16:00:31 +0530 Message-Id: <1560421833-27414-6-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> References: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Allow search for TEE based trusted keys to act as master keys in case TPM device is not present. Signed-off-by: Sumit Garg --- security/keys/encrypted-keys/masterkey_trusted.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/security/keys/encrypted-keys/masterkey_trusted.c b/security/keys/encrypted-keys/masterkey_trusted.c index c68528a..cfac27f 100644 --- a/security/keys/encrypted-keys/masterkey_trusted.c +++ b/security/keys/encrypted-keys/masterkey_trusted.c @@ -23,6 +23,9 @@ * Trusted keys are sealed to PCRs and other metadata. Although userspace * manages both trusted/encrypted key-types, like the encrypted key type * data, trusted key type data is not visible decrypted from userspace. + * + * Also, check for alternate trusted keys provided via TEE in case there + * is no TPM available. */ struct key *request_trusted_key(const char *trusted_desc, const u8 **master_key, size_t *master_keylen) @@ -31,8 +34,11 @@ struct key *request_trusted_key(const char *trusted_desc, struct key *tkey; tkey = request_key(&key_type_trusted, trusted_desc, NULL); - if (IS_ERR(tkey)) - goto error; + if (IS_ERR(tkey)) { + tkey = request_key(&key_type_tee_trusted, trusted_desc, NULL); + if (IS_ERR(tkey)) + goto error; + } down_read(&tkey->sem); tpayload = tkey->payload.data[0]; From patchwork Thu Jun 13 10:30:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 10992355 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 6D4C213AD for ; Thu, 13 Jun 2019 15:34:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C913212DB for ; Thu, 13 Jun 2019 15:34:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 506AE219AC; Thu, 13 Jun 2019 15:34:18 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI autolearn=ham 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 CA0C321FAC for ; Thu, 13 Jun 2019 15:34:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730225AbfFMPeN (ORCPT ); Thu, 13 Jun 2019 11:34:13 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38446 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728224AbfFMKcj (ORCPT ); Thu, 13 Jun 2019 06:32:39 -0400 Received: by mail-pf1-f193.google.com with SMTP id a186so11570266pfa.5 for ; Thu, 13 Jun 2019 03:32:39 -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:in-reply-to:references; bh=BG6KAi08hN8hMpB1R8APRtbarxqkieDJBwiiKnKxNvA=; b=qXrt3EVTApU5PvFn4bX//ulUNLUoEPsUKJqd/tEwgQrVBEW7kK6cIqJbHvlbz0ZwZw yXkdyYL78AAok2TZ4dUIK02ownxUUArBRRhlZFyofgOaJ5Ab0Xqmfb61n4o8y6gNLDFA 9uq1ElY6ote0C9kIBMHRPLdLqbL7XZUgXPfzQaKaRLdAe00jHCagKg7cvHL/ECbtjyr6 O5B0MYJenVXtiZPFm2DIsWKMKQpoYDyi9ooepPfnJACg1HGlqLmyY9jYOmIbj1SFpKWo dR9tq4Slzc5DwWnZCRZ6ifEeYJDQNLKZ6Ip3CeXwhTQgjdCNZQuDE2Nn0S6CbrO9y+l0 tWpA== 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:in-reply-to :references; bh=BG6KAi08hN8hMpB1R8APRtbarxqkieDJBwiiKnKxNvA=; b=FgXFhuQ4ffG9XcDuLspyP/ivrIvXE3RAU4375yZYWoPdv6uVRaDj81jZTljYQzIu5V DyD+JUyRwQtgtUBDX0J/MnLcrESzsmma/YYrdTllBtJIqFti27q6WdhFar7zg+C0RSYJ WMb7AKZITxAEoL9pZyBJJ0nsTC9bCw4g0Rm1/FAY4WYf9Gn2lB+9ywr8Vi8SCsL5CS60 Y+r5WdeDUA8tAXU+JHgfqX1cDFntwRQu7b+exPsm/QIj0JD0hAZfknkLfbRGz83db+ZB yU7P4RAIdZXaZ2M/gpYUJDiuKuELBYdc2HAfzIYn67FcOAW4SmT8QAphEQuIlHj9OweU QiWQ== X-Gm-Message-State: APjAAAX/AyHHjm0uoFlJX5P29biOpQI1lpqA4d4iQHm/VPgwZtFQPHur NhlHaoShQokQ8ZTIBcuWU2wPgw== X-Google-Smtp-Source: APXvYqwugJNID3a+Q06ltN9H4nYz1MsjaA/m5NgmF0QwxbLeIBkdJqh8Wkw1R9zzI/mvvBxALIBd2g== X-Received: by 2002:a62:ee17:: with SMTP id e23mr94599955pfi.130.1560421958641; Thu, 13 Jun 2019 03:32:38 -0700 (PDT) Received: from localhost.localdomain ([117.196.234.139]) by smtp.gmail.com with ESMTPSA id a12sm2265078pgq.0.2019.06.13.03.32.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Jun 2019 03:32:37 -0700 (PDT) From: Sumit Garg To: 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, Sumit Garg Subject: [RFC 6/7] doc: keys: Document usage of TEE based Trusted Keys Date: Thu, 13 Jun 2019 16:00:32 +0530 Message-Id: <1560421833-27414-7-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> References: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Provide documentation for usage of TEE based Trusted Keys via existing user-space "keyctl" utility. Also, document various use-cases. Signed-off-by: Sumit Garg --- Documentation/security/keys/tee-trusted.rst | 93 +++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/security/keys/tee-trusted.rst diff --git a/Documentation/security/keys/tee-trusted.rst b/Documentation/security/keys/tee-trusted.rst new file mode 100644 index 0000000..ef03745 --- /dev/null +++ b/Documentation/security/keys/tee-trusted.rst @@ -0,0 +1,93 @@ +====================== +TEE based Trusted Keys +====================== + +TEE based Trusted Keys provides an alternative approach for providing Trusted +Keys in case TPM chip isn't present. + +Trusted Keys use a TEE service/device both to generate and to seal the keys. +Keys are sealed under a hardware unique key in the TEE, and only unsealed by +the TEE. + +For more information about TEE, refer to ``Documentation/tee.txt``. + +Usage:: + + keyctl add trusted name "new keylen" ring + keyctl add trusted name "load hex_blob" ring + keyctl print keyid + +"keyctl print" returns an ascii hex copy of the sealed key, which is in format +specific to TEE device implementation. The key length for new keys are always +in bytes. Trusted Keys can be 32 - 128 bytes (256 - 1024 bits). + +Examples of trusted key and its usage as 'master' key for encrypted key usage: + +More details about encrypted keys can be found here: +``Documentation/security/keys/trusted-encrypted.rst`` + +Create and save a trusted key named "kmk" of length 32 bytes:: + + $ keyctl add trusted kmk "new 32" @u + 754414669 + + $ keyctl show + Session Keyring + 827385718 --alswrv 0 65534 keyring: _uid_ses.0 + 274124851 --alswrv 0 65534 \_ keyring: _uid.0 + 754414669 --als-rv 0 0 \_ trusted: kmk + + $ keyctl print 754414669 + 15676790697861b422175596ae001c2f505cea2c6f3ebbc5fb08eeb1f343a07e + + $ keyctl pipe 754414669 > kmk.blob + +Load a trusted key from the saved blob:: + + $ keyctl add trusted kmk "load `cat kmk.blob`" @u + 491638700 + + $ keyctl print 491638700 + 15676790697861b422175596ae001c2f505cea2c6f3ebbc5fb08eeb1f343a07e + +The initial consumer of trusted keys is EVM, which at boot time needs a high +quality symmetric key for HMAC protection of file metadata. The use of a +TEE based trusted key provides security that the EVM key has not been +compromised by a user level problem and tied to particular hardware. + +Create and save an encrypted key "evm" using the above trusted key "kmk": + +option 1: omitting 'format':: + + $ keyctl add encrypted evm "new trusted:kmk 32" @u + 608915065 + +option 2: explicitly defining 'format' as 'default':: + + $ keyctl add encrypted evm "new default trusted:kmk 32" @u + 608915065 + + $ keyctl print 608915065 + default trusted:kmk 32 f380ac588a925f488d5be007cf23e4c900b8b652ab62241c8 + ed54906189b6659d139d619d4b51752a2645537b11fd44673f13154a65b3f595d5fb2131 + 2fe45529ea0407c644ea4026f2a1a75661f2c9b66 + + $ keyctl pipe 608915065 > evm.blob + +Load an encrypted key "evm" from saved blob:: + + $ keyctl add encrypted evm "load `cat evm.blob`" @u + 831684262 + + $ keyctl print 831684262 + default trusted:kmk 32 f380ac588a925f488d5be007cf23e4c900b8b652ab62241c8 + ed54906189b6659d139d619d4b51752a2645537b11fd44673f13154a65b3f595d5fb2131 + 2fe45529ea0407c644ea4026f2a1a75661f2c9b66 + +Other uses for trusted and encrypted keys, such as for disk and file encryption +are anticipated. In particular the 'ecryptfs' encrypted keys format can be used +to mount an eCryptfs filesystem. More details about the usage can be found in +the file ``Documentation/security/keys/ecryptfs.rst``. + +Another format 'enc32' can be used to support encrypted keys with payload size +of 32 bytes. From patchwork Thu Jun 13 10:30:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 10992353 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 A8E3915E6 for ; Thu, 13 Jun 2019 15:34:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9960A21EEB for ; Thu, 13 Jun 2019 15:34:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DB1222A68; Thu, 13 Jun 2019 15:34:14 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 877F9223A1 for ; Thu, 13 Jun 2019 15:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728290AbfFMPeM (ORCPT ); Thu, 13 Jun 2019 11:34:12 -0400 Received: from mail-pf1-f174.google.com ([209.85.210.174]:43061 "EHLO mail-pf1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728266AbfFMKcw (ORCPT ); Thu, 13 Jun 2019 06:32:52 -0400 Received: by mail-pf1-f174.google.com with SMTP id i189so11560675pfg.10 for ; Thu, 13 Jun 2019 03:32:52 -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:in-reply-to:references; bh=c8B2WpV2ao/GiAyoXZe0rgTXimW81Zj9eba5b1nq+eE=; b=h8V7naw5ZXcy9hmK/khUBCeii6w8istWHF8EhmWYofLp5tS8e7g/0p6wZ6C0USi+Dh mrRUluvbHlgWF/K0yOocTUP2YlkLwNpFUDSsXVVnXSqzMxRZWRa8AlpSQUB4RrPs6IWp Un0SbBuDDP+12ShPcNz/XCABHYeLuj6PS9IayrYHiA8AwtHPQ4tPtuphrFBF90Vs17i1 vsXkMoAETxkRSg8jeio5rfDxL0JIBqmfMMx1icRj4Xq3iUPOW52qUByywGCwTiXh8DFu 1ObjgH9WASPPsW9zF4CAFudb6rqRmc7X2kjWgK4X/RZCxjra/QjT4/pkl2l4+HA8RP9h ch5A== 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:in-reply-to :references; bh=c8B2WpV2ao/GiAyoXZe0rgTXimW81Zj9eba5b1nq+eE=; b=aiPRSkY+ZlQ3H1eJC52yFfLYsxS2hSEQ4IPOu72BJ3meoELbj7fHJ/SVPn0DpBDUyq ZLbUt2hSlQrPUQqVkQMM2Z4/+CBQUQGJz7hRkfAKDPj47tHpor77SszxiMV6jzrvfe5w 4sSW0Ebaq9zeLIAvim/Vn7Y4BjkoZGxtiq13PxhGRfpQzpU7ajBE9reMJmlm1o7oYiHl REjc9jI4p3Q3M+Rvm35bHM/3SipBX1qbTz7jDImAGJ7Via7cYZwKX0QraelZsAm5xBxO UVFoVE3muj/OuoKNpTCe1kKafr4mJld6p+lp6/BRrBefEekj+iMdxG52WNFlO01AyTLk OGbA== X-Gm-Message-State: APjAAAUp4snwMaGNphWHHssdsy2QS09jIS9w8lx0/HUcSXpyi+Q/ajb0 REJIx/qSxKDqjSJjGwhwB2WS+Q== X-Google-Smtp-Source: APXvYqzzZ7YxoNMF8oKGpZA1V8rzQ5wmso5pRZlZbpTxImoytKeurGrlcgP5yFfHuYycERwMARH53w== X-Received: by 2002:a17:90a:8c06:: with SMTP id a6mr963486pjo.45.1560421971996; Thu, 13 Jun 2019 03:32:51 -0700 (PDT) Received: from localhost.localdomain ([117.196.234.139]) by smtp.gmail.com with ESMTPSA id a12sm2265078pgq.0.2019.06.13.03.32.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Jun 2019 03:32:51 -0700 (PDT) From: Sumit Garg To: 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, Sumit Garg Subject: [RFC 7/7] MAINTAINERS: Add entry for TEE based Trusted Keys Date: Thu, 13 Jun 2019 16:00:33 +0530 Message-Id: <1560421833-27414-8-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> References: <1560421833-27414-1-git-send-email-sumit.garg@linaro.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Add MAINTAINERS entry for TEE based Trusted Keys framework. Signed-off-by: Sumit Garg --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 57f496c..db84fc4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8728,6 +8728,15 @@ F: include/keys/trusted-type.h F: security/keys/trusted.c F: security/keys/trusted.h +KEYS-TEE-TRUSTED +M: Sumit Garg +L: linux-integrity@vger.kernel.org +L: keyrings@vger.kernel.org +S: Supported +F: Documentation/security/keys/tee-trusted.rst +F: include/keys/tee_trusted.h +F: security/keys/tee_trusted.c + KEYS/KEYRINGS: M: David Howells L: keyrings@vger.kernel.org