From patchwork Tue Mar 19 06:06:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10858839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9F5715AC for ; Tue, 19 Mar 2019 06:18:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89CD529555 for ; Tue, 19 Mar 2019 06:18:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DDCA29557; Tue, 19 Mar 2019 06:18:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8083429556 for ; Tue, 19 Mar 2019 06:18:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1035F21A07093; Mon, 18 Mar 2019 23:18:57 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8CD4A211DC092 for ; Mon, 18 Mar 2019 23:18:54 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2019 23:18:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,496,1544515200"; d="scan'208";a="128177379" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga006.jf.intel.com with ESMTP; 18 Mar 2019 23:18:54 -0700 Subject: [PATCH 0/6] security/keys/encrypted: Break module dependency chain From: Dan Williams To: keyrings@vger.kernel.org Date: Mon, 18 Mar 2019 23:06:15 -0700 Message-ID: <155297557534.2276575.16264199708584900090.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Howells , linux-nvdimm@lists.01.org, James Bottomley , ecryptfs@vger.kernel.org, Roberto Sassu , linux-kernel@vger.kernel.org, Jarkko Sakkinen , Tyler Hicks , Mimi Zohar , linux-integrity@vger.kernel.org Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP With v5.1-rc1 all the nvdimm sub-system regression tests started failing because the libnvdimm module failed to load in the qemu-kvm test environment. Critically that environment does not have a TPM. Commit 240730437deb "KEYS: trusted: explicitly use tpm_chip structure..." started to require a TPM to be present for the trusted.ko module to load where there was no requirement for that before. Rather than undo the "fail if no hardware" behavior James points out that the module dependencies can be broken by looking up the key-type by name. Remove the dependencies on the "key_type_trusted" and "key_type_encrypted" symbol exports, and clean up other boilerplate that supported those exports in different configurations. --- Dan Williams (6): security/keys/encrypted: Allow operation without trusted.ko security/keys/encrypted: Clean up request_trusted_key() libnvdimm/security: Drop direct dependency on key_type_encrypted security/keys/ecryptfs: Drop direct dependency on key_type_encrypted security/integrity/evm: Drop direct dependency on key_type_encrypted security/keys/encrypted: Drop export of key_type_encrypted drivers/nvdimm/security.c | 11 ++++- fs/ecryptfs/ecryptfs_kernel.h | 22 ----------- fs/ecryptfs/keystore.c | 12 ++++++ include/keys/encrypted-type.h | 2 - include/linux/key.h | 1 security/integrity/evm/evm_crypto.c | 9 ++++ security/keys/encrypted-keys/Makefile | 3 - security/keys/encrypted-keys/encrypted.c | 35 ++++++++++++++++- security/keys/encrypted-keys/encrypted.h | 12 ------ security/keys/encrypted-keys/masterkey_trusted.c | 46 ---------------------- security/keys/internal.h | 2 - security/keys/key.c | 1 12 files changed, 65 insertions(+), 91 deletions(-) delete mode 100644 security/keys/encrypted-keys/masterkey_trusted.c