Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp73203img; Tue, 19 Mar 2019 16:03:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLJNCnPABNX5qxa66w2Keil59OQbNT8IkNC3EllDMem4W199Lto8CEXEMWDcCwCvRvoj94 X-Received: by 2002:a17:902:e3:: with SMTP id a90mr27385712pla.45.1553036612609; Tue, 19 Mar 2019 16:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553036612; cv=none; d=google.com; s=arc-20160816; b=PcH3xeIAQhtd/eWTSTmjbfQ1dS95AqC9ajxenCLFx/0jhkM1vm7bMJfN+27JkoIO6Q nC+ItDlX1epDC+e1GJwZEml25RRR4eZ4HWSn7u6PMbz42/M4+yufgWXPlkF0IUx0w5xZ yu4P6oQ72ICHsXOfY2CC5Ean8miEpcuG0TAdMeKI3enwoMWBoAb5gYr5Evia+wLLuZRF EDNpe7MCMj5o9C2/2IJ5ickEfPw70sokqBgekJp/+0dRfWHNpJd4CA4axmSUTZhWMubJ xqKYwP9jB2k06wryr8Ow+7cFb1REh+emWepG1v9tQ1ZmvNNRgGtL50/D3FajYyOieZTI Sdwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VoLgzKOhBZS0FoA/bvGhth2HeRfby/EH6YEfcTaXC+g=; b=rf7gHWN+GGmlTVn+1L5B4d3ZrBI0zio5OeXGGBngblM4eqJma9RlGIukQPrk7EQabo qSp7b7GydkiQZTPprHVikB4LKKPmH9fMBUbs9MitoZroDHUUYIk/NbBcraNifpIu/G7q XnL9+ux7fK71lj7gPcnWPFFAfu2kPwg1zBxs4j78AgSkjlVGfN9z2903Ay3m5XrKbj/E 3F+Fvy9HzFEAsRRrAmxP2TRh3OBQWNIGc9BWpfDftb7XUU/DJBjzgZaGiGw+rCmnJVE6 7ZcqGGV/ZAGaDXb0dI1Kz9l9ZFNjnwoEaK+QfoX/ucrR8h+r3l0chHbmDa3VBJJRDp9C 2K9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=nVUP5i5I; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17si67837pgj.574.2019.03.19.16.03.16; Tue, 19 Mar 2019 16:03:32 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=nVUP5i5I; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727117AbfCSXCD (ORCPT + 99 others); Tue, 19 Mar 2019 19:02:03 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:46819 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726773AbfCSXCD (ORCPT ); Tue, 19 Mar 2019 19:02:03 -0400 Received: by mail-oi1-f195.google.com with SMTP id x188so262984oia.13 for ; Tue, 19 Mar 2019 16:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VoLgzKOhBZS0FoA/bvGhth2HeRfby/EH6YEfcTaXC+g=; b=nVUP5i5IAvtqFBTNe+PxuhknsP0XXvasCvVemcgBZZbqhFQoGHYQee0YivP6GzRaah OW32ER83bIbna/Cmn27GOoU26o7UrZyz4i3vRNWHoDVMUd+avYibMRm7+nqgy3cgCD3X DRZSZztIEbsexl0kGnew2VMYLrHM6dPd+1qJ46NYpMTo3a1YgIEFo175ruK/AJ77AGsE xyyg8Bg3r2phCUnhZIQ/25Hpv41Et/3BVlG6aBsygf1axMpj1e7M9O2jzpijdKW13lFY dHYTgUJoPCTMd/bLG/edZX2rXoumuL3LOaCJiSVQZopyjxhYdexg8DinMK+b71h1Wp5x bvrQ== 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=VoLgzKOhBZS0FoA/bvGhth2HeRfby/EH6YEfcTaXC+g=; b=VOXSXLodwomeS5nxjSMKmdDEvXsyfNiMoPqG/QxvSPTLh4xRNVtaDHOQa4yK4CSURF QWECrpUhlBLUPW3ug0rcGVp7GQpym8PzOHZCQJr9zVthCxkABHx2vcpb5Vykwnu5M2ws cXUUWSer2IQ8VZ3kRONwg5mvmZbqbW5w9t1x7Mv1Owqf71MAtjrbZ8ejU4bLYVWIP4NF Xgl3WstURyYDRhD+FgbNsTKYPWQa/1dSWHtja4QeXJ55NS4FjHVB6XVo8v8hc+fqE0q9 VBavHWqp3JC3iSc5AzwAUZo4H4xlanFmKZZgYKra1DyCtozUA5Lzc4DOnIKnOMlE/VRD W1TQ== X-Gm-Message-State: APjAAAVEePmFA5B4f/H9991LsyrsuUztrJHpnLjHOQRoefmRkoUkDuQT 8WFejR2ojXKjeZo4S3r24JiyXaCDUWMYtT9Adlpung== X-Received: by 2002:aca:aa57:: with SMTP id t84mr3204872oie.149.1553036522625; Tue, 19 Mar 2019 16:02:02 -0700 (PDT) MIME-Version: 1.0 References: <155295271345.1945351.6465460744078693578.stgit@dwillia2-desk3.amr.corp.intel.com> <1552955080.2785.26.camel@linux.ibm.com> <1553036189.4899.136.camel@linux.ibm.com> In-Reply-To: <1553036189.4899.136.camel@linux.ibm.com> From: Dan Williams Date: Tue, 19 Mar 2019 16:01:51 -0700 Message-ID: Subject: Re: [PATCH] security/keys/trusted: Allow operation without hardware TPM To: Mimi Zohar Cc: James Bottomley , Jarkko Sakkinen , "linux-nvdimm@lists.01.org" , Roberto Sassu , Linux Kernel Mailing List , David Howells , keyrings@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 19, 2019 at 3:56 PM Mimi Zohar wrote: > > Hi Dan, > > On Mon, 2019-03-18 at 17:30 -0700, Dan Williams wrote: > > Sorry for the late reply. > > > On Mon, Mar 18, 2019 at 5:24 PM James Bottomley wrote: > > > > > > On Mon, 2019-03-18 at 16:45 -0700, Dan Williams wrote: > > > > Rather than fail initialization of the trusted.ko module, arrange for > > > > the module to load, but rely on trusted_instantiate() to fail > > > > trusted-key operations. > > > > > > What actual problem is this fixing? To me it would seem like an > > > enhancement to make the trusted module fail at load time if there's no > > > TPM rather than waiting until first use to find out it can never work. > > > Is there some piece of user code that depends on the successful > > > insertion of trusted.ko? > > > > The module dependency chain relies on it. If that can be broken that > > would also be an acceptable fix. > > > > I found this through the following dependency chain: libnvdimm.ko -> > > encrypted_keys.ko -> trusted.ko. > > > > "key_type_trusted" is the symbol that encrypted_keys needs regardless > > of whether the tpm is present. > > Commit 982e617a313b ("encrypted-keys: remove trusted-keys dependency") > removed the dependency on trusted keys. masterkey_trusted.c should > only be included if "CONFIG_TRUSTED_KEYS" is enabled. Is > CONFIG_TRUSTED_KEYS enabled? Yes, TRUSTED_KEYS is enabled, the module is built/available, and tries to load when encrypted_keys.ko loads. The problem is that it fails to load due an error returned from init_trusted(). The error is new for v5.1. So, instead of requiring the module dependencies to resolve successfully, and init_trusted() to return 0, the proposal is to just lookup the key types by name.