Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4663900pxu; Tue, 13 Oct 2020 04:18:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQBA4sZF88aPijTzVZ4or9L3yITNNm//w6ghHQNi9ItusAfVNwBV1yd+GLDgEVCxZW5eBG X-Received: by 2002:a17:906:ad8a:: with SMTP id la10mr32414090ejb.176.1602587919431; Tue, 13 Oct 2020 04:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602587919; cv=none; d=google.com; s=arc-20160816; b=kZbwOQlkKI0/aW+lmk7MMueUX4sAM1t9OIA4Um7vXrq2VurY679flNMCrOYIFifxqx 4eFQtIIsJFooklvUlPf2jeK09d5Q6/5yuxUbPGFjukTq7vgn7x8dQbtkjU+QA+rFqMw0 HyjW8DTkOM8V7t9/Dm5101Y+lereUEEI3sp0Hrf3330PDytyrdOWJJ2XQsWH+9pBuWjk uPQQuW5ZP/JizAsMfxSJdmmgeBHf5xU/zNHcLXoqE9oTFezkerHpPgi+40jwNNI886K2 Va6O+xtDEYV3qfAY1an+JGa8tXy22RJIR5WHrDhWcnoJjJvqqOZRmIhJCE3IeqYfkPKD M3BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=5nv/kZRot8GjHnjeHg/6UrDfAhUhy4/ZSIudE1Pv8FU=; b=lWZejkRQJHJwJpHr9XDJWjJ0kddhdoLzwHoNhNUIa2qCszTRsM6lqV+guaOPD82Hyr 3AzSSM5wgU9FATEq4R3x4RBUv8ReY5ClsckIVScwi4Pj+iERhsOZl7xtZKDdwZ8Caz0F 34QE6qDsph/Lt10U0A1a/XM7M5Ajx0tI5eo8iA2+ZFXnAtN1nzHdDEzhED1yJRWXepbi E6aZp8Q3XrcB/6LslkvrGSbNaaQsyCYN3eoNwgjJKlzDSZnBLMI/5OnFUj8RSxf2w9mx 10poKBs+mBEbsd+BBFlbiRNRvbPYfLB+oGWniuT449V+baVAeFAJBc1TBiopCkNnY6QJ daPg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx26si14559750edb.557.2020.10.13.04.18.17; Tue, 13 Oct 2020 04:18:39 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728351AbgJMBnM (ORCPT + 99 others); Mon, 12 Oct 2020 21:43:12 -0400 Received: from mga03.intel.com ([134.134.136.65]:15405 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728217AbgJMBnM (ORCPT ); Mon, 12 Oct 2020 21:43:12 -0400 IronPort-SDR: v+OHJDtpHHRyvZINB0s/fMjlwR3NasKMz0j1l72Ljqy+NXuqpZ/qVWYXxEcyHefXVPIvwA9Uui HGUiRs15KjUw== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="165890360" X-IronPort-AV: E=Sophos;i="5.77,369,1596524400"; d="scan'208";a="165890360" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 18:43:11 -0700 IronPort-SDR: 8DDZae9ULC1Juos8+m1ku7wGzRyhk40RdQlxcgY5PDbFwqtOn4+rL76R0oYLFE3SMNuTLfHR2/ er29pWA3DMqQ== X-IronPort-AV: E=Sophos;i="5.77,369,1596524400"; d="scan'208";a="463303490" Received: from lusin-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.53.81]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 18:43:06 -0700 Date: Tue, 13 Oct 2020 04:43:04 +0300 From: Jarkko Sakkinen To: Sumit Garg Cc: zohar@linux.ibm.com, jejb@linux.ibm.com, dhowells@redhat.com, jens.wiklander@linaro.org, corbet@lwn.net, jmorris@namei.org, serge@hallyn.com, casey@schaufler-ca.com, janne.karhunen@gmail.com, daniel.thompson@linaro.org, Markus.Wamser@mixed-mode.de, lhinds@redhat.com, keyrings@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, op-tee@lists.trustedfirmware.org, Josh Poimboeuf Subject: Re: [PATCH v7 1/4] KEYS: trusted: Add generic trusted keys framework Message-ID: <20201013014304.GC41176@linux.intel.com> References: <1602065268-26017-1-git-send-email-sumit.garg@linaro.org> <1602065268-26017-2-git-send-email-sumit.garg@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1602065268-26017-2-git-send-email-sumit.garg@linaro.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 03:37:45PM +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, add a module parameter in order to select a particular trust source > in case a platform support multiple trust sources. > > Suggested-by: Jarkko Sakkinen > Signed-off-by: Sumit Garg This is exactly kind of place where I think static_call() should be taken into use, which is a v5.10 feature [1]. For background and context, I'd read [2]. The other thing that I see that does not make much else than additional complexity, is trusted_tpm.ko. We can do with one trusted.ko. I'd also *guess* that the static_call() mechanism does not work accross module boundaries. [1] https://lore.kernel.org/lkml/20201012155542.GA3557765@gmail.com/ [2] https://lwn.net/Articles/815908/ /Jarkko