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 1C200C61DA4 for ; Thu, 9 Mar 2023 07:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbjCIH5R (ORCPT ); Thu, 9 Mar 2023 02:57:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbjCIH4w (ORCPT ); Thu, 9 Mar 2023 02:56:52 -0500 Received: from frasgout12.his.huawei.com (frasgout12.his.huawei.com [14.137.139.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48172DDF1F; Wed, 8 Mar 2023 23:55:59 -0800 (PST) Received: from mail02.huawei.com (unknown [172.18.147.227]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4PXLq30TqLz9v7c5; Thu, 9 Mar 2023 15:46:39 +0800 (CST) Received: from roberto-ThinkStation-P620 (unknown [10.204.63.22]) by APP2 (Coremail) with SMTP id GxC2BwBnNl32kAlk6WSBAQ--.23696S2; Thu, 09 Mar 2023 08:55:40 +0100 (CET) Message-ID: <070d4006cd7d0ee1b2cf4e0dd7e4d5c7be2bcb65.camel@huaweicloud.com> Subject: Re: [PATCH v2] security: Introduce LSM_ORDER_LAST and set it for the integrity LSM From: Roberto Sassu To: Mimi Zohar , dmitry.kasatkin@gmail.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com Cc: linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, keescook@chromium.org, Roberto Sassu Date: Thu, 09 Mar 2023 08:55:33 +0100 In-Reply-To: References: <20230308171119.1784326-1-roberto.sassu@huaweicloud.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.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IYCTnIWIevJa73UjIFyTuYvjxUOyCJDUUUU X-CM-SenderInfo: purev21wro2thvvxqx5xdzvxpfor3voofrz/1tbiAgALBF1jj4Zd2wAAs8 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2023-03-08 at 19:23 -0500, Mimi Zohar wrote: > On Wed, 2023-03-08 at 18:11 +0100, Roberto Sassu wrote: > > From: Roberto Sassu > > > > Introduce LSM_ORDER_LAST, to satisfy the requirement of LSMs willing to be > > the last, e.g. the 'integrity' LSM, without changing the kernel command > > line or configuration. > > ^needing to be last Ok. > > Also, set this order for the 'integrity' LSM. While not enforced, this is > > the only LSM expected to use it. > > > > Similarly to LSM_ORDER_FIRST, LSMs with LSM_ORDER_LAST are always enabled > > and put at the end of the LSM list. > > > > Finally, for LSM_ORDER_MUTABLE LSMs, set the found variable to true if an > > LSM is found, regardless of its order. In this way, the kernel would not > > wrongly report that the LSM is not built-in in the kernel if its order is > > LSM_ORDER_LAST. > > > > Fixes: 79f7865d844c ("LSM: Introduce "lsm=" for boottime LSM selection") > > Signed-off-by: Roberto Sassu > > Thanks, Roberto. With this patch, 'integrity' can be safely removed > from CONFIG_LSM definitions. Perfect, will add the new patch. Thanks Roberto