From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9107C4332F for ; Wed, 19 Oct 2022 18:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229976AbiJSS2y (ORCPT ); Wed, 19 Oct 2022 14:28:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbiJSS2x (ORCPT ); Wed, 19 Oct 2022 14:28:53 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EAE61C5E07 for ; Wed, 19 Oct 2022 11:28:52 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d10so18026465pfh.6 for ; Wed, 19 Oct 2022 11:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=g2hPps6n+imJEzUNlW/VzlKPcj20qPrXntNfgwGKzuY=; b=j+hygSwcxDFsiLQtsX8B8yHklZpdfRny6e8dmyZIbRCaw5sykqsyuUG14hULFoAgqw 9VzbgFATA1wcIkrzNv4rDxOIq3AtbvHiBWS+tcVal2ZZ5abyF79gSZ6IxPvNkito6sjd Ts+tURTA+hvKiPKW94XkQWheSW1wRmHyM6jkA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=g2hPps6n+imJEzUNlW/VzlKPcj20qPrXntNfgwGKzuY=; b=YWpfahVl4ZwHSw5iKCATrRY4MqTZm5eCkr29ga87ucnokqqLomSbJH0ixoIM9FYI4s OyWQJN4eNGuqVaEytq7lM/ccl5isWfparnK91zoFRogmD8ecX56yqz9CouJAIoFFkImO +W4NpXzpbb58cA2Qah+50HjKeqk4YIUEnb0WakratZbrAeAl/mJfHdUJCfLkcdmT6S0L YXiMrjwRwL8wfjElc6PWoeCm3ksvS9egW2QPkUFr/xQ8KEOhvENrmjPJD+4LHTjaMKF3 0y9Ze9PZjeCM2JMlLAGHapgxG75mMRFuH4giMBrk1VYIA427jGIe25OmLehYsylodpHz QF3g== X-Gm-Message-State: ACrzQf3KiSUuZ1Y2O4V0DrvR/gEt1Jx4awQPYeoA/C2CDJIWJIop85+x DFwUEqg8Rsb3q4u6t8gdEGg0P2ZKBMV5dw== X-Google-Smtp-Source: AMsMyM5Tsdbs1rfhpPqYMhH++zf6I2sJgAtJQ0mlvySZTLPWLkPK5emZnVoul9O4mTUM7CIDrTKy5w== X-Received: by 2002:a63:ce54:0:b0:46a:e2a9:c7f6 with SMTP id r20-20020a63ce54000000b0046ae2a9c7f6mr8152760pgi.264.1666204131734; Wed, 19 Oct 2022 11:28:51 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id s6-20020a170902ea0600b0017e232b6724sm566869plg.69.2022.10.19.11.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 11:28:50 -0700 (PDT) Date: Wed, 19 Oct 2022 11:28:49 -0700 From: Kees Cook To: Mimi Zohar Cc: Paul Moore , James Morris , "Serge E. Hallyn" , Dmitry Kasatkin , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , linux-security-module@vger.kernel.org, linux-integrity@vger.kernel.org, KP Singh , Casey Schaufler , John Johansen , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 1/9] integrity: Prepare for having "ima" and "evm" available in "integrity" LSM Message-ID: <202210191114.C64D8ED68B@keescook> References: <20221013222702.never.990-kees@kernel.org> <20221013223654.659758-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Wed, Oct 19, 2022 at 10:34:08AM -0400, Mimi Zohar wrote: > On Thu, 2022-10-13 at 15:36 -0700, Kees Cook wrote: > > Move "integrity" LSM to the end of the Kconfig list and prepare for > > having ima and evm LSM initialization called from the top-level > > "integrity" LSM. > > The securityfs integrity directory and the "iint_cache" are shared > IMA/EVM resources. Just because the "iint_cache" was on an LSM hook, > it should never have been treated as an LSM on its own. IMA maintains > and verifies file data integrity, while EVM maintains and verifies file > metadata integrity. IMA and EVM may both be configured and enabled, or > independently of each other. However, only if either IMA or EVM are > configured and enabled, should the iint_cache be created. There is > absolutely no need for an independent "integrity" LSM. The purpose of this patch was to tie ima and evm into integrity, since the iint_cache is used by both. It's been true since 4.20 that using ima and evm requires that the LSM named "integrity" has been initialized. Since ima and evm have separate indicators for "am I active?" (much like apparmor, etc), it seemed sensible to make ima and evm part of the LSM named "integrity". Other solutions are totally fine! I do note, however, this patch needs to be tweaked for the case where CONFIG_IMA or CONFIG_EVM are not set. -- Kees Cook