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 8A422C4167B for ; Thu, 30 Nov 2023 23:31:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377261AbjK3XbI (ORCPT ); Thu, 30 Nov 2023 18:31:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377259AbjK3XbG (ORCPT ); Thu, 30 Nov 2023 18:31:06 -0500 Received: from sonic306-28.consmr.mail.ne1.yahoo.com (sonic306-28.consmr.mail.ne1.yahoo.com [66.163.189.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99EA310F3 for ; Thu, 30 Nov 2023 15:31:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1701387069; bh=KKWxRGo/AX4QeEd47QnRsF18S9N8KhU2b2kKz79X0vI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=cAYiTDaGs/kbdlVsXQ3ZuZVFA5TRYHo2+eObt78zh4Sa23pTNIXCb/lNwfjGhZBRE3yRDmtIX7ekIJPpwWEIOPPY/UaKk1sSPFJQ14e0f/0z4OETF936AMsR5Py5CsCkP9lgWuoBA1FD0m8YyDCXpN0IbgR0FVNGsaQDR/zLSCjHbJKZlWGblz+piMqqMGDGX7F75nObo2xfDYJCNWoeYETeUOkMOD0rPg6oJpthTviKibT5+69+TZGpCI6jeBo22c6QbrLjbFTSylFNzn2ZhJoOyRQxdd1kkqF6TofdTqCVgU01rkWlgc8FPnFmesSRu0SY4b7YHDNAFrOEK9zqNw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1701387069; bh=rlV0Ex3CXOdWAchqeNEt2KMDS+yjt068Dx8Y7mNlP0H=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=F0tqQYfSlXR4YHDbnzWKlMxzGKOqi/su9mCSbDwgEAtnFN8aZA551z+edpGH8RIBhrU9hiF7Pl+7ha3w/6gCwm8esgiP3WIckyBeEf1oSBnH5ooSU6fmVbjDA9HUzADBNMiJ06j7AWDYbP+my52iF0aqYypFewN7p0zfWSuBgh+u6RRyCa8vFxVz39iSP1iHPqDIoF90GVzDYOaDoiUSPATBIsSKlBfc06uuehmfN6TyJZ+vIv+aAAsYiLMkyDh624Pe+9+0VPYch2vdO28ufKxjetDg+cLvaumm8nt94e9uVs8ijabUjBbDvPf+nMkBXs6ztQwytL4MeJW+1SJO8g== X-YMail-OSG: RmbhXsgVM1lLhcaU1ne7mR6zpkzpbo7bxmuwrCU.Q2Jz597RECpRfmbO46DOQRX U0xQ5xBsTHuxbwW_TtCdMT2eNLcqB.9MNEIycPBCvxEIMauu4wwWKuCNsriWG17YzxZZSU5mRqMT nD2EjYEowKyCkwCd1Te9jq5klHYvLtxbd4bFcCFL2P1w8RMBLElSfcjca4Z8tSv0mGlkUiuzaWwG RBl1UsJIZ5mMgUmfLV5UijO4mDS6IGYD9xt0Ka4LyErovbxYQNiSnLkPVFektkl4NsrfOmngA95N kkBMRRM69yRal17E5bEl.GEetKRGjxFXrkeFBPBnvUB39vRXM1uJr9lofNBLfPsBFlSRztA01Tb1 2.Ko5WaSMvaFu9MtaEtE8do0rdNJt710nw7v4t951twzPFAuFYKdfw3g6c3dDKSk32l.YGN7bxxE iJ.JRQQCbY2fVGo1dbzVUND6NRrYIQQx_mvHV_T77J0EKmoB5PjOdBf8h3yto2zOuIw_4K1oqMnB lpX7Mviw3TRipQFQS.QYCDE0eCrAnoXTzzpMDP9ypX_zjfS1v60CersA1yjK9TZayQa1yj27zYCe MqYpm4V95Z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Qn_93rK rQZNJx9uSXy3CFcNCVYg1kjBy1w4QY5wUFHRZGYWsRb8tZS5L0TK1T2nESfRDavmjKYLisghlkj7 QNaBx6K.HzYUPfhwXbfw__R9b4WYTEanMfFbzlUq6ybAO3uyGIkBuLxX3wgyowoV81LjD6.NLO_8 Tr6qwmL2AbRU1yUYwz0NvLO7oRfcZKTbTyNhfFDcEa3Ita4cJaCOJHIHz.C.BtPZGz9py3l2F7px qS9ntBjFItpwyIUQpTPVTOqAiUrPEPCu1vpDogaG10Ly6jwQgX8ORMLQrTjxa7GTdDUcLAIe4XKE nW0i27YVQWZ_adsvQMLe9r.GPfyE4j1frSwX6yX6oeFmhTn9LlGIalDQxI_0o8bgkXsGa1EmQVA_ RiYxlCnPZCXI8CHTSqZnmZZV_VYrYTtWvVrbEwin5pQwPjFwuRO3LIu0gblUo89NKTFmd1lcO4Uq E4myoOch9OkxyCzxMlGldOuEwJVh3bsESE2by.o8attKx1pqXAA2bgsWIe0PizFVqkhPGZgZzKmE LHQofP7vj1d2bnbsYYOa_eTnTKkZ9riIwU1ZpMfp7Sfvq5ElUqDevvvjbb7D_ZCPKwCd1L0GRpnU 7gjcZZv9chYJT1qs_._JbUfhRbjnWUQMCk.NIUdYOkvfvi1zd1H8_u5XZrnz_GC.vNA-- X-Sonic-MF: X-Sonic-ID: 765f1964-0fb7-4d81-8316-507c573fc21a Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Thu, 30 Nov 2023 23:31:09 +0000 Received: by hermes--production-gq1-5cf8f76c44-fz47x (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 19b1fe304cad48eecfc9a1ec502551f6; Thu, 30 Nov 2023 23:31:04 +0000 (UTC) Message-ID: <018438d4-44b9-4734-9c0c-8a65f9c605a4@schaufler-ca.com> Date: Thu, 30 Nov 2023 15:31:01 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 23/23] integrity: Switch from rbtree to LSM-managed blob for integrity_iint_cache To: Roberto Sassu , Petr Tesarik , Paul Moore Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, jmorris@namei.org, serge@hallyn.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, dhowells@redhat.com, jarkko@kernel.org, stephen.smalley.work@gmail.com, eparis@parisplace.org, mic@digikod.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-security-module@vger.kernel.org, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, selinux@vger.kernel.org, Roberto Sassu , Casey Schaufler References: <20231107134012.682009-24-roberto.sassu@huaweicloud.com> <17befa132379d37977fc854a8af25f6d.paul@paul-moore.com> <2084adba3c27a606cbc5ed7b3214f61427a829dd.camel@huaweicloud.com> <90eb8e9d-c63e-42d6-b951-f856f31590db@huaweicloud.com> <366a6e5f-d43d-4266-8421-a8a05938a8fd@schaufler-ca.com> <66ec6876-483a-4403-9baa-487ebad053f2@huaweicloud.com> <9297638a-8dab-42ba-8b60-82c03497c9cd@huaweicloud.com> Content-Language: en-US From: Casey Schaufler In-Reply-To: <9297638a-8dab-42ba-8b60-82c03497c9cd@huaweicloud.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: WebService/1.1.21896 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/30/2023 1:34 PM, Roberto Sassu wrote: > On 11/30/2023 5:15 PM, Casey Schaufler wrote: >> On 11/30/2023 12:30 AM, Petr Tesarik wrote: >>> Hi all, >>> >>> On 11/30/2023 1:41 AM, Casey Schaufler wrote: >>>> ... >>>> It would be nice if the solution directly addresses the problem. >>>> EVM needs to be after the LSMs that use xattrs, not after all LSMs. >>>> I suggested LSM_ORDER_REALLY_LAST in part to identify the notion as >>>> unattractive. >>> Excuse me to chime in, but do we really need the ordering in code? >> >> tl;dr - Yes. >> >>>   FWIW >>> the linker guarantees that objects appear in the order they are seen >>> during the link (unless --sort-section overrides that default, but this >>> option is not used in the kernel). Since *.a archive files are used in >>> kbuild, I have also verified that their use does not break the >>> assumption; they are always created from scratch. >>> >>> In short, to enforce an ordering, you can simply list the corresponding >>> object files in that order in the Makefile. Of course, add a big fat >>> warning comment, so people understand the order is not arbitrary. >> >> Not everyone builds custom kernels. > > Sorry, I didn't understand your comment. Most people run a disto supplied kernel. If the LSM ordering were determined only at compile time you could never run a kernel that omitted an LSM. > Everyone builds the kernel, also Linux distros. What Petr was > suggesting was that it does not matter how you build the kernel, the > linker will place the LSMs in the order they appear in the Makefile. > And for this particular case, we have: > > obj-$(CONFIG_IMA)                       += ima/ > obj-$(CONFIG_EVM)                       += evm/ > > In the past, I also verified that swapping these two resulted in the > swapped order of LSMs. Petr confirmed that it would always happen. LSM execution order is not based on compilation order. It is specified by CONFIG_LSM, and may be modified by the LSM_ORDER value. I don't understand why the linker is even being brought into the discussion. > > Thanks > > Roberto