Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp151639pxy; Wed, 21 Apr 2021 21:48:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBh5AklU+iBB44Wj3hFUoUO8WX/6S1HGupdAPls5TMfO+Cd9976Dn1lFqFomlpz8iLaD6M X-Received: by 2002:a17:902:8f8d:b029:ea:e059:84a6 with SMTP id z13-20020a1709028f8db02900eae05984a6mr1497899plo.35.1619066881909; Wed, 21 Apr 2021 21:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619066881; cv=none; d=google.com; s=arc-20160816; b=X3R/PnRYAuf2KciEPDm1v7WHJjj020ASwDxyRPPrVHxzLEHbOLJ62UE1OlQNDXQoyw rz//N7/PQbC2K7m2EI555mxZXcy3FHHkf2wcmGEDBoz/xqd1MhrXcwLdYOzIJRUnZBFy vckpauZmHckQNHPltZlTQqlYttFMNOycvAzUWN881Rh23gbtglxW2prX39iBKpzPwSUF Htr8P0ci3bEmaEtdvKl/LcE4L317eIFI+WBjwoTL6+0/SfaOyr+5X9AolD8fdR2dEESy U9F44Wd4zzyDtGH2z2Ec3sacv3ezAW8gE3bMs7yOITgzJk1gW/5n4tYuxSoIt0gW0yrd MQpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=e8xSVHnbnPreLCUm7lSlAXXP6DIoYnAcQ4G8DoJd4po=; b=FMiuMq7UmAmioHFWtqiwpVzrBrUe3b4xU7V5h5mFW+Zo4+0HdfePN9NPW36/JhETda g0IvQHpvSs45q6QpPZwNXzw5ZRG4npE3mQ/V5cO30yZY02sy+tljvgxnCc01BhT+uzyy fQkCQHYi1BDou+o+E+4qTt1AEuA/46tYtJFgVqZs2SVOkVdg+F5SvP+LAupWEIU/Ty04 USlQwLgEsC8I0Ecx1hIlPea99p3KXdIgyiwkPivdyVTbgrszzpFDzLHlW0y3PoFo5Mvq bdNyIwxjysHp54MWTxk5ri3OqkfdnwRkXtwJuo+qakVtfa73WfFzTsjMIPtN94DLzPJd /K6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VtdCM6R6; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si1978375pfi.167.2021.04.21.21.47.50; Wed, 21 Apr 2021 21:48:01 -0700 (PDT) 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=@linaro.org header.s=google header.b=VtdCM6R6; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231303AbhDVErw (ORCPT + 99 others); Thu, 22 Apr 2021 00:47:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbhDVErv (ORCPT ); Thu, 22 Apr 2021 00:47:51 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D696EC06138E for ; Wed, 21 Apr 2021 21:47:16 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id a36so39469123ljq.8 for ; Wed, 21 Apr 2021 21:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e8xSVHnbnPreLCUm7lSlAXXP6DIoYnAcQ4G8DoJd4po=; b=VtdCM6R6wqO20+uZ6bRWiuSnZJL/C81YI/D91nz6KU/GcxI5P46Udak7Pod8u/G0AN rUBQ4rOUoCb3bJZXZTNX72aSGAOqChTfNh+ZMKNNafbKqCyceaw6hKzX3IcLVZoT7+eH pR4/WGEI26z6Y6amHnm0LqCBn4vHu9UjAkGuw+dEImVUgoFM1EDhscrpFf1I/z+8DYgn ku2DgFfh/G82U3PruwU3KeNRw1egaE1iERchBMBjFKN18fKF21aYBCkhqmAbv/g4SmUY L649YW352pvHgX2DwiDn8mDPPtCoQtujbiTyifvWVWSuFxZVNhRv4ael8Ddzcidzm1Hu SdqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e8xSVHnbnPreLCUm7lSlAXXP6DIoYnAcQ4G8DoJd4po=; b=Re0hC+7lLuqmPjMPVnuWCL0IADJ9JrlDDTHFuELyfzszOZz1ycqTAJV5PPea5nmhSG VzHshJDj2zRt7eyUSUD1B7xnC4oFGVCEplmL1OGfMS2vpbwcrSWyq3jYBm6zzhc5Glnr z3TnvBHz2jgXxKLr24PuLB6WLJx5lElFlj8CV7Z1VSTKbXT0p8Am7GfXSMRDpaflwbrQ 7MGrrWmDLKQtOuXAR03a4I6KVh0mgML+FJyabRBmwEwXw4XmWVxaEntakd74mv4CmxMq HwPTm5II1D5B8GqCjFC0u4XHHZHSJGSaFCR4u70djbpQdLwO1DMiJET2v+1GD9kWQqAN GqUw== X-Gm-Message-State: AOAM533mIgRh4cL2LVrKva6LnCsqYCdtN/ej0U5KzO3b9CYny4OVuBEF EpsT98VfmjUYFu6zcdKTce+24aU9WX6PKSkJsFpVPg== X-Received: by 2002:a2e:9e98:: with SMTP id f24mr1134602ljk.442.1619066834900; Wed, 21 Apr 2021 21:47:14 -0700 (PDT) MIME-Version: 1.0 References: <20210301131127.793707-1-sumit.garg@linaro.org> <20210301131127.793707-2-sumit.garg@linaro.org> <65dcc9fa28833e6beb1eadf98b0ed3402404d693.camel@linux.ibm.com> In-Reply-To: From: Sumit Garg Date: Thu, 22 Apr 2021 10:17:02 +0530 Message-ID: Subject: Re: [PATCH v9 1/4] KEYS: trusted: Add generic trusted keys framework To: James Bottomley Cc: Jarkko Sakkinen , Mimi Zohar , David Howells , Jens Wiklander , Jonathan Corbet , James Morris , "Serge E. Hallyn" , Casey Schaufler , Janne Karhunen , Daniel Thompson , Markus Wamser , Luke Hinds , Elaine Palmer , Ahmad Fatoum , "open list:ASYMMETRIC KEYS" , linux-integrity , "open list:SECURITY SUBSYSTEM" , Linux Doc Mailing List , Linux Kernel Mailing List , linux-arm-kernel , op-tee@lists.trustedfirmware.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Apr 2021 at 22:51, James Bottomley wrote: > > On Wed, 2021-04-21 at 16:38 +0530, Sumit Garg wrote: > > Hi James, > > > > On Wed, 21 Apr 2021 at 04:47, James Bottomley > > wrote: > > > On Mon, 2021-03-01 at 18:41 +0530, Sumit Garg wrote: > > > > Current trusted keys framework is tightly coupled to use TPM > > > > device as an underlying implementation which makes it difficult > > > > for implementations like Trusted Execution Environment (TEE) etc. > > > > to provide trusted keys support in case platform doesn't posses a > > > > TPM device. > > > > > > > > Add a generic trusted keys framework where underlying > > > > implementations can be easily plugged in. Create struct > > > > trusted_key_ops to achieve this, which contains necessary > > > > functions of a backend. > > > > > > > > Also, define a module parameter in order to select a particular > > > > trust source in case a platform support multiple trust sources. > > > > In case its not specified then implementation itetrates through > > > > trust sources list starting with TPM and assign the first trust > > > > source as a backend which has initiazed successfully during > > > > iteration. > > > > > > > > Note that current implementation only supports a single trust > > > > source at runtime which is either selectable at compile time or > > > > during boot via aforementioned module parameter. > > > > > > You never actually tested this, did you? I'm now getting EINVAL > > > from all the trusted TPM key operations because of this patch. > > > > > > > Unfortunately, I don't possess a development machine with a TPM > > device. So mine testing was entirely based on TEE as a backend which > > doesn't support any optional parameters. And that being the reason I > > didn't catch this issue at first instance. > > > > Is there any TPM emulation environment available that I can use for > > testing? > > Well use the same as we all use: A software TPM running in the host > coupled with a virtual machine guest for the kernel: > > https://en.opensuse.org/Software_TPM_Emulator_For_QEMU > > It doesn't catch interface issues (like TIS timeouts) but it does catch > TPM operations problems like this patch had. > Thanks for the pointer. I will use it for future testing. -Sumit > James > >