Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp574953pxb; Thu, 21 Jan 2021 14:23:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyalVE0bQr8iMPcPujfMhkgmjakTzTlgSDOV14lKhNmox7RrGt6sFnc7PuNfh4KJ9Bbw3Ac X-Received: by 2002:a05:6402:2211:: with SMTP id cq17mr974363edb.167.1611267822172; Thu, 21 Jan 2021 14:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611267822; cv=none; d=google.com; s=arc-20160816; b=vvtGJYYbi+YmQBfUCxre42x3LlLNGs8XQXojBg/1GynLMjKre0NMzDJJg8FrmkJGzd yGIYpSssLuCU6k9IPB3OMmNsp0vjEm2iMNrlWHSYVrLfV375kTRWTGAZzDnt6tlFdY2N f08JNycbIte688N8LkpiBE3XvL3dO8/7rjbhg5kJpTuZeuHC5ly/i7TBcVP0CP103z6+ XBUosLKchfzNkpVv+3AIsSs/yMwy/Vio7FcJyLVBNgDPcHfdBjIAYvfUfroVkyCU43kg fqVh2kWA4HSM5JtsgwOgbc0xpn2tjLj+YKge6fa8TsS2Mvn0E0Xr/rw6C8VCoIM8es5c qM7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fHf5pD5716DY4hQNzA8ZBU2qW7ZHDAq7BX9GKJElulU=; b=Sn4LjQK2DEEkXwME8qKW56ZnutLsaXmU2uZDumzncVyPCakGz+S+MaJSNb0FXxG6OS LcQVvbbJX99ecQCgU047+qFrx6eZOUTrfLw4xfqgdfJjX7/MlEi0pJ1uVycSdto4xRZ4 6zFc3/XRIEY1dw2J9p4ZKnY2Btda+MdCFb7IwoTnks6X5v0Dbgf6mOy/lSsST8DohlKZ dVKgmALBuzLVXAhESluzZK9pcgZOtwnv5vCGeMCMIVyqUEbsaX4YWKdDMxD4mtfByEz2 jjQcQiZjhZAz/wELQ+Wr8jEo5LMz36n+N5E/1dOvP1yfm9rVfQF8mt1IvmmcN4lJk5fp gpJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gZ2nE1nW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz26si2232603ejb.181.2021.01.21.14.23.18; Thu, 21 Jan 2021 14:23:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gZ2nE1nW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728737AbhAUAws (ORCPT + 99 others); Wed, 20 Jan 2021 19:52:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:53188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731633AbhAUAD2 (ORCPT ); Wed, 20 Jan 2021 19:03:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C55DB2368A; Thu, 21 Jan 2021 00:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611187313; bh=Eh0u5i8AW4x9ntLsFlUAc6rlbY2JykroCggN1fE25ec=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gZ2nE1nWc5IEdueOVVKR9vTP5loybR/I49ORFIwya9nGkp8IRtTWQXNmdnpsV9SHt IbC4NVTSRTaW/UTjXdq3t02Fixqlc484JqdK3sdr59lnUVQTR5HL2nmYDC4pzq1Zdl qtVGeiJMy2stNYuVaJGshQIh1w82JdOV4Txew7VIhlSAW1jXPry/NY4csB5Ch2gHbo UifuHCqGdSgu/kcRvIlwwIsX4+vTLbjmba7Rh6/dmaKun51d+pSOHgGzYj48BPQMmL N8XAe+Ze+T3z+dF15H49ScwHfVm4IiTfiLegna6iqRUOAFensVr6vH+u3F/YwcZ+rf 3owAiDsd4Zxqg== Date: Thu, 21 Jan 2021 02:01:46 +0200 From: Jarkko Sakkinen To: Sumit Garg Cc: Jarkko Sakkinen , Mimi Zohar , James Bottomley , David Howells , Jens Wiklander , Jonathan Corbet , James Morris , "Serge E. Hallyn" , Casey Schaufler , Janne Karhunen , Daniel Thompson , Markus Wamser , Luke Hinds , "open list:ASYMMETRIC KEYS" , linux-integrity@vger.kernel.org, "open list:SECURITY SUBSYSTEM" , Linux Doc Mailing List , Linux Kernel Mailing List , linux-arm-kernel , op-tee@lists.trustedfirmware.org Subject: Re: [PATCH v8 2/4] KEYS: trusted: Introduce TEE based Trusted Keys Message-ID: References: <1604419306-26105-1-git-send-email-sumit.garg@linaro.org> <1604419306-26105-3-git-send-email-sumit.garg@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 12:53:28PM +0530, Sumit Garg wrote: > On Wed, 20 Jan 2021 at 07:01, Jarkko Sakkinen wrote: > > > > On Tue, Jan 19, 2021 at 12:30:42PM +0200, Jarkko Sakkinen wrote: > > > On Fri, Jan 15, 2021 at 11:32:31AM +0530, Sumit Garg wrote: > > > > On Thu, 14 Jan 2021 at 07:35, Jarkko Sakkinen wrote: > > > > > > > > > > On Wed, Jan 13, 2021 at 04:47:00PM +0530, Sumit Garg wrote: > > > > > > Hi Jarkko, > > > > > > > > > > > > On Mon, 11 Jan 2021 at 22:05, Jarkko Sakkinen wrote: > > > > > > > > > > > > > > On Tue, Nov 03, 2020 at 09:31:44PM +0530, Sumit Garg wrote: > > > > > > > > Add support for TEE based trusted keys where TEE provides the functionality > > > > > > > > to seal and unseal trusted keys using hardware unique key. > > > > > > > > > > > > > > > > Refer to Documentation/tee.txt for detailed information about TEE. > > > > > > > > > > > > > > > > Signed-off-by: Sumit Garg > > > > > > > > > > > > > > I haven't yet got QEMU environment working with aarch64, this produces > > > > > > > just a blank screen: > > > > > > > > > > > > > > ./output/host/usr/bin/qemu-system-aarch64 -M virt -cpu cortex-a53 -smp 1 -kernel output/images/Image -initrd output/images/rootfs.cpio -serial stdio > > > > > > > > > > > > > > My BuildRoot fork for TPM and keyring testing is located over here: > > > > > > > > > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/buildroot-tpmdd.git/ > > > > > > > > > > > > > > The "ARM version" is at this point in aarch64 branch. Over time I will > > > > > > > define tpmdd-x86_64 and tpmdd-aarch64 boards and everything will be then > > > > > > > in the master branch. > > > > > > > > > > > > > > To create identical images you just need to > > > > > > > > > > > > > > $ make tpmdd_defconfig && make > > > > > > > > > > > > > > Can you check if you see anything obviously wrong? I'm eager to test this > > > > > > > patch set, and in bigger picture I really need to have ready to run > > > > > > > aarch64 environment available. > > > > > > > > > > > > I would rather suggest you to follow steps listed here [1] as to test > > > > > > this feature on Qemu aarch64 we need to build firmwares such as TF-A, > > > > > > OP-TEE, UEFI etc. which are all integrated into OP-TEE Qemu build > > > > > > system [2]. And then it would be easier to migrate them to your > > > > > > buildroot environment as well. > > > > > > > > > > > > [1] https://lists.trustedfirmware.org/pipermail/op-tee/2020-May/000027.html > > > > > > [2] https://optee.readthedocs.io/en/latest/building/devices/qemu.html#qemu-v8 > > > > > > > > > > > > -Sumit > > > > > > > > > > Can you provide 'keyctl_change'? Otherwise, the steps are easy to follow. > > > > > > > > > > > > > $ cat keyctl_change > > > > diff --git a/common.mk b/common.mk > > > > index aeb7b41..663e528 100644 > > > > --- a/common.mk > > > > +++ b/common.mk > > > > @@ -229,6 +229,7 @@ BR2_PACKAGE_OPTEE_TEST_SDK ?= $(OPTEE_OS_TA_DEV_KIT_DIR) > > > > BR2_PACKAGE_OPTEE_TEST_SITE ?= $(OPTEE_TEST_PATH) > > > > BR2_PACKAGE_STRACE ?= y > > > > BR2_TARGET_GENERIC_GETTY_PORT ?= $(if > > > > $(CFG_NW_CONSOLE_UART),ttyAMA$(CFG_NW_CONSOLE_UART),ttyAMA0) > > > > +BR2_PACKAGE_KEYUTILS := y > > > > > > > > # All BR2_* variables from the makefile or the environment are appended to > > > > # ../out-br/extra.conf. All values are quoted "..." except y and n. > > > > diff --git a/kconfigs/qemu.conf b/kconfigs/qemu.conf > > > > index 368c18a..832ab74 100644 > > > > --- a/kconfigs/qemu.conf > > > > +++ b/kconfigs/qemu.conf > > > > @@ -20,3 +20,5 @@ CONFIG_9P_FS=y > > > > CONFIG_9P_FS_POSIX_ACL=y > > > > CONFIG_HW_RANDOM=y > > > > CONFIG_HW_RANDOM_VIRTIO=y > > > > +CONFIG_TRUSTED_KEYS=y > > > > +CONFIG_ENCRYPTED_KEYS=y > > > > > > > > > After I've successfully tested 2/4, I'd suggest that you roll out one more > > > > > version and CC the documentation patch to Elaine and Mini, and clearly > > > > > remark in the commit message that TEE is a standard, with a link to the > > > > > specification. > > > > > > > > > > > > > Sure, I will roll out the next version after your testing. > > > > > > Thanks, I'll try this at instant, and give my feedback. > > > > I bump into this: > > > > $ make run-only > > ln -sf /home/jarkko/devel/tpm/optee/build/../out-br/images/rootfs.cpio.gz /home/jarkko/devel/tpm/optee/build/../out/bin/ > > ln: failed to create symbolic link '/home/jarkko/devel/tpm/optee/build/../out/bin/': No such file or directory > > make: *** [Makefile:194: run-only] Error 1 > > > > Could you check if the following directory tree is built after > executing the below command? > > $ make -j`nproc` > CFG_IN_TREE_EARLY_TAS=trusted_keys/f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c > > $ tree out/bin/ > out/bin/ > ├── bl1.bin -> /home/sumit/build/optee/build/../trusted-firmware-a/build/qemu/release/bl1.bin > ├── bl2.bin -> /home/sumit/build/optee/build/../trusted-firmware-a/build/qemu/release/bl2.bin > ├── bl31.bin -> > /home/sumit/build/optee/build/../trusted-firmware-a/build/qemu/release/bl31.bin > ├── bl32.bin -> > /home/sumit/build/optee/build/../optee_os/out/arm/core/tee-header_v2.bin > ├── bl32_extra1.bin -> > /home/sumit/build/optee/build/../optee_os/out/arm/core/tee-pager_v2.bin > ├── bl32_extra2.bin -> > /home/sumit/build/optee/build/../optee_os/out/arm/core/tee-pageable_v2.bin > ├── bl33.bin -> > /home/sumit/build/optee/build/../edk2/Build/ArmVirtQemuKernel-AARCH64/RELEASE_GCC49/FV/QEMU_EFI.fd > ├── Image -> /home/sumit/build/optee/build/../linux/arch/arm64/boot/Image > └── rootfs.cpio.gz -> > /home/sumit/build/optee/build/../out-br/images/rootfs.cpio.gz > > 0 directories, 9 files > > -Sumit I actually spotted a build error that was unnoticed last time: make[2]: Entering directory '/home/jarkko/devel/tpm/optee/edk2/BaseTools/Tests' /bin/sh: 1: python: not found I'd prefer not to install Python2. It has been EOL over a year. /Jarkko