Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3576198ybl; Fri, 20 Dec 2019 11:38:54 -0800 (PST) X-Google-Smtp-Source: APXvYqxYHubYXsWaGFnlTA2SPE6ouOCacgi5vXaAHk/p3ysASqzCj8loi8a1HAA15lY6zZBRQBAB X-Received: by 2002:a9d:1d02:: with SMTP id m2mr15590103otm.45.1576870734520; Fri, 20 Dec 2019 11:38:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576870734; cv=none; d=google.com; s=arc-20160816; b=D4rFXiYh8MaETn1TeOvCPyzb7vi+bio+/GJebhef3+73JV8+CBQ970DG0uiE2ctnAC FEvdmBmx9rAvPa5wnvEgV0CG8UpvemydEgRdqhDLCrcSxFSLo1kI9HdO37OkVnuNx42p 4lVl/9fis5WdnaCz/WUUTTRQcqL0SX+SxSmq6AUym+yKx68+ukpU/s/GxCwNUjyhhHyh cqzmBPZDComLa8/AAnYYHXU3Y75UysBpRr9kExcKa1LcgpBwf9FX728Nyqb3BY5kSgj+ 2mv30lkwAGUBbCcgsGWyAFKIBoSFoH3WfA24GjpnV99cDPuTNC8abeCkBVeIljglNgRM r+Mw== 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:cc:to:from:subject; bh=5SfwzvOvIsfyLcasIuI8Y/d9LuIXE3oL8cStezDi6+E=; b=uD0gmhsHIZQLNfkhSNuYxRNdOPiHWqOu+vRhh2x5rgTWo+rp488DtIu2sLGNio2Bws gAWq1R6IC5C8R4iv9N1qHvxppAwjIZZH34gVhOLbBpnyW3dTE3OBv/SBmXCoke6trSL1 o/GMRHfh44+sm8KL48hOkWFYER2gv4pSnFbMyVDVJ/bvruiKKNySRkeltNsPZUGP7aVs lQudYduIkTkdqHwtpdpK4r0ChZN3aKahc2uUtvoy5ugjB1q4Y9cR9fTSzBZYPcFz8qwD PevnuhCYrHkuIjutt1VwHTpL29dIaJH8V0zuxrVddROz690gf8A6Pcoeb/GbF+doU2qj 3Kmg== 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 l17si5304205otk.218.2019.12.20.11.38.41; Fri, 20 Dec 2019 11:38:54 -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 S1727422AbfLTTgp (ORCPT + 99 others); Fri, 20 Dec 2019 14:36:45 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:12142 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727413AbfLTTgp (ORCPT ); Fri, 20 Dec 2019 14:36:45 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBKJJI59131594 for ; Fri, 20 Dec 2019 14:36:44 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2x0xccmvks-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 20 Dec 2019 14:36:44 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Dec 2019 19:36:41 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 20 Dec 2019 19:36:37 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xBKJaaAV60620848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Dec 2019 19:36:37 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DF5D511C05C; Fri, 20 Dec 2019 19:36:36 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC80A11C054; Fri, 20 Dec 2019 19:36:35 +0000 (GMT) Received: from dhcp-9-31-103-79.watson.ibm.com (unknown [9.31.103.79]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 20 Dec 2019 19:36:35 +0000 (GMT) Subject: Re: [PATCH v5 0/2] IMA: Deferred measurement of keys From: Mimi Zohar To: Lakshmi Ramasubramanian , 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 Date: Fri, 20 Dec 2019 14:36:35 -0500 In-Reply-To: <589b893b-52e4-783c-0f32-608ed1cfd7f9@linux.microsoft.com> References: <20191218164434.2877-1-nramas@linux.microsoft.com> <1576868506.5241.65.camel@linux.ibm.com> <589b893b-52e4-783c-0f32-608ed1cfd7f9@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: 19122019-0020-0000-0000-0000039A55B5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19122019-0021-0000-0000-000021F18521 Message-Id: <1576870595.5241.83.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-20_05:2019-12-17,2019-12-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 priorityscore=1501 impostorscore=0 suspectscore=11 spamscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912200143 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-12-20 at 11:25 -0800, Lakshmi Ramasubramanian wrote: > On 12/20/2019 11:01 AM, Mimi Zohar wrote: > > Hi Mimi, > > >> If the kernel is built with both CONFIG_IMA and > >> CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE enabled then the IMA policy > >> must be applied as a custom policy. Not providing a custom policy > >> in the above configuration would result in asymmeteric keys being queued > >> until a custom policy is loaded. This is by design. > > > > I didn't notice the "This is by design" here, referring to the memory > > never being freed.  "This is by design" was suppose to refer to > > requiring a custom policy for measuring keys. > > > > For now, these two patches are queued in the next-integrity-testing > > branch, but I would appreciate your addressing not freeing the memory > > associated with the keys, if a custom policy is not loaded. > > > > Please note that I truncated the 2/2 patch description, as it repeats > > the existing verification example in commit ("2b60c0ecedf8 IMA: Read > > keyrings= option from the IMA policy"). > > > > thanks, > > > > Mimi > > > > Sure - I am fine with truncating the 2/2 patch description. Thanks for > doing that. > > Regarding "Freeing the queued keys if custom policy is not loaded": > > Shall I create a new patch set to address that and have that be reviewed > independent of this patch set? If it is just a single additional patch, feel free to post it without a cover letter. > > Like you'd suggested earlier, we can wait for a certain time, after IMA > is initialized, and free the queue if a custom policy was not loaded. Different types of systems vary in boot time, but perhaps a certain amount of time after IMA is initialized would be consistent.  This would need to work for IoT devices/sensors to servers. Mimi