Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp605544ybl; Tue, 7 Jan 2020 11:45:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyHOW9qjdq3OkpRwpKlR67xoqakBiDuyBYBfH2sNFs6bRMp5c4vz2Cuuqh7WZwILpiKgTfl X-Received: by 2002:aca:f1c2:: with SMTP id p185mr30900oih.87.1578426355099; Tue, 07 Jan 2020 11:45:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578426355; cv=none; d=google.com; s=arc-20160816; b=ABdtmJk0vT0JzIrS1GdyuexHSWl8HmS/iqlEg4XMXMKCh8emhVBFekiQbtqpHZ6fWo NydvvfKEBgwPp4NFaDa+lFF8ogX+dXkHd2ByhHZVCq0QiXTpleFGNnIINQ80+h5xrJ52 /TcAZ2Zm4JMMfSBQVVJGMQDokTnJpehdX6lJpeqvr/UjhiXlzRbv9X80LV+MBBEC2Sq0 hTcrwC4R+VivdONqeSFnF184lkz7Gw5FWVELk9eqFPlWXDcdyIht0AXAJi5t2TN6OIAe yrPZMAVuyQaM9potAGF+7dsgFcChj2UeNuHroQV50z8WhPt5bp2qK6AoTCaYs1FG/FW6 xsZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=WXotn1iSKnCuEmTsYF5Dp7o6kjEJuPdeZMzgjAtruXM=; b=FDATt8BoBzr/Par+sNrx478HT88YWISZxCyZOGMQcX4sP7J8W8yWLSjWRqwEOsFOBo /kRGHGdupxIgjlFXlsfpzyxYLEAG5dXwf3PBcbeMRu7ni4NN2OCyhciJnRxQDOjOBzDG C3PvqChKVt7wxbjCJCHqbrSHBhGYFMa9LmzH/gJ9Q1gMD1l6zZF0qSzE7CGikV9W5WqJ ab16cI9ulYqXiskbPqI6D+X3aNfhHVKyPaiTEEy8NV5EqsAztI8ufMcnkQ9eXIUzbJFq +RM5YTWgoFX2fOOR+imUbbT0mYERHIcbpZU7vkZix/ZZL0iAFtTBIBxMwV+X6x7SRUgZ mF1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=tQksiQGL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c79si496625oig.208.2020.01.07.11.45.42; Tue, 07 Jan 2020 11:45:55 -0800 (PST) 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=@linux.microsoft.com header.s=default header.b=tQksiQGL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728708AbgAGTn4 (ORCPT + 99 others); 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