Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4049928ybl; Tue, 21 Jan 2020 11:54:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwmF0A3GZN3gn4LoaGWfGIM8CQpO97f3WaNlIFP9YZWrwQKyGvojXTxQ+kF5DGZs7vw9xVQ X-Received: by 2002:a9d:1b26:: with SMTP id l35mr4799165otl.307.1579636457088; Tue, 21 Jan 2020 11:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579636457; cv=none; d=google.com; s=arc-20160816; b=llSgNjUCdxd0+xoNdy9H353p0ZoZpXYEoSR0lExOAH+IjUlJhRWSr4TnT5rZ18Xgz9 Vw7731bHQZTzwKSFmyhC4XUTEgQQlyVF9vpLiCg8Hkq9HL37nDLUdGT51qgxr5FkAFF7 PPVg1H5p2KZdb6AqhwrfSob4dawhsAW46LNA3Q3UF77ZPW0ZM+hJ7jZBGdDtGLnSqFWb PwZf5yz47s+3gTnDOo0GYyeOSIsjQjpXlljAmLI1GiPlz4LpmzQPHAoywv6hz7tispRG 8DGHGlFwJyEHaOd6kjhVFWoIgccx20G/PKPxJJ3dr64bKgXUBRmEVJ57hgWLTi3+Iarl Nflw== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:dkim-signature; bh=/imeg6r2ZcEleRGVtYrjW2Qr4U9qhFAuGPTGSBbgcyw=; b=h3ZO6w1BOUu7xzzZT+a2fWrTU4RjOBcZSwcFR/FsHVAuEHno3oMYPW/IIZN0j1am6H qh+wR4p6qSuxigkx+n4Gt7+zeZr8Q+fX2R0y7XbufN0nMhr9UtOMxY9foOFtaNHhPLlB vpcmThJwnyQStj2ThQHzrQz96ASM/kFFMc4QYvnhBspAgMY80Bqx9whd+FCfb4nQDYyB G9nsORcrbufFrFpilIXgHQxJLj+AybBzszLWK4A28fII4lESGdAbDzacaKCTdP5aoL6g Uee8a8qROKjK3TPSB3YFPZUk+5XjBrGsRrLJRB9mz1QJB7QBpeJ7qzK8DoFd4WmAE3vv 5dmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=LfmAYBdF; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=LfmAYBdF; 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=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si22671838otp.111.2020.01.21.11.54.04; Tue, 21 Jan 2020 11:54:17 -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=fail header.i=@hansenpartnership.com header.s=20151216 header.b=LfmAYBdF; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=LfmAYBdF; 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=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728998AbgAUTwe (ORCPT + 99 others); Tue, 21 Jan 2020 14:52:34 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:34568 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727383AbgAUTwe (ORCPT ); Tue, 21 Jan 2020 14:52:34 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id DB1108EE180; Tue, 21 Jan 2020 11:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1579636353; bh=M85fHEK3EDsUo/Rv6a9VBeWoJ6p5EGcRxfPwIERa8tw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=LfmAYBdFolmGBonfM4Y/tZQqZMPvpmHmwAV5x0Mi6HiiAvkPVchq2Q7z5MG9n9xTJ aPKt99MjtpYkN1/MS1prvVVDV52uFM18rPOU/XYKRn/mIhxhwPgn9w2mjpNQzV7fqm Q1g1YWtTqKxivuM7ZCosEmzHeNGcI55OD9O/hdxo= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nlBuNbZXxagS; Tue, 21 Jan 2020 11:52:33 -0800 (PST) Received: from jarvis.lan (unknown [50.35.76.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 072468EE0C9; Tue, 21 Jan 2020 11:52:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1579636353; bh=M85fHEK3EDsUo/Rv6a9VBeWoJ6p5EGcRxfPwIERa8tw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=LfmAYBdFolmGBonfM4Y/tZQqZMPvpmHmwAV5x0Mi6HiiAvkPVchq2Q7z5MG9n9xTJ aPKt99MjtpYkN1/MS1prvVVDV52uFM18rPOU/XYKRn/mIhxhwPgn9w2mjpNQzV7fqm Q1g1YWtTqKxivuM7ZCosEmzHeNGcI55OD9O/hdxo= Message-ID: <1579636351.3390.35.camel@HansenPartnership.com> Subject: Re: [PATCH] IMA: Turn IMA_MEASURE_ASYMMETRIC_KEYS off by default From: James Bottomley To: Mimi Zohar , Lakshmi Ramasubramanian , linux-integrity@vger.kernel.org Cc: sashal@kernel.org, linux-kernel@vger.kernel.org Date: Tue, 21 Jan 2020 11:52:31 -0800 In-Reply-To: <1579634035.5125.311.camel@linux.ibm.com> References: <20200121171302.4935-1-nramas@linux.microsoft.com> <1579628090.3390.28.camel@HansenPartnership.com> <1579634035.5125.311.camel@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-01-21 at 14:13 -0500, Mimi Zohar wrote: > On Tue, 2020-01-21 at 09:34 -0800, James Bottomley wrote: > > On Tue, 2020-01-21 at 09:13 -0800, Lakshmi Ramasubramanian wrote: > > > Enabling IMA and ASYMMETRIC_PUBLIC_KEY_SUBTYPE configs will > > > automatically enable the IMA hook to measure asymmetric keys. > > > Keys created or updated early in the boot process are queued up > > > whether or not a custom IMA policy is provided. Although the > > > queued keys will be freed if a custom IMA policy is not loaded > > > within 5 minutes, it could still cause significant performance > > > impact on smaller systems. > > > > What exactly do you expect distributions to do with this? I can > > tell you that most of them will take the default option, so this > > gets set to N and you may as well not have got the patches upstream > > because you won't be able to use them in any distro with this > > setting. > > > > > This patch turns the config IMA_MEASURE_ASYMMETRIC_KEYS off by > > > default. Since a custom IMA policy that defines key measurement > > > is required to measure keys, systems that require key measurement > > > can enable this config option in addition to providing a custom > > > IMA policy. > > > > Well, no they can't ... it's rather rare nowadays for people to > > build their own kernels. The vast majority of Linux consumers take > > what the distros give them. Think carefully before you decide a > > config option is the solution to this problem. > > James, up until now IMA could be configured, but there wouldn't be > any performance penalty for enabling IMA until a policy was loaded. > With IMA and asymmetric keys enabled, whether or not an IMA policy > is loaded, certificates will be queued. > > My concern is: > - changing the expected behavior In general config options for this are a really bad idea because if the tools only cope with one setting, no-one should ever use the other and if they work with everything there's no need for the option. > - really small devices/sensors being able to queue certificates seems like the answer to this one would be don't queue. I realise it's after the submit design, but what about measuring when the key is added if there's a policy otherwise measure the keyring when the policy is added ... that way no queueing. > This change permits disabling queueing certificates. Whether the > default should be "disabled" is a separate question. I'm open to > comments/suggestions. I'm just giving the general rule of thumb for boolean config options. If it's default Y there likely shouldn't be a config option and if it's default N the feature should likely not be in the kernel at all.