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 X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27CB3C433E1 for ; Wed, 24 Mar 2021 12:00:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5B2B61A09 for ; Wed, 24 Mar 2021 12:00:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231739AbhCXL71 (ORCPT ); Wed, 24 Mar 2021 07:59:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231180AbhCXL6w (ORCPT ); Wed, 24 Mar 2021 07:58:52 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CDC8C0613DF for ; Wed, 24 Mar 2021 04:58:52 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id j7so17277953qtx.5 for ; Wed, 24 Mar 2021 04:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5jBoc89Kz6VevDsxjEVnyU/TFyYdt6APOAVRtmq0fb8=; b=uESPpmGPXBld0rbBdOFulTP/bp7Vw1vzzpsrBOc5gi4STO0QG+5a/mWq2Akav5obla hS4qWaawUXrss+CF3nbnj9alafYdmCCUjg+lB8R4JR6heBe7kp6FCGuiRzvdio1+G5fe +UQbuvAaQgL4POdelWCSljzq1R99V+DkakA52uLlci4jlgM9eKnVbWHCX9XA0bl5UXGP RsnmzvZLMNdB9kSGnwpgUhYgx69nmcQvj2MAFjOOJa1R5Fp4Y0+272VQP9Ns4vsbaWm/ pKqMEbp+C8darD9/+7fpS71WO00e595WTxRPb3otBRMw5Sg4/h7uQKCEU3o4nhPg6w1E k+Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5jBoc89Kz6VevDsxjEVnyU/TFyYdt6APOAVRtmq0fb8=; b=SkYLgRqpA5FQ1Jg3zsz93huRdBcH5RliMG8pyNz8h7KZ3N0Vb+6UyT5pi8M5jcPsK3 83HDiYl4h29gOayYt0ylIpn6bddifSXDiFNEHY3hsNzTCMRjS9CsF67wgzsOoO2R+XgS iMUHu2hmeBV/0a5l09V4gWj1YD8idysBhJepGJICLuQtSEgJjSU1sfawyr/mPZF2t8Yh tPzE9eN9ilJaZtLPcPkn8IIl2nM7no0yWF06mu7eug0lfSzoT21ptUIASxpmFM+5cHZS R4XBj+pWTSkBSqKNAcqZXI/pIqbwzTURgSUppvvBA+rh5Xv+7cDiRIpN8cvB7HTC6XiX PUWA== X-Gm-Message-State: AOAM533LZiIwFWCYeEh6hadqJhWbjDodqIjgB9kTrw7V+Tk9L1nwQT1u 3h4HctYLssDNB5gxynHDnPmsTvxNXZSvpZPT2zI29Q== X-Google-Smtp-Source: ABdhPJzVvQlme5fr+htLlezPzoESHNVoYoGvv+4l+SvS1Gdr9SgaUqe2SOi2DcyBVIL+pkPFWwQFwpqVunWSny9LNAQ= X-Received: by 2002:a05:622a:c3:: with SMTP id p3mr2487341qtw.43.1616587130686; Wed, 24 Mar 2021 04:58:50 -0700 (PDT) MIME-Version: 1.0 References: <20210319200358.22816-1-zohar@linux.ibm.com> <20210319200358.22816-2-zohar@linux.ibm.com> <8450c80a-104a-3f36-0963-0ae8fa69e0f2@i-love.sakura.ne.jp> <1a2245c6-3cab-7085-83d3-55b083619303@i-love.sakura.ne.jp> <8039976be3df9bd07374fe4f1931b8ce28b89dab.camel@linux.ibm.com> <8a8763a7-eeeb-3578-d50c-c15919fbe1f9@i-love.sakura.ne.jp> <3ed2004413e0ac07c7bd6f10294d6b6fac6fdbf3.camel@linux.ibm.com> <721b4f8d38b014babb0f4ae829d76014bbf7734e.camel@linux.ibm.com> <0a0c5cc5-0e1b-ef01-60c4-5247af2124f4@i-love.sakura.ne.jp> <37aeaf361bfbd800e29db761f5160f2ce1869298.camel@linux.ibm.com> <05ca20d0-9596-152e-4da2-1ffe28c52055@i-love.sakura.ne.jp> In-Reply-To: From: Dmitry Vyukov Date: Wed, 24 Mar 2021 12:58:39 +0100 Message-ID: Subject: Re: [RFC PATCH 2/2] integrity: double check iint_cache was initialized To: Mimi Zohar Cc: Tetsuo Handa , linux-integrity@vger.kernel.org, James Morris , "Serge E . Hallyn" , linux-security-module , LKML , Eric Biggers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 24, 2021 at 12:49 PM Mimi Zohar wrote: > > On Wed, 2021-03-24 at 12:37 +0100, Dmitry Vyukov wrote: > > On Wed, Mar 24, 2021 at 12:21 PM Tetsuo Handa > > wrote: > > > > > > On 2021/03/24 20:10, Mimi Zohar wrote: > > > > On Wed, 2021-03-24 at 19:10 +0900, Tetsuo Handa wrote: > > > >> On 2021/03/24 1:13, Mimi Zohar wrote: > > > >>> On Wed, 2021-03-24 at 00:14 +0900, Tetsuo Handa wrote: > > > >>>> On 2021/03/23 23:47, Mimi Zohar wrote: > > > >>>>> Initially I also questioned making "integrity" an LSM. Perhaps it's > > > >>>>> time to reconsider. For now, it makes sense to just fix the NULL > > > >>>>> pointer dereferencing. > > > >>>> > > > >>>> Do we think calling panic() as "fix the NULL pointer dereferencing" ? > > > >>> > > > >>> Not supplying "integrity" as an "lsm=" option is a user error. There > > > >>> are only two options - allow or deny the caller to proceed. If the > > > >>> user is expecting the integrity subsystem to be properly working, > > > >>> returning a NULL and allowing the system to boot (RFC patch version) > > > >>> does not make sense. Better to fail early. > > > >> > > > >> What does the "user" mean? Those who load the vmlinux? > > > >> Only the "root" user (so called administrators)? > > > >> Any users including other than "root" user? > > > >> > > > >> If the user means those who load the vmlinux, that user is explicitly asking > > > >> for disabling "integrity" for some reason. In that case, it is a bug if > > > >> booting with "integrity" disabled is impossible. > > > >> > > > >> If the user means something other than those who load the vmlinux, > > > >> is there a possibility that that user (especially non "root" users) is > > > >> allowed to try to use "integrity" ? If processes other than global init > > > >> process can try to use "integrity", wouldn't it be a DoS attack vector? > > > >> Please explain in the descripotion why calling panic() does not cause > > > >> DoS attack vector. > > > > > > > > User in this case, is anyone rebooting the system and is intentionally > > > > changing the default values, dropping the "integrity" option on the > > > > boot command line. > > > > > > OK. Then, I expect that the system boots instead of calling panic(). > > > That user is explicitly asking for disabling "integrity" for some reason. > > > > That was actually my intention. The prebuilt kernel that I use for > > things has all LSMs enabled, but then I needed to try some workload > > with only 1 specific LSM, so I gave a different lsm= argument. > > IMA/EVM is dependent on "integrity". Was your intention to also > disable IMA and EVM? I think, yes... or not sure. I was trying to test a bug that requires a different major LSM and all minor LSMs are presumably irrelevant. I dropped existing lsm= arg and added something like lsm=apparmor. > If so, when disabling "integrity", don't load an > IMA policy. I don't really know what this means. I guess it simply comes from the image? If so, there was no easy way to avoid loading.