Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3671536rdg; Wed, 18 Oct 2023 02:33:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0CRJbswAGpYhDsv3Jp6F2d3d6TuY4vcZI/an+/f9vFG42HH+LVuFBm2NMXZyJCZPYc94l X-Received: by 2002:a05:6a20:3d8f:b0:151:577:32d1 with SMTP id s15-20020a056a203d8f00b00151057732d1mr5367341pzi.22.1697621616347; Wed, 18 Oct 2023 02:33:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697621616; cv=none; d=google.com; s=arc-20160816; b=rlac5W3EvG5khuHZfkYd6dl4wcfCs7OMMlzBqKrUNv2Fpbis0c+rhwASr5DaOLKcPA dztJa/zb9dnd0QMypduqi8e2oiKv9/6q7EOF22oogLVVEUGzALfYv/PCMPhrbBUla2ma Ks0UVXgW4W9Ccxu/vrvCBDpGzbW+Brfo797XEmgQFB/Yu1MUBVbmmWnvzdukj+2/JZKB O5siomTYbTMQIKqmXfKraBf18Kg/Co123sj+enPpM1NcbCaN4f/upLkIPagYT4t847XS 5o2o+Ewdd4nZVr7A5WXatAIfJSW0xG2iUT2EEDNV368BfSGwey9Py7tmqqI6Q4HIZHFI 2XeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=TtFBy0LrD4YLCP/QytXdcU+J/5GtBTSC6yAyiswItBM=; fh=pKXkorD3iM4dV8YJ1V/KXaGHaslBMM1K24ARfm2xiGA=; b=HQXw8NN54OLvl9NBO07RpSlw34fUMPlCW7H3WOBmjIa8TWvcJ8nW67ULVT0X2PQKNS jPI53GZEvGq3NKSyRTzQ7ss+NHCrNQuEKCYChCT4B1z0SPwVaOs06QqxB5u5x2UAl+US hJN5Oz2JKwnMf87BmQinhbnY9/no0A7pL6z/63tWdvZ85l54EEt+ulEv4zIegEOE2aoF eZD45jbBDAiGHTRQzJKljdlbzMLDvjwYDsMguuHqVpeVT7Q+5hR4uD2+KZaDB/ib9zDu ImldRSTuXvJSOq7JuPQoio0oM1CRpXECR9SDnTlAFa7pbsAJUtvHxJumnBk3fzh3GWuw liqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ip9-20020a17090b314900b002689d34ae8dsi1191757pjb.18.2023.10.18.02.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 02:33:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 990178022C85; Wed, 18 Oct 2023 02:33:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235043AbjJRJdL convert rfc822-to-8bit (ORCPT + 99 others); Wed, 18 Oct 2023 05:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231317AbjJRJcr (ORCPT ); Wed, 18 Oct 2023 05:32:47 -0400 Received: from frasgout13.his.huawei.com (frasgout13.his.huawei.com [14.137.139.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8145120; Wed, 18 Oct 2023 02:31:54 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.18.147.227]) by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4S9QJb3wMRzB03Zw; Wed, 18 Oct 2023 17:18:55 +0800 (CST) Received: from [127.0.0.1] (unknown [10.204.63.22]) by APP2 (Coremail) with SMTP id GxC2BwAHqrXopS9lvfVoAg--.58417S2; Wed, 18 Oct 2023 10:31:29 +0100 (CET) Message-ID: <2637d5294d4a7ae871f1b758f5a30234836e2463.camel@huaweicloud.com> Subject: Re: [PATCH v15 00/11] LSM: Three basic syscalls From: Roberto Sassu To: Paul Moore , Mimi Zohar Cc: Casey Schaufler , linux-security-module@vger.kernel.org, jmorris@namei.org, serge@hallyn.com, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, mic@digikod.net, linux-integrity@vger.kernel.org Date: Wed, 18 Oct 2023 11:31:17 +0200 In-Reply-To: <6f33144c850c40e9438a6de2cf3004e223508755.camel@huaweicloud.com> References: <20230912205658.3432-1-casey.ref@schaufler-ca.com> <20230912205658.3432-1-casey@schaufler-ca.com> <468436cf766732a3cfc55d07ad119a6ccdc815c1.camel@huaweicloud.com> <6f33144c850c40e9438a6de2cf3004e223508755.camel@huaweicloud.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 X-CM-TRANSID: GxC2BwAHqrXopS9lvfVoAg--.58417S2 X-Coremail-Antispam: 1UD129KBjvJXoWxGw4fuF13Zr4xGrWDAw1rXrb_yoW5Ar43pF 4UKa1UKF4kZry0kFn2va1rAw1Yg3yFvryUWr98Jr18Za4qyryFqrW2kFW7ury5Wrn5t34U Zr4YqFyxu34qyaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkjb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxV AFwI0_Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40E x7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x 0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l42xK82IYc2Ij 64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x 8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE 2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42 xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIE c7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07UWE__UUUUU= X-CM-SenderInfo: purev21wro2thvvxqx5xdzvxpfor3voofrz/1tbiAQAOBF1jj5UsaQAAsq X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 18 Oct 2023 02:33:33 -0700 (PDT) On Tue, 2023-10-17 at 18:07 +0200, Roberto Sassu wrote: > On Tue, 2023-10-17 at 11:58 -0400, Paul Moore wrote: > > On Tue, Oct 17, 2023 at 3:01 AM Roberto Sassu > > wrote: > > > On Mon, 2023-10-16 at 11:06 -0400, Paul Moore wrote: > > > > On Mon, Oct 16, 2023 at 8:05 AM Roberto Sassu > > > > wrote: > > > > > > > > > > Sorry, I just noticed LSM_ID_IMA. Since we have the 'integrity' LSM, I > > > > > think it should be LSM_ID_INTEGRITY. > > > > > > > > > > Mimi, all, do you agree? If yes, I send a patch shortly. > > > > > > > > I believe LSM_ID_IMA is the better option, despite "integrity" already > > > > being present in Kconfig and possibly other areas. "IMA" is a > > > > specific thing/LSM whereas "integrity" is a property, principle, or > > > > quality. Especially as we move forward with promoting IMA as a full > > > > and proper LSM, we should work towards referring to it as "IMA" and > > > > not "integrity". > > > > > > > > If anything we should be working to support "IMA" in places where we > > > > currently have "integrity" so that we can eventually deprecate > > > > "integrity". > > > > > > Hi Paul > > > > > > I fully understand your argument. However, 'integrity' has been the > > > word to identify the integrity subsystem since long time ago. > > > > > > Reducing the scope to 'ima' would create some confusion since, while > > > 'ima' is associated to integrity, it would not encompass EVM. > > > > Using LSM_ID_IMA to reference the combination of IMA+EVM makes much > > more sense to me than using LSM_ID_INTEGRITY, especially as we move > > towards promoting IMA+EVM and adopting LSM hooks for integrity > > verification, opening the door for other integrity focused LSMs. > > + Mimi, linux-integrity > > Ok, just to understand before posting v4, the code looks like this: I worked on a new proposal. Let me know what you think. It is available here: https://github.com/robertosassu/linux/tree/ima-evm-lsms-v4-devel-v6 I made IMA and EVM as standalone LSMs and removed 'integrity'. They maintain the same properties of 'integrity', i.e. they are the last and always enabled. During initialization, 'ima' and 'evm' call integrity_iintcache_init(), so that they can get integrity metadata. I added a check to ensure that this function is called only once. I also added the lsmid parameter so that the integrity-specific functions are added under the LSM ID of the caller. I added a new LSM ID for EVM, does not look good that IMA and EVM are represented by LSM_ID_IMA. Finally, I had to drop the patch to remove the rbtree, because without the 'integrity' LSM, space in the security blob cannot be reserved. Since integrity metadata is shared, it cannot be reserved by 'ima' or 'evm'. An intermediate solution would be to keep the 'integrity' LSM just to reserve space in the security blob. Or, we remove the rbtree if/when IMA and EVM use disjoint integrity metadata. Roberto