Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2315865ybc; Wed, 13 Nov 2019 12:25:02 -0800 (PST) X-Google-Smtp-Source: APXvYqymtQHNvmfFVpD7vKlc3gi9cLQXppKuSeNsvsrndM0priuWoQhAsbbXQSu6MFUu2LPvH7YL X-Received: by 2002:a05:6402:17f2:: with SMTP id t18mr5896203edy.264.1573676701987; Wed, 13 Nov 2019 12:25:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573676701; cv=none; d=google.com; s=arc-20160816; b=q0TOjki8kpskeCloxWWyZ/m3reXiJwzw+OjhHtYcqhsqh+LNsbJTj49whEMvSd14x3 l99R1i533/6Mwr39FxJC0x82aGxT11GJFHZIaSuXKnXrkUQA/xJipzjUWGVMRYqS16aX EE9+/v5X3VGCGSJJBSRtVzN1vwLAUl7qszae9YtIGJJpDmui1jCBo1nLzzII+s8QmlEn vw+ghVbDsnnwYaMcivdGl9Qi4qExYnDIJVWqzPplibTFZc5yFBV7mXUogKP1Rw0mzOau GRsW/xD14TcVtz9KKxJxygOG6uf3fTBps5m6wMlyz6nLjifbyaY/MzM7aGv5/o+f2vqB VIpw== 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:to:subject:dkim-signature:dkim-filter; bh=I1Mu3IDPJM1nVT/FAj7Eop98xKiNpHueYyROLn+JtY8=; b=g5NYcGonFW9GHDQpjPzNE7KtbfzNt4hj2y2+gP0QA1SbLr0xf24VrK3b53ygdSqXYn JPq/6SKGa63ThCYLperur/OdTPHl6wuR7o2+Il0KDjhxQ5hs41oCFgS8xB9vIWrOl1ID ic03eevUUR/geWgeju5nE4ANOjj2PAGWkpz38xr6bWgOjX0xCev1luQxEBDNdWZXFyMX zhGay+TDiGKcTzTzvguzuEvxAiw4iIqjyMtehA8NB0oF0RVW1YpcnSY8AWry0rWlvBQW dipgFtXhPQ4nPxuRd155oKkH1RYYXA4wI8TR/3aap3Ph2+EU0cmsMwNLOfiuLs0g3R/t ufBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=FDyysCgp; 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 n2si2010263ejx.38.2019.11.13.12.24.37; Wed, 13 Nov 2019 12:25:01 -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=FDyysCgp; 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 S1727021AbfKMUVh (ORCPT + 99 others); Wed, 13 Nov 2019 15:21:37 -0500 Received: from linux.microsoft.com ([13.77.154.182]:48506 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726162AbfKMUVg (ORCPT ); Wed, 13 Nov 2019 15:21:36 -0500 Received: from [10.137.112.111] (unknown [131.107.147.111]) by linux.microsoft.com (Postfix) with ESMTPSA id DD93320B4901; Wed, 13 Nov 2019 12:21:35 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DD93320B4901 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1573676496; bh=I1Mu3IDPJM1nVT/FAj7Eop98xKiNpHueYyROLn+JtY8=; h=Subject:To:References:From:Date:In-Reply-To:From; b=FDyysCgpCSLIzjLEawSdItTK0d6jAoV7kUCnvbf6SvkW9KXwnKHmpHL3Nv14ZZtcM aJtgBRqlWgy02GW8TU4xzGwuP61rn4fqkKZFuTADqOh3WgEBIvJIfQx7oTus9FXsBn 55p8y97k/vEzvC4vMtEUjvBB3OW7mz2FOtN2W9MU= Subject: Re: [PATCH v6 1/3] IMA: Add KEY_CHECK func to measure keys To: Mimi Zohar , dhowells@redhat.com, matthewgarrett@google.com, sashal@kernel.org, jamorris@linux.microsoft.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org References: <20191113184658.2862-1-nramas@linux.microsoft.com> <20191113184658.2862-2-nramas@linux.microsoft.com> <1573676066.4843.18.camel@linux.ibm.com> From: Lakshmi Ramasubramanian Message-ID: <320826aa-f744-f2ae-8693-a6ce9461d886@linux.microsoft.com> Date: Wed, 13 Nov 2019 12:21:56 -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: <1573676066.4843.18.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 On 11/13/2019 12:14 PM, Mimi Zohar wrote: >> @@ -655,6 +655,13 @@ void process_buffer_measurement(const void *buf, int size, >> int action = 0; >> u32 secid; >> >> + /* >> + * If IMA is not yet initialized or IMA policy is empty >> + * then there is no need to measure. >> + */ >> + if (!ima_policy_flag) >> + return; >> + > > This addition has nothing to do with defining a new IMA hook and > should be a separate patch.  This can be posted independently of this > patch set. > > Mimi I'll move this change to a different patch, but it has to be either part of this patch set or the above change alone needs to be taken before this patch set for the following reason: The IMA hook gets called early in the boot process (for example, when builtin_trusted_keys are added). If the above check is not there, ima_get_action() is called and causes kernel panic (since IMA is not yet initialized). thanks, -lakshmi