Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1504226ybl; Tue, 3 Dec 2019 08:11:03 -0800 (PST) X-Google-Smtp-Source: APXvYqw1Zf+UG29t8z+ZjMWu4N33dLXRmAKVIF/9nff/S/WGxkeduMWHXM+tiiYmua1Gq4RFKT1X X-Received: by 2002:a05:6830:1608:: with SMTP id g8mr3480412otr.169.1575389463264; Tue, 03 Dec 2019 08:11:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575389463; cv=none; d=google.com; s=arc-20160816; b=v6M1Io9Ar7B6WoIlaVWOxWAqO3fKuY+7RL0x+CfoKdHuvbIFbWM1L8s7mvUbi0w6FG Yi0QpglbGr1g9K1UZwPyWKC/HvsBM8WGsNXL8jLS6Aa5691Rb9wGiyOOVu4kWOYEs74X SmmPLNBgRQuau82rH4xvRUu0SX9Wy380V8dF2ZZ+Cu0s3GTVxWiRrqgGonEpPtWfOri6 y0z3rTzNG6LAvUQvYP4DjFYh5wT/lp1DALsG1bMhf3zLqMoYnn+uVEImqBFstt5zP4bE my1Rlt+NRPjf1QofQJvO1pFboyCcNryllNCsg3Zd4ilDHuLkUMDsgL5XXR4xajoTcq+W VLWg== 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=cA2NvMvX1jL063jiAdOXXSP1Gwaopiy2VeenLg73h9E=; b=o5+BXjlDJ0+wJ9EeFFzkn4S7wMulS9SKzeAIC2vU80/0O+iVUAKZwc90MsI5hidc9I ANi99j4DUXx0Uc6vod2wp9zj+/aKSmMy5YE4eSzeHeW+RyOBec+9w5UqqsCbGHBhch+T nhKIfW0gntwUyc4FnGhI6sl6XX3cgxzmOtpw10PdDV7OnG16JyQly5mGRsH91gPk7bXZ ViQvT1uZ8nXoS0fuD1Zkwd63ZeNrVKR/8ofF9dPasP1opv+LjxSjfO8f0aGHvc21xSBw sBdCSzW5lbwQIbbI9sBWVxiiP+QqlspPBbv1MufunsThrgd4F/Ys105hZ6hDyWQYwElH /Wiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="j0N/i9Wx"; 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 d11si1357958oti.325.2019.12.03.08.10.50; Tue, 03 Dec 2019 08:11:03 -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="j0N/i9Wx"; 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 S1727132AbfLCQJE (ORCPT + 99 others); Tue, 3 Dec 2019 11:09:04 -0500 Received: from linux.microsoft.com ([13.77.154.182]:54174 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727113AbfLCQJC (ORCPT ); Tue, 3 Dec 2019 11:09:02 -0500 Received: from [10.137.112.111] (unknown [131.107.147.111]) by linux.microsoft.com (Postfix) with ESMTPSA id AFB6B20B7185; Tue, 3 Dec 2019 08:09:01 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AFB6B20B7185 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1575389341; bh=cA2NvMvX1jL063jiAdOXXSP1Gwaopiy2VeenLg73h9E=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=j0N/i9Wx4wwKdNtHrm2WiqBSSaRnzd0P4Nju3IvAxxS1CcFNHA3MS/3Q3Os/4QHLJ 2VDp4boCAXWBWDXj/bLxU3qp2OP7YXQDEMkLUN4VO6HVwQAK0bZLSdCq2QjyWVbTG9 gjmLXK0hvdRzNV5jLvVrMYJiEbObjEC6RYJyjR5o= Subject: Re: [PATCH v0 2/2] IMA: Call queue functions to measure keys To: Mimi Zohar , linux-integrity@vger.kernel.org Cc: eric.snowberg@oracle.com, dhowells@redhat.com, matthewgarrett@google.com, sashal@kernel.org, jamorris@linux.microsoft.com, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org References: <20191127025212.3077-1-nramas@linux.microsoft.com> <20191127025212.3077-3-nramas@linux.microsoft.com> <1575331353.4793.471.camel@linux.ibm.com> From: Lakshmi Ramasubramanian Message-ID: Date: Tue, 3 Dec 2019 08:09:20 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <1575331353.4793.471.camel@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for reviewing the changes Mimi. I'll address your comments in the next update. > > Overwriting the initial policy is highly recommended, but not everyone > defines a custom policy.  Should there be a time limit or some other > criteria before deleting the key measurement queue? > > Mimi For the above, I feel checking for the presence of custom policy, if that is possible, would be a more deterministic approach compared to having a time limit. On my machine, systemd loads the custom IMA policy from /etc/ima/ima-policy if that file is present. Is this the recommended way to configure custom IMA policy? If yes, can the IMA initialization function check for the presence of the above file? Another way to address this issue is to define a new CONFIG parameter to determine whether or not to support deferred processing of keys. If this config is chosen, custom IMA policy must be defined. Least preferred option would be to leave the queued keys as is if custom policy is not defined - at the cost of, maybe, a non-trivial amount of kernel memory consumed. If detection of custom policy is not possible, then define a timer to drain the key measurement queue. Please let me know which approach you think is optimal. thanks, -lakshmi