From patchwork Tue Jul 30 12:23:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 170051 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2574254ile; Tue, 30 Jul 2019 05:24:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQ+tnvky90AV7D71A+t9I2+jqoqw0KJT2SDyFd3Q7UmtAcEBdk0sDPCmdqYyh3ir33GZ/z X-Received: by 2002:a17:902:2a69:: with SMTP id i96mr113643428plb.108.1564489469104; Tue, 30 Jul 2019 05:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564489469; cv=none; d=google.com; s=arc-20160816; b=y3Di3kXi5RZZcbycD4QfsyOMxVyGqCaAcOaZEnEM/icFKdCG8ubA1gSoIMVJDDOsT/ 96C0ksFRL9i3KrGIpn1QublZOhiexNzD8e0OIYuBbRHrFgpALINqyrKGEs115CkIrn11 i5YkMt+mAXUiZEK5/IDKCywxR92r1nzsgv6CiyEcVfVf2FTi8zy7gxJd/v/r3uaJAP7p E5mcaReFFiJkLaWhyi9hLS/1uGhrSuZVJ5sY2HgGNK3rbzIevIp9JSayKCG0hLtmCzCX 2f2e7WqzAnC296OEI3rpjdz+0FFKwU7/4JNDANd6rWfYOYU249ln2v6qCFFAG08WJvrw +nNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6ZePv7NXstL+Sqt4m1uBMWD7mL3/ZMzlrVfaZ2NvhzM=; b=SBXeh5pVyRMMUAz4c6OaZVTKRP7Hu130ATkOV2ftOyB8srDM9GyXcsllrNUBMkU7Vh nuH4QzlKmPbZ1dOIHDispSfvdTGJr2LD1GcS68fD2mDWTzCviT/hmajRe5+jNoMmtMQq j+MiY4STtM9Laebusm2flDa4MZDL2JTMNF6pQ3lrYg5FEOWuSV+jQt5m902USmS7kSMR lJuwMTgYX93fBdj4fkHjKyUSrulfjG6wrG/GwKGb6aUuN337kyPHEyBzDnwny+ssDcHN sav4m9l56XDGag5Hiqx8NIlanR+RbDdylWeoOLT/gFte7P0cd44WSzQtwFZx6bMBKBpY yMzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lB6yIwwC; 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 a10si29211886pfc.215.2019.07.30.05.24.28; Tue, 30 Jul 2019 05:24:29 -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=lB6yIwwC; 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 S1729331AbfG3MY1 (ORCPT + 29 others); Tue, 30 Jul 2019 08:24:27 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35996 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728171AbfG3MY0 (ORCPT ); Tue, 30 Jul 2019 08:24:26 -0400 Received: by mail-pg1-f194.google.com with SMTP id l21so29981375pgm.3 for ; Tue, 30 Jul 2019 05:24: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; bh=6ZePv7NXstL+Sqt4m1uBMWD7mL3/ZMzlrVfaZ2NvhzM=; b=lB6yIwwCNSDjrWVykyeL4K++VnFNec4YxgddVvaRS4/R/0oHWt7LQVpKqdjpAASjgc 0iPKuYv15NgUSHfKLcA6CR1Nt0rx5zAGcXi/FyaiI3Xda53pvauMaNAfx/1m2rxCwa0Z crzWacGPYYLLS5WXzVHnAOSrRG2imu9I/H7H4MXZIRTWu2zC2Zr5jM99w2uIL74nv9o2 i3GLJevzUkxAKOe8KmddtnXsoghJmrXz7PF7/cL5Ph7z9nx8OAyBwxbwRwYd+OQInO1o tw9DWp8rvkv2AIt4K5pjZmJc0yRBKpJaeeStReenRYdnj1+Iiz60kQljwoVnlels7CqU z9Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6ZePv7NXstL+Sqt4m1uBMWD7mL3/ZMzlrVfaZ2NvhzM=; b=I8GMezHxsa6cGZ/D9+CNGqZPjav7lLsDnevGuBQEr7EGPyoezUx7Dr92y1tLmyugBe gDHGPci9/a7gRmeKHMw3ZTkPFQv1CnEeKwsKRz9S2fz0lPVDjMxzD37MgGdKfCfUgMSN vTyWQmmYmWjEWcvdG1DoTLXMIYD3T5VD908kHrrKnonxh4/+qAp5FeFfunSbqpCzXlYa HBVerFzozkkY/7g/yjYcFU2qad0x/TKNFE+szYQ84X3AAehbl0KaIPbZ/WJftcdy2uSi KYSQnRWDoGjUk9C9fbqnyhxstC+9d+OjzXBZ3biUi8iEchjrc4+E2Tq+mazxyuyXJYdi KZXA== X-Gm-Message-State: APjAAAV5qbLOSDZ3rx3QcSWh9BKNtz8Qa4YlNs2xfJlwLt4bBd18Yph0 u85kvbXggxWzcbppmqN7QYtVlA== X-Received: by 2002:a17:90a:ca11:: with SMTP id x17mr117801760pjt.107.1564489465898; Tue, 30 Jul 2019 05:24:25 -0700 (PDT) Received: from localhost.localdomain ([45.114.72.197]) by smtp.gmail.com with ESMTPSA id v8sm54895462pgs.82.2019.07.30.05.24.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jul 2019 05:24: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, 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 0/6] Introduce TEE based Trusted Keys support Date: Tue, 30 Jul 2019 17:53:34 +0530 Message-Id: <1564489420-677-1-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for TEE based trusted keys where TEE provides the functionality to seal and unseal trusted keys using hardware unique key. Also, this is an alternative in case platform doesn't possess a TPM device. This series also adds some TEE features like: Patch #1, #2 enables support for registered kernel shared memory with TEE. Patch #3 enables support for private kernel login method required for cases like trusted keys where we don't wan't user-space to directly access TEE service to retrieve trusted key contents. Rest of the patches from #4 to #6 adds support for TEE based trusted keys. This patch-set has been tested with OP-TEE based pseudo TA which can be found here [1]. Also, this patch-set is dependent on generic Trusted Keys framework patch-set [2]. [1] https://github.com/OP-TEE/optee_os/pull/3082 [2] https://lkml.org/lkml/2019/7/18/284 Changes in v2: 1. Add reviewed-by tags for patch #1 and #2. 2. Incorporate comments from Jens for patch #3. 3. Switch to use generic trusted keys framework. Sumit Garg (6): tee: optee: allow kernel pages to register as shm tee: enable support to register kernel memory tee: add private login method for kernel clients KEYS: trusted: Introduce TEE based Trusted Keys doc: keys: Document usage of TEE based Trusted Keys MAINTAINERS: Add entry for TEE based Trusted Keys Documentation/security/keys/index.rst | 1 + Documentation/security/keys/tee-trusted.rst | 93 +++++++++ MAINTAINERS | 9 + drivers/tee/optee/call.c | 7 + drivers/tee/tee_core.c | 6 + drivers/tee/tee_shm.c | 16 +- include/keys/trusted-type.h | 3 + include/keys/trusted_tee.h | 66 +++++++ include/linux/tee_drv.h | 1 + include/uapi/linux/tee.h | 8 + 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 + 14 files changed, 498 insertions(+), 3 deletions(-) create mode 100644 Documentation/security/keys/tee-trusted.rst create mode 100644 include/keys/trusted_tee.h create mode 100644 security/keys/trusted-keys/trusted-tee.c -- 2.7.4