From patchwork Tue Jul 30 12:23:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 170052 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2574376ile; Tue, 30 Jul 2019 05:24:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbN3TFJfF1Cgbb5b3GGi4Nkvlb92bmHSzubAtuotKU/Ejt8QVZiVZcnDCT3zcU8Ee/IcO2 X-Received: by 2002:a63:cb4b:: with SMTP id m11mr34884771pgi.49.1564489476196; Tue, 30 Jul 2019 05:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564489476; cv=none; d=google.com; s=arc-20160816; b=A6rjs9Sf/8Ew8mErWwaraU+rI91+GV+zDWBXNRT6LNj6bNwrefEXf4qqY+4p3THK+f 7030fbiO2Mi9/JwsSL6oVQjHLLBpHSCi6r5y8GPseAjUlYJfS3LnD4jV5JGrLJIsv01K lh0CwZL57GzeLDmy2j21k04lIDuYd2s+voMqTNJeBmIY/t1iLW6NTYNfxMl3jlBzSEvp K0TQpUS7Hfckv6fOuUEGKL9AFNJZPWPq4vUyvJCjzeL7Pe42E8PNVLqMQC0hOSaKFzBZ SKdROTrV6re6CxWk8J9MOxEw/SBtbGF+0296IMD4+XBnDiiZQlL5E75AWsF8pi5mWj1R toVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Ub4kuUSnrD2CiYyKKwaDCU7WlCc+MjZGT8+i8BhCGSM=; b=L7VPdKgXUfWP6YLYi3YRhBIVvS5XA33PCGM3d07PPMcXve+CuN4L5JHl46nap5ezhl cXYJ/0/ZG9WtEZP9ViGfEByXL3X4yi58XIPnXc/jQLr9PYap69vIYK7E+koCd3wmj9Ns FePzLrxR/3JqRwGYiGgvE35Alfn0h/jJgsuQVANnDRzpad5rA4Vx9T7cEC8e2p0mrNJP q9k5rh0yS53LEiIhwqZPjX56FzET79czK8BjPV0WSg04Jf+GFe6rFF96deZWOqTRiQ4H ydPNIORbI6Ly8N2cQ+mBuIfdT4zhlKwmDbfxOMTDWtieVHx/Ge987udJ3ua+xsi6vfOP 2Q9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MfQvx2dh; 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 k14si25450400pjq.53.2019.07.30.05.24.35; Tue, 30 Jul 2019 05:24:36 -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=MfQvx2dh; 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 S1729537AbfG3MYe (ORCPT + 29 others); Tue, 30 Jul 2019 08:24:34 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34037 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729365AbfG3MYe (ORCPT ); Tue, 30 Jul 2019 08:24:34 -0400 Received: by mail-pf1-f196.google.com with SMTP id b13so29766205pfo.1 for ; Tue, 30 Jul 2019 05:24:34 -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=Ub4kuUSnrD2CiYyKKwaDCU7WlCc+MjZGT8+i8BhCGSM=; b=MfQvx2dhjGV4/bSe60l+LebksrED1y3ZIlrOHn7KEst3uYq0lbZGY0vsMCXlHdvqTW Ye8auI8LrPtuk1JjxXNnkdo+hZ+99keG4VGsdhwKAsEXIsOsIUECaXlU8hbVHLFk9cLT HO8nBnDu0xGtOjVBUUGFJzgjgr3leWNo194UxYVJeI2Y+0v/K+qeQpXyF0PGeONbMN+i gW62oUUDBfxqW/m3zRut5eraL0BhFNM47K2DQzNbSup/f6DVATK2umRIZlAbmj5eTK+g Ie2+FR2iyP4pVV9kGjOO0QK2a+lbpVtyMzeY+CEhSSw2QwFdLdH8EHmR5UmLIl/CCH4Z mvwg== 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=Ub4kuUSnrD2CiYyKKwaDCU7WlCc+MjZGT8+i8BhCGSM=; b=aTF+n7CYr2THMjRczZEnL1LsoPKrMfEg7MlODum7puYHPqTmTXYhnSf71hOiSmOEKH sUUHnlzZ2UHWeKQxej84mkCUSODVHfifJm9PTdpQXF8EZ5nYRTJRBjj2mVIkCEIwgJaI Ktt+TjghHHJijiPCn1jR99FZ+tlyRPVW8weAhGVyMnrRHn9i6Lwq96Iv2+IyvcJq4bm2 Zmvp3kY9RAejEJnMs+w0yTq+6C41E05D/utKvdWNSr+VUymaCkYA7EnLcOVZUYVod1e6 NhsNzC0e1yZ0XcFwneSiCps3e7TWpwl7spKp1gBz9ryFIrhoSO3fs/TQklwiKdJ4D5N1 sFlw== X-Gm-Message-State: APjAAAWTUdaB1gtjh6UC7WQVcI4XITaRkC6/iBwnrtO5gnxHdBO5p8IN hZ3qOn+DkWN9JnQJKxcqhaji6g== X-Received: by 2002:a63:125c:: with SMTP id 28mr55618644pgs.255.1564489473744; Tue, 30 Jul 2019 05:24:33 -0700 (PDT) Received: from localhost.localdomain ([45.114.72.197]) by smtp.gmail.com with ESMTPSA id v8sm54895462pgs.82.2019.07.30.05.24.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jul 2019 05:24:33 -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, casey@schaufler-ca.com, ard.biesheuvel@linaro.org, daniel.thompson@linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Sumit Garg Subject: [RFC v2 1/6] tee: optee: allow kernel pages to register as shm Date: Tue, 30 Jul 2019 17:53:35 +0530 Message-Id: <1564489420-677-2-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> References: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Jarkko Sakkinen Reviewed-by: Jens Wiklander --- drivers/tee/optee/call.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 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 Tue Jul 30 12:23:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 170053 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2574508ile; Tue, 30 Jul 2019 05:24:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyigWzx5Xz0r2KifrOmToaK69IHvGUJaDzYFMN3mlBgpu0tMNrj4RHxaTAmzUsAMSemlIPQ X-Received: by 2002:a17:902:8b82:: with SMTP id ay2mr71831191plb.164.1564489484786; Tue, 30 Jul 2019 05:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564489484; cv=none; d=google.com; s=arc-20160816; b=SM1tDXALBULdPdEGThaoXkqMlOdOiFphi1WaE24zGD4HiZJmiICAiZgGeNS6N+0CcK kzQWx5Qkji67FP9YDlAaQeJydaXYpJLZkKIeko6aOAgWtRKjad0auc+ItCl3rQr7SvL7 jeki/MaecZB7VJFgdAKdnAEwnWfJDXpUdBzzuOqAJ/bBTFwDuRTdoMkRduJG+jmNWbdq 4ttHqQI7u5RuHnOnIGc457mZKiPGb3GtOjGm4KN9eQbPHrhm6rjyIyZ0JRSt8MEWivGk cgCdduG/T8d4aLBwM1StTYwIGKboxbofHfWw6o20fqHygaTQRz0wBUxgbBbWBKTxz2Dj XPZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=F6RVSFR3EtlCJ6lvWs5T4vKHtTJAwPryiatLZ1M1aSY=; b=Ilsgm4XvIA/jQSOtSreYJU8aP14nKMbkrLHekIXSUVStwweQ9xU4lt4XUcaQ8eqzaV fN+MEJymjVpVVELrEzfCZrNyi5/5jHff1cFNMPxiqRY88ntnyl6PxTNqCV8ViBSOpB+q qoN+rw3gYGZPcc7CtNxOa27L9Oih4oF4FWC8Ur4kX17htbhDHy4JbBqd924KVFmdCg9w fn/GzMpzDqB8cijaivUljCBlmKoMO22UOdTrXbwn1FXgbTOhJNpQwWAVeoeGRB8/iTnk aNOIHmP++0pL4rDluo6JUP8DRZzhwOpdYVA3rGXiMcdq5XkbPaSMvxRtPOrM8xD1ga+d ISiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tfILgsUT; 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 q18si21101416pgk.31.2019.07.30.05.24.44; Tue, 30 Jul 2019 05:24:44 -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=tfILgsUT; 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 S1729648AbfG3MYn (ORCPT + 29 others); Tue, 30 Jul 2019 08:24:43 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42123 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728219AbfG3MYm (ORCPT ); Tue, 30 Jul 2019 08:24:42 -0400 Received: by mail-pf1-f193.google.com with SMTP id q10so29749899pff.9 for ; Tue, 30 Jul 2019 05:24:42 -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=F6RVSFR3EtlCJ6lvWs5T4vKHtTJAwPryiatLZ1M1aSY=; b=tfILgsUTF754qwTkDQPJD0rCNoaw5Uefc9p9gu+bUyOB285QrfyyfBMXVCuakpWXxU HICwYDIoYTjs/+ornlvVNUoij4mg9ij8bxODX+c7q02mHaK7IrzMH1R7ecmTkMo4+2xO Us9rLCt7owepUui89bfkEE/+tfrGjWsmuEK7kWBlWuXdpLhbvxXU6dLLp7egHq3QfEOx EAnFbfA73EDc7EvI/7xV2L+LruWbM8T/aZwxfA/Fok9dNyUsOb1nZjkFl2ZhnvrgF20f tcRKcSqCuXR5PmdwOUIpurnXSTsuhM16BUhSnW79IuqvzINcCDhZiAimeJCJ/3aEVT/+ Skzg== 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=F6RVSFR3EtlCJ6lvWs5T4vKHtTJAwPryiatLZ1M1aSY=; b=Rzq8oOpwF/96W//pc+Vq7iVwUQepV2COzLmlHcN+W9NvM+Fpx9n87FlDqD4Ak+RphT yk86xnOId83jEH6b41pFxk/6BFE/gT9g1t0YeSa86Be9JKVMIN8ADHwZtlJ7I6Z1oz1Z 1l/spMf14STg+TnIjrLNtF/tYUxVsUEMJNg6Uytn9XCNlaLXFVE/URPYu2nL+tURQ4et vO6qVKt/ZaNt6eDFg3bYUrS1pK+QV+ddb0ZQ2fKHS9ZWn5QBRzic41talLY9tS5OY02b mVvQO3gphraUj6JOoovMx7S1VwwnAiKj5Bw4jCDHnETV2MA6Mc+L2thL4FbLUCyy/rED 5c7g== X-Gm-Message-State: APjAAAXpVbIIE8ZcIQ4pOwyBeX19P70VU/YBEQ3yQfhOHxeeJZO2wpcw aFkjij5jcEAp8tWOvtAIPuamiQ== X-Received: by 2002:a63:d04e:: with SMTP id s14mr103689463pgi.189.1564489481707; Tue, 30 Jul 2019 05:24:41 -0700 (PDT) Received: from localhost.localdomain ([45.114.72.197]) by smtp.gmail.com with ESMTPSA id v8sm54895462pgs.82.2019.07.30.05.24.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jul 2019 05:24:40 -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, casey@schaufler-ca.com, ard.biesheuvel@linaro.org, daniel.thompson@linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Sumit Garg Subject: [RFC v2 2/6] tee: enable support to register kernel memory Date: Tue, 30 Jul 2019 17:53:36 +0530 Message-Id: <1564489420-677-3-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> References: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Jarkko Sakkinen Reviewed-by: Jens Wiklander --- drivers/tee/tee_shm.c | 16 ++++++++++++++-- include/linux/tee_drv.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) -- 2.7.4 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 Tue Jul 30 12:23:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 170054 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2574634ile; Tue, 30 Jul 2019 05:24:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkTCVQ6qzeewyatmY419Gxr7cknoD1/8mlEVyDF9C2j5VI4d8TOLEAjEyZosf6wQI1Xp3u X-Received: by 2002:a63:ee0c:: with SMTP id e12mr110485708pgi.184.1564489492634; Tue, 30 Jul 2019 05:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564489492; cv=none; d=google.com; s=arc-20160816; b=X2dhbQsyx3U00c97Qlw/1wmnc0UFULUjxzI2OwGovhTdLH5ujKAS+EtClS6m/YcFZJ LL6aWBqCJemc5wrkiJPGpTt13uNkkcoxMMrTQFNE95+bM6HKRH68c3vWawFF6WVmBcCR kFt/hSXsjZFddxkHmY97qGKvROR+absu7Uxk3ktvDiD5lWY3ftU2+iH8l4SGhOARkYTW 7cMYmatDiB7l81vwDpcC0GIB5WYH44c+l/w+Zw5Jz5G7Ux8EDJFJ2nk39jYA82W9Hqu8 FEE7jsl9qCfA4+NQbjumMLpMoe3wvcJ3vGEtogl77mYsvC37X1YxpgBDUy6lUXD4WHQ0 Re/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=E3OJFxf+mUWoz3h8BXrLdL53qyDG3CcJuYs/0iyxKF4=; b=bmqQX8bdXrRJYJI2qcjpQyEQK5VnMETflI1gceAUyG5e06985kuekkPpmTCqRBlL9I ar1uf+iAk/o850rbhBc8aKNV1ytJV9NMtrwkWYGTqJiYAyKf+0Io8w8P+rhuCRAdlVYx KpAF+X984jjAlU+dssvm3i/b3x/Z87EGlqGBkgGqhKZl3mjXelU59FPHzddkpiDcXffV VjrwKJrMMSIh2emw/5Jxi+K8kBIMIcWJg9KZ7OHHX4V63wi0aYlqD2GG36RgdeLvgwLS L8JSfN7qBZAurw2EIpdsxoF8yf01GDKblQf+Jqa0cV1DanQeIfhBdNey9LuVJCa4A8KX Lfsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lHZd4YOt; 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 o127si28864509pga.593.2019.07.30.05.24.52; Tue, 30 Jul 2019 05:24:52 -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=lHZd4YOt; 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 S1729882AbfG3MYv (ORCPT + 29 others); Tue, 30 Jul 2019 08:24:51 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45757 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729661AbfG3MYu (ORCPT ); Tue, 30 Jul 2019 08:24:50 -0400 Received: by mail-pg1-f194.google.com with SMTP id o13so29969625pgp.12 for ; Tue, 30 Jul 2019 05:24:49 -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=E3OJFxf+mUWoz3h8BXrLdL53qyDG3CcJuYs/0iyxKF4=; b=lHZd4YOtFXL1Gwc2xUvnMZ7Or2UzfTKDyw87HagAQzlXqafH7TIxkdoiJQJhmsgk4P FycQZDE8Qu4bgy/7+a4uDb9S9UKbhoubw4F01cu1xYmfVZcQaREf2QEB/I0toxi4LgV4 /Mc5qRfpVdt9IGSYE+PYQWd1uaC515Ivb0mNPROtzmMX3fyeZicOL/5NY2SydG/NPcjK d5ThhCpIPGKBu8b6Wozgxk84LfNSFs/rNEEV0Es9qC5DSpJhEOcwlkDf9eGlwYHM0jVw INZyrebVn/ruh2+hKI2DdNFiOodeC0dZpYVQH8uuutCbtk35xar9PYrCyF2hfi7NebdX n+4Q== 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=E3OJFxf+mUWoz3h8BXrLdL53qyDG3CcJuYs/0iyxKF4=; b=q9FeyVhSMeSEM9/tvsBqYijCiAUEPwu4iEk0t42jkC87+8Xtj54fORkkV4vu1i27Nu bT0Xi6rOGjcjfZHb0wO+Qd2/ZJl17UMWjYfVgYpqo9aE0SDrlA6VHpjWS1CBAJY+ToJr Cux0Ay/es4uSLxoqz28Jz1RnVjBYQQbzqzz4S8d00iaIoecN03jFV5crnS2znXgCpxge zgKJVJkl4QpELrjGa4/3CqDqxzI6wEeKUxL46p5FEkZfGV8z6ffaW4HHC+FxmKWacugd F82k6SXzSclbBudXoqdyRdK68DsA/dxdCCaAY+nWksSk/P8CF9txlqzxkGs+xZXPJoHf kzNw== X-Gm-Message-State: APjAAAU4TZ5/SWadlGkRvqlOV8xfQgIWeKb6yhya4CuSFWPP40ziJcz0 x92I39NJhZGMYx1WIHBG4ITidw== X-Received: by 2002:a17:90a:3247:: with SMTP id k65mr73468902pjb.49.1564489489600; Tue, 30 Jul 2019 05:24:49 -0700 (PDT) Received: from localhost.localdomain ([45.114.72.197]) by smtp.gmail.com with ESMTPSA id v8sm54895462pgs.82.2019.07.30.05.24.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jul 2019 05:24:48 -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, casey@schaufler-ca.com, ard.biesheuvel@linaro.org, daniel.thompson@linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Sumit Garg Subject: [RFC v2 3/6] tee: add private login method for kernel clients Date: Tue, 30 Jul 2019 17:53:37 +0530 Message-Id: <1564489420-677-4-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> References: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 GP implementation defined login method range: (0x80000000 - 0xFFFFFFFF). Signed-off-by: Sumit Garg --- drivers/tee/tee_core.c | 6 ++++++ include/uapi/linux/tee.h | 8 ++++++++ 2 files changed, 14 insertions(+) -- 2.7.4 diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 0f16d9f..2c2f646 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_MASK) { + pr_debug("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..a0a3d52 100644 --- a/include/uapi/linux/tee.h +++ b/include/uapi/linux/tee.h @@ -172,6 +172,14 @@ 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 +/* + * Disallow user-space to use GP implementation specific login + * method range (0x80000000 - 0xFFFFFFFF). This range is rather + * being reserved for REE kernel clients or TEE implementation. + */ +#define TEE_IOCTL_LOGIN_MASK 0x80000000 +/* Private login method for REE kernel clients */ +#define TEE_IOCTL_LOGIN_REE_KERNEL 0x80000000 /** * struct tee_ioctl_param - parameter From patchwork Tue Jul 30 12:23:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 170055 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2574772ile; Tue, 30 Jul 2019 05:25:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSguqB8c65iL0V4quBn92oy98dAQzuT6z02h/EZ1jCGKgpriAJlEuFzRaGuO2K65CGDNpH X-Received: by 2002:a65:640a:: with SMTP id a10mr107205239pgv.338.1564489502234; Tue, 30 Jul 2019 05:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564489502; cv=none; d=google.com; s=arc-20160816; b=jSTP+DDvsHYqrpDTZtNrTgDIuMxY/l8342u/2r/GjdwyWcFTCBgFSWMJch8Sy6/ALl J930aNcTsnpKDWua6V6nepkdCqlBaubQJbsVfkiDUVtu4wDDCGEfNACaaKJ0T8NdiayM EmCvEic20DQ/Hr4PGWdQ7MMvBkNEwkBtylU76uAuIuxBCwjThdLMcoSQfMOgkKMIIhWv iIYZYy8r9v3ns47vuzmvTLAnlDNpgtHkm2fKObp9rdZAbZsZt9BlIDbAFopaKpAIZoxl j6jLX+SpdclvybuDPV2w60tmlblZt0ih6GhsKRNVXJWq/g1ADA77zKSTmyJ5uFpokCU0 Eimg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=g3sbGqLJtyr+mK3noGyfsK8BUYQhIzhDi/FCoBAZUJY=; b=bP40TBWcPot/mYOxKIAt4RYpGBjUyssj/cfFoKOwosqGvpbAQBTJx9lYs8/UjIBTcp zYQOnKobPltDjtoADLZA3r+fuj5H9z2B6sv8WLkPOmT168LUtTkwvqxBYT3x2y5ltWQU L0PSEM2NF8J0LFvOxDhllNyEbBeRehyhJ7J2bvH50FEkBV2o/I/e7vYOtWRXDqPwUZje lzmszK4QWyVvjRH5j3HppuQPwPMOWA5rSlTPcWKDx6n/AQFf8bDbxl6y4/+cOmIFbPs3 rvUEXesU+lch7UU2d8JQGzfeR7flVyhFpVKEQhIu8dZ5XRaTT+tJbFRdVH67kSIwnst5 xltg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tspuXETv; 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 a5si26927800pjv.80.2019.07.30.05.25.01; Tue, 30 Jul 2019 05:25:02 -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=tspuXETv; 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 S1729993AbfG3MZA (ORCPT + 29 others); Tue, 30 Jul 2019 08:25:00 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46451 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729661AbfG3MY7 (ORCPT ); Tue, 30 Jul 2019 08:24:59 -0400 Received: by mail-pg1-f193.google.com with SMTP id k189so10940448pgk.13 for ; Tue, 30 Jul 2019 05:24:59 -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=g3sbGqLJtyr+mK3noGyfsK8BUYQhIzhDi/FCoBAZUJY=; b=tspuXETvVlvH6QvNkv/zEzkktY7N5Gwz5LdVhXPiHKK6hvrdeOUkvi+xZTm+Wz4zug E10rhIjuIMoZ13PtQiClrJPyX+ZJsER+9Hk6Y8Yc2UD6LoW5c4rI6eUGFizc4kB0j+0k lf2o8W+06Vczc0Anprsv26FEQtDj2+sOJqYzK1wzfeFXLXSBfuxO1a5hbH9pQ73hivUS G+7cl6E/BQBzB/PVKNh3hTJinmIZjMaZdGsiIjgnjCMUxfA3k/K0E93J7/cnbmh88AAn JF0ciAjMMiWrwQ7UQ6RAMW0R1o9eFVw3SwhQ0a18NLhTmH+El37+pxbyV7PuOffGWqw7 M42Q== 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=g3sbGqLJtyr+mK3noGyfsK8BUYQhIzhDi/FCoBAZUJY=; b=ca/NxBRawrRPZNl/xlQxxSvsX1R2UX87DRayRGQBdlDTvwmjMy7UpYIcrf3NKDNJV8 syqKt/usi7+m9fd58R1Z9yY8mB9ZnPqNri+BOu+ynCkzurPC1G3eIrCMWU9Do3R9MCoG 2gaki6l0/RO5d9Wqo/EwEIQMgYNUfSBYky9NNqekJQsIEiCgjd+x3idAMlbvenDq6VbX +ZIkZLONLLqQNVrs7Iz74CUm2ZU/tKn2i3VLUj4pZW0eeFCW3zRFCKFFWFJEXAOI9XT8 lSSlTSbMxftfA3hOB/Fj+QDJW+qpt1HemIjEQ3JX/bpZvWegCqo1NdvrOKccIe4ha/EZ lkWQ== X-Gm-Message-State: APjAAAWMfO6sO1dl3oBXckga8RkCLx1F4CEtyanmAzbi40PZlZMT8klC TWn3PS22bAwgqZm1c0jMO6vomQ== X-Received: by 2002:a62:3445:: with SMTP id b66mr41769046pfa.246.1564489498605; Tue, 30 Jul 2019 05:24:58 -0700 (PDT) Received: from localhost.localdomain ([45.114.72.197]) by smtp.gmail.com with ESMTPSA id v8sm54895462pgs.82.2019.07.30.05.24.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jul 2019 05:24:57 -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, casey@schaufler-ca.com, ard.biesheuvel@linaro.org, daniel.thompson@linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Sumit Garg Subject: [RFC v2 4/6] KEYS: trusted: Introduce TEE based Trusted Keys Date: Tue, 30 Jul 2019 17:53:38 +0530 Message-Id: <1564489420-677-5-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> References: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Sumit Garg --- include/keys/trusted-type.h | 3 + include/keys/trusted_tee.h | 66 ++++++++ security/keys/Kconfig | 3 + security/keys/trusted-keys/Makefile | 3 +- security/keys/trusted-keys/trusted-tee.c | 282 +++++++++++++++++++++++++++++++ security/keys/trusted-keys/trusted.c | 3 + 6 files changed, 359 insertions(+), 1 deletion(-) create mode 100644 include/keys/trusted_tee.h create mode 100644 security/keys/trusted-keys/trusted-tee.c -- 2.7.4 diff --git a/include/keys/trusted-type.h b/include/keys/trusted-type.h index 5559010..e0df5df 100644 --- a/include/keys/trusted-type.h +++ b/include/keys/trusted-type.h @@ -67,6 +67,9 @@ extern struct key_type key_type_trusted; #if defined(CONFIG_TCG_TPM) extern struct trusted_key_ops tpm_trusted_key_ops; #endif +#if defined(CONFIG_TEE) +extern struct trusted_key_ops tee_trusted_key_ops; +#endif #define TRUSTED_DEBUG 0 diff --git a/include/keys/trusted_tee.h b/include/keys/trusted_tee.h new file mode 100644 index 0000000..ab58ffd --- /dev/null +++ b/include/keys/trusted_tee.h @@ -0,0 +1,66 @@ +/* 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; +}; + +#endif diff --git a/security/keys/Kconfig b/security/keys/Kconfig index dd31343..0d5e37c 100644 --- a/security/keys/Kconfig +++ b/security/keys/Kconfig @@ -88,6 +88,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/trusted-keys/Makefile b/security/keys/trusted-keys/Makefile index 6ecadfb..5fcf2ae 100644 --- a/security/keys/trusted-keys/Makefile +++ b/security/keys/trusted-keys/Makefile @@ -4,4 +4,5 @@ # obj-$(CONFIG_TRUSTED_KEYS) += trusted.o \ - trusted-tpm.o + trusted-tpm.o \ + trusted-tee.o diff --git a/security/keys/trusted-keys/trusted-tee.c b/security/keys/trusted-keys/trusted-tee.c new file mode 100644 index 0000000..724a73c --- /dev/null +++ b/security/keys/trusted-keys/trusted-tee.c @@ -0,0 +1,282 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 Linaro Ltd. + * + * Author: + * Sumit Garg + */ + +#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, char *datablob) +{ + 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, char *datablob) +{ + 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, size_t 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; +} + +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_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_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) +{ + return driver_register(&trusted_key_driver.driver); +} + +static void __exit cleanup_tee_trusted(void) +{ + driver_unregister(&trusted_key_driver.driver); +} + +struct trusted_key_ops tee_trusted_key_ops = { + .migratable = 0, /* non-migratable */ + .init = init_tee_trusted, + .seal = tee_key_seal, + .unseal = tee_key_unseal, + .get_random = tee_get_random, + .cleanup = cleanup_tee_trusted, +}; +EXPORT_SYMBOL_GPL(tee_trusted_key_ops); diff --git a/security/keys/trusted-keys/trusted.c b/security/keys/trusted-keys/trusted.c index 8f00fde..a0a171f 100644 --- a/security/keys/trusted-keys/trusted.c +++ b/security/keys/trusted-keys/trusted.c @@ -27,6 +27,9 @@ static struct trusted_key_ops *available_tk_ops[] = { #if defined(CONFIG_TCG_TPM) &tpm_trusted_key_ops, #endif +#if defined(CONFIG_TEE) + &tee_trusted_key_ops, +#endif }; static struct trusted_key_ops *tk_ops; From patchwork Tue Jul 30 12:23:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 170056 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2574927ile; Tue, 30 Jul 2019 05:25:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXYKalkzmfMVkNNSG2Ds61Bi3grFjFu7hor5e909nTpEFRx2JV6OzCCiH0/5dzVegL9q6c X-Received: by 2002:a17:902:1e6:: with SMTP id b93mr113781656plb.295.1564489511633; Tue, 30 Jul 2019 05:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564489511; cv=none; d=google.com; s=arc-20160816; b=IejBmf2X5Fq8WlDIqjrvmxJIBlG6cAlpPpacQSMlypboV0Gq62+R5wfcaQA9mjG31y Q33rRYSGjglS8juMdGG+tfGgfCG5f+EFyMD9HWNp8ykPig6DSxmarKNBmDpT5r4x+dY6 AR7eOG2sH+3/SyguxwG2D/AsoxHvha8GdqgM0mUqdldTcmVEiBGhQookHpvYSr/5kwG5 3KPdccG5GUHLIAL8lCMQmqI/w4tiibMk0/EVx/AYRv1zmyLEzXAfgei69I+1NGrpy0uu ubAaUP9qYOP7PwwJNya7Nh8+eSqOYGPjDjsCtgvsa39PKbPT2MkFTT2q7RLtinF7pI5b 07bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ihVno30NiTJ4nXlPwk0p1JArXGGwnpn9XYnN+QyiMz4=; b=IyH4t1DMDIcz8ZoaY4EtqcMbJG9BHjyY7oE6EvpAYHC24eurgpDreahRzmSWuJjKeH xv//4/Jo6lYGYflqUl3q699CMShcacnYLGvGf5ueErPPyYuJpnAnUxRJfAMlE9uKFmGI RgY1ZcvJGyZ/bsFtPNePK7HE2zn2+pJIe9iSgBLa45RovY2wFy0CvZrCubtl+rt+3GkH alTBZWKu1QYVW1RGBQVYAgLerU4n8InzD5aHTG2xgOhU2DlhQuDq0oMEaydI1mEWnRIo K5BN9v75GGrofl8rLYucPAGTqtSg+ecuLNN+AtjHytKe0iSVs7WYXDBExNz3b7m8qeW/ gZNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qbiyr6oe; 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 d22si27039025plr.120.2019.07.30.05.25.11; Tue, 30 Jul 2019 05:25:11 -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=qbiyr6oe; 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 S1730307AbfG3MZK (ORCPT + 29 others); Tue, 30 Jul 2019 08:25:10 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:37909 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729973AbfG3MZH (ORCPT ); Tue, 30 Jul 2019 08:25:07 -0400 Received: by mail-pg1-f196.google.com with SMTP id f5so21165059pgu.5 for ; Tue, 30 Jul 2019 05:25:07 -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=ihVno30NiTJ4nXlPwk0p1JArXGGwnpn9XYnN+QyiMz4=; b=qbiyr6oe9qmKjEI/E2pv/fDSjK/fIiWbv00GPWqkaY7IeiYE3b93IixfbKgrbfOki4 TKD9IEJlrA1TANkylWk2FpXKR6F1NYac7MjvuQH0ePRjZXsDj5u1NMDXKTKJ8apiLru+ H1UmLUZhxay6j2lrbQeVp1PPfhxGTe4BYfbu07PKWrQJyOCerjM4U6lHiVMBOixJhlKz mZtYAZwHgvnITkIA3MnfqHcC0lDX2Fb3uW9K3OsNn5mt7dlLXuCpoHG9etCaZ+IWoc92 RQtiGHprKKQqEFEkbz4b2fCaojhnl4idmkaR7k+HPZ3TMHUTAX0MuFD8tqHBqJ3HvCv+ e4mQ== 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=ihVno30NiTJ4nXlPwk0p1JArXGGwnpn9XYnN+QyiMz4=; b=RlHr8NtGrjZb1JZfVAiaLn8Ra2E/fIrbbUclHJiqo80UMz89nl6X3bBYM0DRvacTJw cXQgesNU7LXeF59Qm8LCRSdc8DO/cOovgKIVL0VdN7M2HJueD2xVcUaGD3BMhOxIfJxs ANiCA9UmLJMIAjluYlRQ8Vjirt9ZnFHuDlOc79SNfnU9Oi5WwymnFbmd1nA75UYd98yD W6J1ItMZK7MSEazsWVXWBltwF3rDJG+rxKSyo19hatikm/jJrtT7abKiKsS6EsU149xk gsIVRyJFfz9g0ineqXFu2Ebes64Fai3Xhl63WGli6uq/9N7hvVE7LjhlkoOLvhDtUGmS yNtA== X-Gm-Message-State: APjAAAVloTEu7AyfMqDmpfj7C6Az4MsyaQIyo/LEebRMHAWVAqM6pnyf f3e3TaTt1z8UqRLI2AtgO88P8g== X-Received: by 2002:a62:764d:: with SMTP id r74mr43312932pfc.110.1564489506754; Tue, 30 Jul 2019 05:25:06 -0700 (PDT) Received: from localhost.localdomain ([45.114.72.197]) by smtp.gmail.com with ESMTPSA id v8sm54895462pgs.82.2019.07.30.05.24.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jul 2019 05:25:06 -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, casey@schaufler-ca.com, ard.biesheuvel@linaro.org, daniel.thompson@linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Sumit Garg Subject: [RFC v2 5/6] doc: keys: Document usage of TEE based Trusted Keys Date: Tue, 30 Jul 2019 17:53:39 +0530 Message-Id: <1564489420-677-6-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> References: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/index.rst | 1 + Documentation/security/keys/tee-trusted.rst | 93 +++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 Documentation/security/keys/tee-trusted.rst -- 2.7.4 diff --git a/Documentation/security/keys/index.rst b/Documentation/security/keys/index.rst index 647d58f..f9ef557 100644 --- a/Documentation/security/keys/index.rst +++ b/Documentation/security/keys/index.rst @@ -9,3 +9,4 @@ Kernel Keys ecryptfs request-key trusted-encrypted + tee-trusted 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 Tue Jul 30 12:23:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 170057 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2575005ile; Tue, 30 Jul 2019 05:25:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBMMEZvng0T36tDRMbTLpxDZ2myQ/rCAvlWjb/yzyTzcW8Fydjw15epdRMhO1n8nOoYiF5 X-Received: by 2002:a17:90a:8a15:: with SMTP id w21mr117469869pjn.134.1564489518132; Tue, 30 Jul 2019 05:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564489518; cv=none; d=google.com; s=arc-20160816; b=y/xArAzq+GqCkVD9d3F3i8Vs73aRq06+I9PqRAlAMKOV3EeySLq3VV8XAd2qc/bAuf 8JsoXy9X69r9Qe6TZzuOTZYSsUtb+aFaZNjTpSYoArYXSoLTUJ5EhGY5/P34hW5Ej8WJ XrM3u+FQlgYCo8JfaNPI5antvorVtf0Kr+wcXEqQ97EIOHbh/mXCEpZqbkzvyBZaFiG/ pQyc1k/sb096Kl2L9eC55eqDusiizuNvDe0IOXPCI6SiYkFhk88LiF1mQx5fmHAxOqdM j3CVJK3PRMw12bV43OL3DInMVy4gWfcMJxccrNKhnHEUPP6CTqK/1551pzB7kUpp3IQT 4NXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=UdO7TiN1GZWaQttAvLZ44/neyJcGu5j8j3RhNT+Sui8=; b=URN1VwrOR0X3Krc8xHkRITKepblgB1bONEvGtQSimBosnZUyADh1Cz/dQVZGQmOb+t MCuy5t1IEuoDAQXVq1CmGrJl5yVBRns8/v/a321lscB+7I7tYfQg3GazHfyo/dn1/tZS 1QHXKlx1OINZ52Koc/7pn6ZXfXE5iMXFU9EnhXpKfgueFmwt3zN28VALApia8vHDO3aN SHYy6OCsROAl5y6VvGi+Lup9rIbzbLN1Ev0B1wTn9FReuGsFEa2xQOdi/W3i8uDKl2cI tQPO2lksoPN9kBabuL65NBSbadkKgSGN/8DIJGUQGdAX3KOl6KJFy7oQw6m5NArPY8ji j+KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="oeNn2Nb/"; 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 n1si53214054pjo.28.2019.07.30.05.25.17; Tue, 30 Jul 2019 05:25:18 -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="oeNn2Nb/"; 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 S1730352AbfG3MZQ (ORCPT + 29 others); Tue, 30 Jul 2019 08:25:16 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33490 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730316AbfG3MZP (ORCPT ); Tue, 30 Jul 2019 08:25:15 -0400 Received: by mail-pf1-f193.google.com with SMTP id g2so29768014pfq.0 for ; Tue, 30 Jul 2019 05:25:15 -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=UdO7TiN1GZWaQttAvLZ44/neyJcGu5j8j3RhNT+Sui8=; b=oeNn2Nb/KW67tK/SQYA3SwA0z1uQndtVJSRu+PDEjP72OlO8KmCMDtWBV5wq5bXjh9 hS9nOcAhh0rZcgj0RAfW0XRibChG2g3/3zWkiH4hkx8VgHfmHWA4aM6qvQRMCbMGDSOp Bo53QaBP5OkWQzpZYWoNrCGtD3zIF2iH9bYNCt0o/ZLVt1XE+gTFteVw0X0p801KmcMi mIumz0AGK/+0LiHxAWX/nfQoS8Y1yP7gHMEixVeHFMyQ1tqGa9Tnh5U41MsKDVNf5llv RVYHfmDG2keihY0FTtTRGgzTF4IdgXDe5G/ve9Nji1Pbk27WKRIn6biY+aN2+F66OH/R oz6w== 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=UdO7TiN1GZWaQttAvLZ44/neyJcGu5j8j3RhNT+Sui8=; b=WnRcT40OIL3ce8gQsDW0n3Pm+ltFyVl0pE4FG4SjjmlOZBlhJBvpIWF+Shc/KaYWz+ FXgzQELp6aph0Ze6+3cenew0AggKq1VNwsKq25PkrxrTC8XrbNStIet66CaO4lGHF+ge fhaFCklYB+KE95dIT9MYJgH24y2WhK/3ba5KnqzSrD3t6DzsGdp5Zx6p7XW+zyitDxtd 7FY0Vb/2RNNDryisoPT6BMXxd0e7RjUAJH1QaZ/GrqlD7ldPkntuULFYmlbAenUCKzhC LXpyL++mBMpAyfMkNE0dVwqOhgHWoAd+QjG9M7NE3L6Dl0YFKQ9q9fZpnud7Sv5arFdF RF6A== X-Gm-Message-State: APjAAAUZpn3X/FW8rfSUScksNdfaQyJO2vSW0SSXpS/D9G57EWkWicoO eETMEvehYjyKF4tauORzd1VboA== X-Received: by 2002:a63:5c7:: with SMTP id 190mr106671104pgf.67.1564489515198; Tue, 30 Jul 2019 05:25:15 -0700 (PDT) Received: from localhost.localdomain ([45.114.72.197]) by smtp.gmail.com with ESMTPSA id v8sm54895462pgs.82.2019.07.30.05.25.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jul 2019 05:25:14 -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, casey@schaufler-ca.com, ard.biesheuvel@linaro.org, daniel.thompson@linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Sumit Garg Subject: [RFC v2 6/6] MAINTAINERS: Add entry for TEE based Trusted Keys Date: Tue, 30 Jul 2019 17:53:40 +0530 Message-Id: <1564489420-677-7-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> References: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add MAINTAINERS entry for TEE based Trusted Keys framework. Signed-off-by: Sumit Garg --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.7.4 diff --git a/MAINTAINERS b/MAINTAINERS index ce06877..0b61ecf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8930,6 +8930,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/trusted_tee.h +F: security/keys/trusted-keys/trusted-tee.c + KEYS/KEYRINGS: M: David Howells L: keyrings@vger.kernel.org