Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp289054pxf; Wed, 24 Mar 2021 05:20:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwf9O5lxM5Q1FvbNaUelGBi5sQgglqLWt/bld5F1NKg0diCzSVFxZnPuRTrVdLC2nwacax X-Received: by 2002:a17:906:1fd2:: with SMTP id e18mr3493836ejt.49.1616588439455; Wed, 24 Mar 2021 05:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616588439; cv=none; d=google.com; s=arc-20160816; b=r96ul+qGi6wLWysfyvextBSJmyZLQ31iMdX4N3qEq861R4/ClC+wpIni/ehjd7x3dw 0425Vfcm4qJz1QHxnIoAdXHi16hseraY992OomLRLzed+uD76YSR+PF4pKDYINNgwgVu TmFCXqnlsevmkCexjZpA45Y9CZGvnXhI6ZGnH+gSwum7IgUgiMtbhYS7lYFDiql0+CU0 yiQZhfxJ4yNhZ4t9kkjMjqWJPww+U2085onfKOhbPeDDrYl0j9Mq4TXjv8yyyhFy3/IB bBJYEO5KjOHvglNXzyDhDR7LiHgbzUKKPvDMb5BbhEnfnBpvv4JFPRLMlVdnX2kT2e+C 8PCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5jBoc89Kz6VevDsxjEVnyU/TFyYdt6APOAVRtmq0fb8=; b=Ejm3DDCpY8vac0x0+A9/ICD/RGqElo9Q0ASSpa+Nu/617mYKzsQRTv71wam9IMrR/u aJLw+5dTh0FcoMw73AzOnK/JkVXrFDakkmIuON4BziiGTsdd+2Ed+ULX0jFV+xtyZ4dV gk52rMWTW208p5+sFTkb+QfbLFLKNPwiNvLdiBB79AgIqoy8YUJoXDj21ffgcZzThAm0 WhgHaxBuwtzOgYdvsLdP6J+Gohdx0levX2kHjKr/n5lOqxpHyEYHxIpXO3WG7FoEE1Wr 33idCD3R5NqQI6scB1brUGDC2lFEgCPjunCrGUxiF4HACQkdP9v6RtLuz/FgdqKP4RdM oFFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uESPpmGP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si1720398edw.146.2021.03.24.05.20.17; Wed, 24 Mar 2021 05:20:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uESPpmGP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230318AbhCXL71 (ORCPT + 99 others); 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-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.