From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 914A2C33C9B for ; Tue, 7 Jan 2020 19:43:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6944420848 for ; Tue, 7 Jan 2020 19:43:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="tQksiQGL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbgAGTn4 (ORCPT ); Tue, 7 Jan 2020 14:43:56 -0500 Received: from linux.microsoft.com ([13.77.154.182]:34188 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728384AbgAGTnz (ORCPT ); Tue, 7 Jan 2020 14:43:55 -0500 Received: from nramas-ThinkStation-P520.corp.microsoft.com (unknown [131.107.174.108]) by linux.microsoft.com (Postfix) with ESMTPSA id 523E72007683; Tue, 7 Jan 2020 11:43:54 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 523E72007683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1578426234; bh=WXotn1iSKnCuEmTsYF5Dp7o6kjEJuPdeZMzgjAtruXM=; h=From:To:Cc:Subject:Date:From; b=tQksiQGLBVmnl3G2L1YmWnC0O1yK837EQZwDmMfDuhiQKynyq7CgUiemLfgpblsms mLq/l6byFh6QZ4YG4QTvgPciMO6ejyx9hQBT/9Hi4phAPvzxWIFJ3X8a3uQ9jwZsBx YHVuaC/2AyR524O0oVlCslwFS9ULsKqUToXYsmZQ= From: Lakshmi Ramasubramanian To: zohar@linux.ibm.com, James.Bottomley@HansenPartnership.com, linux-integrity@vger.kernel.org Cc: eric.snowberg@oracle.com, dhowells@redhat.com, mathew.j.martineau@linux.intel.com, matthewgarrett@google.com, sashal@kernel.org, jamorris@linux.microsoft.com, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org Subject: [PATCH 0/4] KEYS: Measure keys when they are created or updated Date: Tue, 7 Jan 2020 11:43:46 -0800 Message-Id: <20200107194350.3782-1-nramas@linux.microsoft.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 88e70da170e8 ("IMA: Define an IMA hook to measure keys") in next-integrity added an IMA hook to measure keys when they are created or updated in the system. This hook is defined in ima_asymmetric_keys.c which was built if CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was defined. But this config is a tristate (and not a bool type). If CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was set to "m" in the .config, ima_asymmetric_keys.c was built as a kernel module when it is not a kernel module. This issue was reported by "kbuild test robot ". This change defines a new config namely CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS to enable building ima_asymmetric_keys.c. This new config is enabled when both CONFIG_IMA and CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE are defined. Lakshmi Ramasubramanian (4): IMA: Define an IMA hook to measure keys KEYS: Call the IMA hook to measure keys IMA: Add support to limit measuring keys IMA: Read keyrings= option from the IMA policy Documentation/ABI/testing/ima_policy | 10 ++- include/linux/ima.h | 14 +++ security/integrity/ima/Kconfig | 9 ++ security/integrity/ima/Makefile | 1 + security/integrity/ima/ima.h | 8 +- security/integrity/ima/ima_api.c | 8 +- security/integrity/ima/ima_appraise.c | 4 +- security/integrity/ima/ima_asymmetric_keys.c | 58 +++++++++++++ security/integrity/ima/ima_main.c | 9 +- security/integrity/ima/ima_policy.c | 91 ++++++++++++++++++-- security/keys/key.c | 10 +++ 11 files changed, 204 insertions(+), 18 deletions(-) create mode 100644 security/integrity/ima/ima_asymmetric_keys.c -- 2.17.1