Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2317075ybc; Wed, 13 Nov 2019 12:26:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxsURbAaf5hWaRvLWE1bdTPRDOvaQyUTBb8dW/y+UB4xHtl/6q0QkILE8REGfJqU2O6cFgb X-Received: by 2002:a17:906:9481:: with SMTP id t1mr4922796ejx.0.1573676779750; Wed, 13 Nov 2019 12:26:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573676779; cv=none; d=google.com; s=arc-20160816; b=CyFAGnKlNS7G1xJfQ5+b+71fjWgAQq9LhPWqQbKC3+ogsZ6Wsju8xoflF5xpomBh4b gpTVCxdCTbwenjPQI0nlLzU14aEOZNcx799Vno/CB9Xx8o2aKgu8M6SwP38DTVKfArIX FLX6PVFC2ypI7hDZOKErR67xymTWGjx4UAn+2Vtb0EH5e/2S1vE9sE2XMMqVxhu/fq6T NQnM3tgivZBvm0jcu2FQtjKgtajxoGF7X7g+C9iGdDXmlr/vq/DU5pvzTNL14XwA1rbF sDxVqh1NllcOo2m61tDIMeCn9NiVPGustg0sjidAT7ASZXAY4onlkm4zsOIvO9UUcJ0v INkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:to:from:subject; bh=XEO5qhcKkHmHa4+D18dxISrPIY8E0tWTCi4Wp2B3ouI=; b=zSdwyzYe7XrUaPNI34slTXWjEI7Q2gWJtZ7hvKBZ0VNEtD2EsTtgiBl7gIHEYKnAQI I/AviJ1DTTEyPH6pyAf7SOP3IDhsCi8OW842PN71mPwlHT2vOexvKCi5+yzBgxx5QIZy loV/d2kJj5cQfelJp0OFVU7liogoXG9Z3DwbPs8rVyWAJoqzui4TNUb0D5xY1kY1Kors eUSOTagfoUw9cMMiCSDfNQ2WM7qTGj5RMx4CmT3q/Uh4VKI0F0zkbuKNClsn2t8cb8N9 Tg9yxpO9XRk+mz11EMAOKiXWkCV8hym5JjrJQlzMDHBtvqNymROwOkwP/clQ3rK1rHsT Hk+g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11si1929807ejq.208.2019.11.13.12.25.54; Wed, 13 Nov 2019 12:26:19 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726912AbfKMUZC (ORCPT + 99 others); Wed, 13 Nov 2019 15:25:02 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58358 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726179AbfKMUZC (ORCPT ); Wed, 13 Nov 2019 15:25:02 -0500 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xADKLp8C067025 for ; Wed, 13 Nov 2019 15:25:00 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2w8q1tbr01-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Nov 2019 15:25:00 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Nov 2019 20:24:58 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 13 Nov 2019 20:24:54 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xADKOres47185922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Nov 2019 20:24:53 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A392C42049; Wed, 13 Nov 2019 20:24:53 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C02D4203F; Wed, 13 Nov 2019 20:24:52 +0000 (GMT) Received: from dhcp-9-31-103-201.watson.ibm.com (unknown [9.31.103.201]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 13 Nov 2019 20:24:52 +0000 (GMT) Subject: Re: [PATCH v6 1/3] IMA: Add KEY_CHECK func to measure keys From: Mimi Zohar To: Lakshmi Ramasubramanian , 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 Date: Wed, 13 Nov 2019 15:24:52 -0500 In-Reply-To: <320826aa-f744-f2ae-8693-a6ce9461d886@linux.microsoft.com> References: <20191113184658.2862-1-nramas@linux.microsoft.com> <20191113184658.2862-2-nramas@linux.microsoft.com> <1573676066.4843.18.camel@linux.ibm.com> <320826aa-f744-f2ae-8693-a6ce9461d886@linux.microsoft.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19111320-0012-0000-0000-000003636213 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19111320-0013-0000-0000-0000219ED864 Message-Id: <1573676692.4843.20.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-11-13_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1910280000 definitions=main-1911130167 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-11-13 at 12:21 -0800, Lakshmi Ramasubramanian wrote: > 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). It will be upstreamed prior to this patch set. Mimi