Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3001312pxa; Tue, 25 Aug 2020 08:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP5h637yAVcZPSHRjWrZs0vfI1mYEPvqp9NS0bJMCe9lcsDr2Iyxc5ZDtsihnck6otVftI X-Received: by 2002:a17:906:27da:: with SMTP id k26mr2644806ejc.319.1598370649770; Tue, 25 Aug 2020 08:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598370649; cv=none; d=google.com; s=arc-20160816; b=v9GcisZHEJBkHNRFHSrOb3VccT0I3H6rzX2G7iak/4SCGnnO9X4AhL/NwtQaf6xiCu znP/bg/7FmJJgY0SwtxRO75tWXeI2jmIfYTectFN2m1wnZTAzdaXcbF34GMeODy8bwnt pigDHbaM8OgDUpFoaU3w5MsLEhclANgtfWGsZxb4n5Dgg6+VmSv+RAfJENIyumnSgl3E C3jknlikSsnLD2y6qg4FzaMowruNXQv85HHCfsHqNvOOjfkXJwECZhbrWzFUFEKmj879 Eg4K8TnT0gcYbZ+66BteVDb8rztfZIT9ju3R5Z4I2+r8L699Ly8+Niix+qOj7a6nhJtl GZ5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=cG0PU1AiCXqIk4eMHJUWBNM5pgMeFVP8Pc2YAFUO1Lo=; b=CHNYmLVe1yruEXcNUmK35VaLP6S+NCcUzcVF74VyshAzM3SKZW34frlvP81b5wt5Vw 9pUVbz4FOvLxKpw2cB2lszYuIobNFP/nghwvoANs6Rhaan3RUx4qqCVdc1r4oRLJdwAr EJdhhxHBfRsXdUvusbtMwi5vMD+6Vre6L58UIZ5o6ERZH1DPUTRmGTk/pLTvzFH5L5Uc OwNdv054bNQqhpUsVNMtQSSBRtUgAbkb0Uum2JgAuD416QTSWPcJ0kodU3UxCyA13gNv ifz02uB00XRlEQhwAwZrJAnvbYedbfzeWz8qSHI/+ozQ1/BYa6f3EWMb4anoPIzlvyAz sSuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=mSj8+R+H; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si7288224ejs.545.2020.08.25.08.50.26; Tue, 25 Aug 2020 08:50:49 -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; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=mSj8+R+H; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727019AbgHYPrA (ORCPT + 99 others); Tue, 25 Aug 2020 11:47:00 -0400 Received: from linux.microsoft.com ([13.77.154.182]:41560 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727011AbgHYPq5 (ORCPT ); Tue, 25 Aug 2020 11:46:57 -0400 Received: from [192.168.0.104] (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id B6F5220B4908; Tue, 25 Aug 2020 08:46:55 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B6F5220B4908 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1598370415; bh=cG0PU1AiCXqIk4eMHJUWBNM5pgMeFVP8Pc2YAFUO1Lo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=mSj8+R+HyTWTccdCmaX3nwvs/qC1Imig3edjrJgu4HulycBCUbGm+F3HHf/nae1yY IHq+ic0DuDVeei+Ezy6lmnMP89du0Dok1QeKMez78ncPIJYfxf3WGtCc88IlTa4RAE /IzxlHbvHQp02qxCLmLTQfN2YaXczm/r9xcZei0g= Subject: Re: [PATCH] IMA: Handle early boot data measurement To: Mimi Zohar , stephen.smalley.work@gmail.com, casey@schaufler-ca.com Cc: tyhicks@linux.microsoft.com, tusharsu@linux.microsoft.com, sashal@kernel.org, jmorris@namei.org, linux-integrity@vger.kernel.org, selinux@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200821231230.20212-1-nramas@linux.microsoft.com> From: Lakshmi Ramasubramanian Message-ID: <307617de-b42d-ac52-6e9e-9e0d16bbc20e@linux.microsoft.com> Date: Tue, 25 Aug 2020 08:46:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/25/20 8:40 AM, Mimi Zohar wrote: > On Fri, 2020-08-21 at 16:12 -0700, Lakshmi Ramasubramanian wrote: >> The current implementation of early boot measurement in >> the IMA subsystem is very specific to asymmetric keys. It does not >> handle early boot measurement of data from other subsystems such as >> Linux Security Module (LSM), Device-Mapper, etc. As a result data, >> provided by these subsystems during system boot are not measured by IMA. >> >> Update the early boot key measurement to handle any early boot data. >> Refactor the code from ima_queue_keys.c to a new file ima_queue_data.c. >> Rename the kernel configuration CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS to >> CONFIG_IMA_QUEUE_EARLY_BOOT_DATA so it can be used for enabling any >> early boot data measurement. Since measurement of asymmetric keys is >> the first consumer of early boot measurement, this kernel configuration >> is enabled if IMA_MEASURE_ASYMMETRIC_KEYS and SYSTEM_TRUSTED_KEYRING are >> both enabled. >> >> Update the IMA hook ima_measure_critical_data() to utilize early boot >> measurement support. > > Please limit the changes in this patch to renaming the functions and/or > files. For example, adding "measure_payload_hash" should be a separate > patch, not hidden here. > Thanks for the feedback Mimi. I'll split this into 2 patches: PATCH 1: Rename files + rename CONFIG PATCH 2: Update IMA hook to utilize early boot data measurement. -lakshmi