Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4854970rwi; Mon, 17 Oct 2022 11:40:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gYlMI03tKmmdEJ763oDmnQyoXevOINIwEQ5tUNWXqCFZaP4yXjvPuVxVuMoFJgQUmskIE X-Received: by 2002:a17:90b:3e82:b0:20d:2fa1:d071 with SMTP id rj2-20020a17090b3e8200b0020d2fa1d071mr34782428pjb.58.1666032059525; Mon, 17 Oct 2022 11:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666032059; cv=none; d=google.com; s=arc-20160816; b=YtDKahpXpxcu74mTmUxtzSpOBZ3L4DxqxnPfC/mGm/O64hK5ptKwK8jRgvnG78pBhm sKRos2PFnPNxdyE4GndWM+Qh88PSAh8d2O7AU5UorYAoDVPuvn93ppeyNOf+TBHsug1s VPmBQdjzp8UsJMoIwa+DM5hV6y0pMA0DkFrzZPudMqazmfpKejK3/PuFkrtTbleBC3K9 ead5d+qoNLi51IhQpNuF3ZA8bMp62qrL6d0vGUJidBwFtKdTmH5UV4SMY8zdvh3l6B5b CTMlrtaQyD7aiJLIXdA/9VDpk+O1BcDB7NnuEZH8I6EZI0rY9ELGk47oGXvsip7kg28R pJUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wk/AfKxmKFFMFtDOBSmyqEUOU7F5xvb3yjHU7rI31n4=; b=w9EBzTy266XajljNdI6A6IO2KcV4YDg+8+G7aZbNaMMwdS6A7Ai14YtU+Y2bsqd9vs cuWMka1d5R9vZHW0Alga1IQ4ZzGpAp17y5mX1m32sXdzd6M2gZJBLlteRU9wnFlpf/fl Cde6V/Vh5saBVXFh7mCY5gW8Rhb4l1sGlv5sFL9TKwk7aa380pfqxSD8aKRxZ38TAo91 5ntAe/8aA13ZTuYTuzpwV/3KPIuMEI5jfF62qH1E9/eZW7vnMO+rY7xM5vCjHNjqzPdY 4lBGVb2OWh170f1dBC32SZ+pCAOzE9OYMgWitv5HurL0/6BlrMS9s3/Cl9/amTCVhKZC +SzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aIwed63k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a056a00088500b00565c028c4edsi13781695pfj.355.2022.10.17.11.40.47; Mon, 17 Oct 2022 11:40:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aIwed63k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230434AbiJQSLK (ORCPT + 99 others); Mon, 17 Oct 2022 14:11:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbiJQSLI (ORCPT ); Mon, 17 Oct 2022 14:11:08 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 170AE6D9E9 for ; Mon, 17 Oct 2022 11:11:03 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id h12so11741954pjk.0 for ; Mon, 17 Oct 2022 11:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=wk/AfKxmKFFMFtDOBSmyqEUOU7F5xvb3yjHU7rI31n4=; b=aIwed63klUDo4ZfnVYo5sFh2Wh9Cyo0Wi7mucCNbpPn+JH2k43Rp/Z8N8K9lf7ujVP io8FvnbDY9GHHeAs7p9DDW7PmTsDVyNZcakall+CN5pHextcQxGmP1YY/SIzQ4yZY1K1 WQcSquaAKvf1om/K6J20YizK63oKDrlaZTL38= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding: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=wk/AfKxmKFFMFtDOBSmyqEUOU7F5xvb3yjHU7rI31n4=; b=AqVqReLlaOSpX5jfMsXs/unxHRpMX39HqG5d5mMNG+m5LHrRBrxhfGUSySCEvgrYaT CsQPCbmCIa40lCC09dDn9TjFSnuu2MAPOs0V1t/tRuDTwFfcvS/ZCKpQBK9HqTQbCfNA fFMhDCGC5ziLzehrt1Ff0FvJGww/5ovUBhN5P/tyT5ordQaO7po3m5OERmyX/XCAXj7f q7wF4Dr8cauG50vEIBnoKm/4yUve1sj0ASmABwV0xOnpGxG2ryX8oZcyOzSCi0z7g/PN bMPUWhQVxPgqXwMOEjaXlz1x3yi+JRijiVZ7R0AwiZwLbcuUNADfWCYoR0hPYM6ENUk3 ANOQ== X-Gm-Message-State: ACrzQf1UklyCwazc0sBfodoJFSz3VV0eXDsEvkoFCO7OwhFngqBB51F8 n/Z6YYhNoFs14Kkb/Afx/4TF+A== X-Received: by 2002:a17:90b:f02:b0:20a:9965:eeee with SMTP id br2-20020a17090b0f0200b0020a9965eeeemr14825583pjb.182.1666030262802; Mon, 17 Oct 2022 11:11:02 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id s17-20020a170902c65100b00177faf558b5sm6897713pls.250.2022.10.17.11.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 11:11:02 -0700 (PDT) Date: Mon, 17 Oct 2022 11:11:01 -0700 From: Kees Cook To: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= Cc: Mimi Zohar , Paul Moore , James Morris , "Serge E. Hallyn" , Dmitry Kasatkin , 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: <202210171101.2E96A7D557@keescook> References: <20221013222702.never.990-kees@kernel.org> <20221013223654.659758-1-keescook@chromium.org> <08a8b202-69b4-e154-28f5-337a898acf61@digikod.net> <202210141050.A8DF7D10@keescook> <0d2b9d34-2eda-8aa6-d596-eb1899645192@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0d2b9d34-2eda-8aa6-d596-eb1899645192@digikod.net> X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 17, 2022 at 11:26:44AM +0200, Micka?l Sala?n wrote: > > On 14/10/2022 19:59, Kees Cook wrote: > > On Fri, Oct 14, 2022 at 04:40:01PM +0200, Micka?l Sala?n wrote: > > > This is not backward compatible > > > > Why? Nothing will be running LSM hooks until init finishes, at which > > point the integrity inode cache will be allocated. And ima and evm don't > > start up until lateinit. > > > > > , but can easily be fixed thanks to > > > DEFINE_LSM().order > > > > That forces the LSM to be enabled, which may not be desired? > > This is not backward compatible because currently IMA is enabled > independently of the "lsm=" cmdline, which means that for all installed > systems using IMA and also with a custom "lsm=" cmdline, updating the kernel > with this patch will (silently) disable IMA. Using ".order = > LSM_ORDER_FIRST," should keep this behavior. > > BTW, I think we should set such order (but maybe rename it) for LSMs that do > nothing unless configured (e.g. Yama, Landlock). Ah yeah, good point. the .enabled stuff will need to be correctly wired up. Anyway, it's a good starting point for the conversion, so I'm hoping it can be carried forward by someone who is not me. :) (Hint hint to the integrity folks...) > > > Side node: I proposed an alternative to that but it was Nacked: > > > https://lore.kernel.org/all/20210222150608.808146-1-mic@digikod.net/ > > > > Yeah, for the reasons pointed out -- that can't work. The point is to > > not have The Default LSM. I do think Casey's NAK was rather prickly, > > though. ;) > > I don't agree, there is no "the default LSM", and this new behavior is under > an LSM_AUTO configuration option. The "config it twice" aspect of the current situation is suboptimal, yes. Let me go comment on the old thread... -- Kees Cook